@umituz/react-native-localization 1.16.1 → 1.17.0

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-localization",
3
- "version": "1.16.1",
3
+ "version": "1.17.0",
4
4
  "description": "English-only localization system for React Native apps with i18n support",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,22 +1,30 @@
1
1
  /**
2
- * Auto-loader for en-US translation modules
2
+ * en-US Translation Module
3
3
  *
4
- * Uses @umituz/react-native-filesystem for professional module loading
5
- * - Auto-discovers all .json files in this directory
6
- * - Zero manual updates needed when adding new translation files
7
- * - Type-safe with TypeScript
8
- *
9
- * USAGE:
10
- * 1. Create new translation file: my_domain.json
11
- * 2. File is auto-discovered and loaded
12
- * 3. Access via t('my_domain.key')
4
+ * Direct loading for maximum compatibility across platforms
5
+ * - Explicit imports for reliable bundling
6
+ * - Flattened with dot notation
7
+ * - Production-ready and tested
13
8
  */
14
9
 
15
- import { loadJsonModules } from '@umituz/react-native-filesystem';
16
-
17
- // Metro bundler require.context - auto-discover all .json files
18
- // eslint-disable-next-line @typescript-eslint/no-require-imports
19
- const translationContext = (require as any).context('./', false, /\.json$/);
10
+ import alerts from './alerts.json';
11
+ import auth from './auth.json';
12
+ import branding from './branding.json';
13
+ import clipboard from './clipboard.json';
14
+ import datetime from './datetime.json';
15
+ import device from './device.json';
16
+ import editor from './editor.json';
17
+ import errors from './errors.json';
18
+ import general from './general.json';
19
+ import goals from './goals.json';
20
+ import haptics from './haptics.json';
21
+ import home from './home.json';
22
+ import navigation from './navigation.json';
23
+ import onboarding from './onboarding.json';
24
+ import projects from './projects.json';
25
+ import settings from './settings.json';
26
+ import sharing from './sharing.json';
27
+ import templates from './templates.json';
20
28
 
21
29
  /**
22
30
  * Flatten nested objects with dot notation
@@ -40,11 +48,26 @@ const flattenObject = (
40
48
  return flattened;
41
49
  };
42
50
 
43
- // Load all JSON modules automatically using filesystem utility
44
- const modules = loadJsonModules(translationContext);
45
-
46
- // Flatten all translations with dot notation
47
- // Creates keys like: home.title, goals.title, progress.title
48
- const translations = flattenObject(modules);
51
+ // Create flattened translations object
52
+ const translations = {
53
+ ...flattenObject(alerts, 'alerts'),
54
+ ...flattenObject(auth, 'auth'),
55
+ ...flattenObject(branding, 'branding'),
56
+ ...flattenObject(clipboard, 'clipboard'),
57
+ ...flattenObject(datetime, 'datetime'),
58
+ ...flattenObject(device, 'device'),
59
+ ...flattenObject(editor, 'editor'),
60
+ ...flattenObject(errors, 'errors'),
61
+ ...flattenObject(general, 'general'),
62
+ ...flattenObject(goals, 'goals'),
63
+ ...flattenObject(haptics, 'haptics'),
64
+ ...flattenObject(home, 'home'),
65
+ ...flattenObject(navigation, 'navigation'),
66
+ ...flattenObject(onboarding, 'onboarding'),
67
+ ...flattenObject(projects, 'projects'),
68
+ ...flattenObject(settings, 'settings'),
69
+ ...flattenObject(sharing, 'sharing'),
70
+ ...flattenObject(templates, 'templates'),
71
+ };
49
72
 
50
73
  export default translations;