@umituz/react-native-settings 5.2.40 → 5.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-settings",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.41",
|
|
4
4
|
"description": "Complete settings hub for React Native apps - consolidated package with settings, localization, about, legal, appearance, feedback, FAQs, rating, and gamification",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Setup Languages Script
|
|
5
|
-
*
|
|
5
|
+
* Creates stub files for all supported languages (if not exist),
|
|
6
|
+
* then generates index.ts from all available translation files.
|
|
6
7
|
* Usage: node setup-languages.js [locales-dir]
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
import fs from 'fs';
|
|
10
11
|
import path from 'path';
|
|
12
|
+
import { LANGUAGE_MAP, getLangDisplayName } from './utils/translation-config.js';
|
|
11
13
|
|
|
12
14
|
export function setupLanguages(targetDir) {
|
|
13
15
|
const localesDir = path.resolve(process.cwd(), targetDir);
|
|
@@ -17,6 +19,29 @@ export function setupLanguages(targetDir) {
|
|
|
17
19
|
return false;
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
// Create stub files for all supported languages that don't exist yet
|
|
23
|
+
let created = 0;
|
|
24
|
+
for (const langCode of Object.keys(LANGUAGE_MAP)) {
|
|
25
|
+
// Skip English variants — en-US is the base, others (en-AU, en-GB) are redundant
|
|
26
|
+
if (langCode.startsWith('en-') && langCode !== 'en-US') continue;
|
|
27
|
+
|
|
28
|
+
const filePath = path.join(localesDir, `${langCode}.ts`);
|
|
29
|
+
if (!fs.existsSync(filePath)) {
|
|
30
|
+
const langName = getLangDisplayName(langCode);
|
|
31
|
+
fs.writeFileSync(
|
|
32
|
+
filePath,
|
|
33
|
+
`/**\n * ${langName} Translations\n * Auto-synced from en-US.ts\n */\n\nexport default {};\n`,
|
|
34
|
+
);
|
|
35
|
+
console.log(` ✅ Created ${langCode}.ts (${langName})`);
|
|
36
|
+
created++;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (created > 0) {
|
|
41
|
+
console.log(`\n📦 Created ${created} new language stubs.\n`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Generate index.ts from all language files
|
|
20
45
|
const files = fs.readdirSync(localesDir)
|
|
21
46
|
.filter(f => f.match(/^[a-z]{2}-[A-Z]{2}\.ts$/))
|
|
22
47
|
.sort();
|