1
0
mirror of https://gitcode.com/github-mirrors/react-native-update-cli.git synced 2025-09-16 09:41:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

Refactor i18n locales from JSON to TypeScript modules

This commit is contained in:
sunnylqm
2025-02-15 22:51:26 +08:00
parent f10d4d3004
commit 1fb308af94
6 changed files with 8 additions and 5 deletions

View File

@@ -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;

View File

@@ -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,
},
});

View File

@@ -1 +0,0 @@
{}

View File

@@ -1 +0,0 @@
{}

1
src/locales/en.ts Normal file
View File

@@ -0,0 +1 @@
export default {};

1
src/locales/zh.ts Normal file
View File

@@ -0,0 +1 @@
export default {};