mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
Refactor i18n locales from JSON to TypeScript modules
This commit is contained in:
@@ -225,6 +225,7 @@ async function runReactNativeBundleCommand({
|
||||
|
||||
if (disableHermes) {
|
||||
hermesEnabled = false;
|
||||
console.log('Hermes disabled');
|
||||
} else if (platform === 'android') {
|
||||
const gradlePropeties = await new Promise<{
|
||||
hermesEnabled?: boolean;
|
||||
|
@@ -6,6 +6,8 @@ import { printVersionCommand } from './utils';
|
||||
import pkg from '../package.json';
|
||||
import path from 'node:path';
|
||||
import i18next from 'i18next';
|
||||
import en from './locales/en';
|
||||
import zh from './locales/zh';
|
||||
|
||||
const scriptName: 'cresc' | 'pushy' = path.basename(process.argv[1]) as
|
||||
| 'cresc'
|
||||
@@ -14,10 +16,10 @@ global.IS_CRESC = scriptName === 'cresc';
|
||||
|
||||
i18next.init({
|
||||
lng: global.IS_CRESC ? 'en' : 'zh',
|
||||
debug: process.env.NODE_ENV !== 'production',
|
||||
// debug: process.env.NODE_ENV !== 'production',
|
||||
resources: {
|
||||
en: require('./locales/en.json'),
|
||||
zh: require('./locales/zh.json'),
|
||||
en,
|
||||
zh,
|
||||
},
|
||||
});
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
{}
|
@@ -1 +0,0 @@
|
||||
{}
|
1
src/locales/en.ts
Normal file
1
src/locales/en.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
1
src/locales/zh.ts
Normal file
1
src/locales/zh.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default {};
|
Reference in New Issue
Block a user