mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-10-30 22:33:11 +08:00
add logic to support multi language (#11)
* add logic to support multi language * Update en.ts * Update en.ts --------- Co-authored-by: Sunny Luo <sunnylqm@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import fs from 'node:fs';
|
||||
// import path from 'node:path';
|
||||
import { credentialFile, tempDir } from './constants';
|
||||
import { t } from './i18n';
|
||||
|
||||
export function addGitIgnore() {
|
||||
const shouldIgnore = [credentialFile, tempDir];
|
||||
@@ -26,7 +27,7 @@ export function addGitIgnore() {
|
||||
gitignoreLines.push('# react-native-update');
|
||||
for (const line of shouldIgnore) {
|
||||
gitignoreLines.push(line);
|
||||
console.log(`Added ${line} to .gitignore`);
|
||||
console.log(t('addedToGitignore', { line }));
|
||||
}
|
||||
|
||||
fs.writeFileSync(gitignorePath, gitignoreLines.join('\n'));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { plugins } from './plugin-config';
|
||||
import { t } from './i18n';
|
||||
|
||||
interface BundleParams {
|
||||
sentry: boolean;
|
||||
@@ -17,10 +18,10 @@ export async function checkPlugins(): Promise<BundleParams> {
|
||||
const isEnabled = await plugin.detect();
|
||||
if (isEnabled && plugin.bundleParams) {
|
||||
Object.assign(params, plugin.bundleParams);
|
||||
console.log(`detected ${plugin.name} plugin`);
|
||||
console.log(t('pluginDetected', { name: plugin.name }));
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn(`error while detecting ${plugin.name} plugin:`, err);
|
||||
console.warn(t('pluginDetectionError', { name: plugin.name, error: err }));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user