@umituz/react-native-localization 1.3.10 → 1.5.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.
Files changed (542) hide show
  1. package/lib/infrastructure/config/i18n.d.ts +5 -0
  2. package/lib/infrastructure/config/i18n.d.ts.map +1 -1
  3. package/lib/infrastructure/config/i18n.js +192 -17
  4. package/lib/infrastructure/config/i18n.js.map +1 -1
  5. package/lib/infrastructure/locales/en-US/index.d.ts +21 -26
  6. package/lib/infrastructure/locales/en-US/index.d.ts.map +1 -1
  7. package/lib/infrastructure/locales/en-US/index.js +32 -39
  8. package/lib/infrastructure/locales/en-US/index.js.map +1 -1
  9. package/package.json +1 -1
  10. package/scripts/createLocaleLoaders.js +35 -28
  11. package/scripts/setup-languages.js +113 -0
  12. package/src/infrastructure/config/i18n.ts +200 -18
  13. package/src/infrastructure/locales/en-US/index.ts +33 -39
  14. package/lib/infrastructure/locales/ar-SA/index.d.ts +0 -34
  15. package/lib/infrastructure/locales/ar-SA/index.d.ts.map +0 -1
  16. package/lib/infrastructure/locales/ar-SA/index.js +0 -47
  17. package/lib/infrastructure/locales/ar-SA/index.js.map +0 -1
  18. package/lib/infrastructure/locales/bg-BG/index.d.ts +0 -34
  19. package/lib/infrastructure/locales/bg-BG/index.d.ts.map +0 -1
  20. package/lib/infrastructure/locales/bg-BG/index.js +0 -47
  21. package/lib/infrastructure/locales/bg-BG/index.js.map +0 -1
  22. package/lib/infrastructure/locales/cs-CZ/index.d.ts +0 -34
  23. package/lib/infrastructure/locales/cs-CZ/index.d.ts.map +0 -1
  24. package/lib/infrastructure/locales/cs-CZ/index.js +0 -47
  25. package/lib/infrastructure/locales/cs-CZ/index.js.map +0 -1
  26. package/lib/infrastructure/locales/da-DK/index.d.ts +0 -34
  27. package/lib/infrastructure/locales/da-DK/index.d.ts.map +0 -1
  28. package/lib/infrastructure/locales/da-DK/index.js +0 -47
  29. package/lib/infrastructure/locales/da-DK/index.js.map +0 -1
  30. package/lib/infrastructure/locales/de-DE/index.d.ts +0 -34
  31. package/lib/infrastructure/locales/de-DE/index.d.ts.map +0 -1
  32. package/lib/infrastructure/locales/de-DE/index.js +0 -47
  33. package/lib/infrastructure/locales/de-DE/index.js.map +0 -1
  34. package/lib/infrastructure/locales/el-GR/index.d.ts +0 -34
  35. package/lib/infrastructure/locales/el-GR/index.d.ts.map +0 -1
  36. package/lib/infrastructure/locales/el-GR/index.js +0 -47
  37. package/lib/infrastructure/locales/el-GR/index.js.map +0 -1
  38. package/lib/infrastructure/locales/en-AU/index.d.ts +0 -32
  39. package/lib/infrastructure/locales/en-AU/index.d.ts.map +0 -1
  40. package/lib/infrastructure/locales/en-AU/index.js +0 -44
  41. package/lib/infrastructure/locales/en-AU/index.js.map +0 -1
  42. package/lib/infrastructure/locales/en-CA/index.d.ts +0 -32
  43. package/lib/infrastructure/locales/en-CA/index.d.ts.map +0 -1
  44. package/lib/infrastructure/locales/en-CA/index.js +0 -44
  45. package/lib/infrastructure/locales/en-CA/index.js.map +0 -1
  46. package/lib/infrastructure/locales/en-GB/index.d.ts +0 -32
  47. package/lib/infrastructure/locales/en-GB/index.d.ts.map +0 -1
  48. package/lib/infrastructure/locales/en-GB/index.js +0 -44
  49. package/lib/infrastructure/locales/en-GB/index.js.map +0 -1
  50. package/lib/infrastructure/locales/es-ES/index.d.ts +0 -34
  51. package/lib/infrastructure/locales/es-ES/index.d.ts.map +0 -1
  52. package/lib/infrastructure/locales/es-ES/index.js +0 -47
  53. package/lib/infrastructure/locales/es-ES/index.js.map +0 -1
  54. package/lib/infrastructure/locales/es-MX/index.d.ts +0 -34
  55. package/lib/infrastructure/locales/es-MX/index.d.ts.map +0 -1
  56. package/lib/infrastructure/locales/es-MX/index.js +0 -47
  57. package/lib/infrastructure/locales/es-MX/index.js.map +0 -1
  58. package/lib/infrastructure/locales/fi-FI/index.d.ts +0 -34
  59. package/lib/infrastructure/locales/fi-FI/index.d.ts.map +0 -1
  60. package/lib/infrastructure/locales/fi-FI/index.js +0 -47
  61. package/lib/infrastructure/locales/fi-FI/index.js.map +0 -1
  62. package/lib/infrastructure/locales/fr-CA/index.d.ts +0 -34
  63. package/lib/infrastructure/locales/fr-CA/index.d.ts.map +0 -1
  64. package/lib/infrastructure/locales/fr-CA/index.js +0 -47
  65. package/lib/infrastructure/locales/fr-CA/index.js.map +0 -1
  66. package/lib/infrastructure/locales/fr-FR/index.d.ts +0 -34
  67. package/lib/infrastructure/locales/fr-FR/index.d.ts.map +0 -1
  68. package/lib/infrastructure/locales/fr-FR/index.js +0 -47
  69. package/lib/infrastructure/locales/fr-FR/index.js.map +0 -1
  70. package/lib/infrastructure/locales/hi-IN/index.d.ts +0 -34
  71. package/lib/infrastructure/locales/hi-IN/index.d.ts.map +0 -1
  72. package/lib/infrastructure/locales/hi-IN/index.js +0 -47
  73. package/lib/infrastructure/locales/hi-IN/index.js.map +0 -1
  74. package/lib/infrastructure/locales/hr-HR/index.d.ts +0 -34
  75. package/lib/infrastructure/locales/hr-HR/index.d.ts.map +0 -1
  76. package/lib/infrastructure/locales/hr-HR/index.js +0 -47
  77. package/lib/infrastructure/locales/hr-HR/index.js.map +0 -1
  78. package/lib/infrastructure/locales/hu-HU/index.d.ts +0 -34
  79. package/lib/infrastructure/locales/hu-HU/index.d.ts.map +0 -1
  80. package/lib/infrastructure/locales/hu-HU/index.js +0 -47
  81. package/lib/infrastructure/locales/hu-HU/index.js.map +0 -1
  82. package/lib/infrastructure/locales/id-ID/index.d.ts +0 -34
  83. package/lib/infrastructure/locales/id-ID/index.d.ts.map +0 -1
  84. package/lib/infrastructure/locales/id-ID/index.js +0 -47
  85. package/lib/infrastructure/locales/id-ID/index.js.map +0 -1
  86. package/lib/infrastructure/locales/it-IT/index.d.ts +0 -34
  87. package/lib/infrastructure/locales/it-IT/index.d.ts.map +0 -1
  88. package/lib/infrastructure/locales/it-IT/index.js +0 -47
  89. package/lib/infrastructure/locales/it-IT/index.js.map +0 -1
  90. package/lib/infrastructure/locales/ja-JP/index.d.ts +0 -34
  91. package/lib/infrastructure/locales/ja-JP/index.d.ts.map +0 -1
  92. package/lib/infrastructure/locales/ja-JP/index.js +0 -47
  93. package/lib/infrastructure/locales/ja-JP/index.js.map +0 -1
  94. package/lib/infrastructure/locales/ko-KR/index.d.ts +0 -34
  95. package/lib/infrastructure/locales/ko-KR/index.d.ts.map +0 -1
  96. package/lib/infrastructure/locales/ko-KR/index.js +0 -47
  97. package/lib/infrastructure/locales/ko-KR/index.js.map +0 -1
  98. package/lib/infrastructure/locales/ms-MY/index.d.ts +0 -34
  99. package/lib/infrastructure/locales/ms-MY/index.d.ts.map +0 -1
  100. package/lib/infrastructure/locales/ms-MY/index.js +0 -47
  101. package/lib/infrastructure/locales/ms-MY/index.js.map +0 -1
  102. package/lib/infrastructure/locales/nl-NL/index.d.ts +0 -34
  103. package/lib/infrastructure/locales/nl-NL/index.d.ts.map +0 -1
  104. package/lib/infrastructure/locales/nl-NL/index.js +0 -47
  105. package/lib/infrastructure/locales/nl-NL/index.js.map +0 -1
  106. package/lib/infrastructure/locales/no-NO/index.d.ts +0 -34
  107. package/lib/infrastructure/locales/no-NO/index.d.ts.map +0 -1
  108. package/lib/infrastructure/locales/no-NO/index.js +0 -47
  109. package/lib/infrastructure/locales/no-NO/index.js.map +0 -1
  110. package/lib/infrastructure/locales/pl-PL/index.d.ts +0 -34
  111. package/lib/infrastructure/locales/pl-PL/index.d.ts.map +0 -1
  112. package/lib/infrastructure/locales/pl-PL/index.js +0 -47
  113. package/lib/infrastructure/locales/pl-PL/index.js.map +0 -1
  114. package/lib/infrastructure/locales/pt-BR/index.d.ts +0 -34
  115. package/lib/infrastructure/locales/pt-BR/index.d.ts.map +0 -1
  116. package/lib/infrastructure/locales/pt-BR/index.js +0 -47
  117. package/lib/infrastructure/locales/pt-BR/index.js.map +0 -1
  118. package/lib/infrastructure/locales/pt-PT/index.d.ts +0 -34
  119. package/lib/infrastructure/locales/pt-PT/index.d.ts.map +0 -1
  120. package/lib/infrastructure/locales/pt-PT/index.js +0 -47
  121. package/lib/infrastructure/locales/pt-PT/index.js.map +0 -1
  122. package/lib/infrastructure/locales/ro-RO/index.d.ts +0 -34
  123. package/lib/infrastructure/locales/ro-RO/index.d.ts.map +0 -1
  124. package/lib/infrastructure/locales/ro-RO/index.js +0 -47
  125. package/lib/infrastructure/locales/ro-RO/index.js.map +0 -1
  126. package/lib/infrastructure/locales/ru-RU/index.d.ts +0 -34
  127. package/lib/infrastructure/locales/ru-RU/index.d.ts.map +0 -1
  128. package/lib/infrastructure/locales/ru-RU/index.js +0 -47
  129. package/lib/infrastructure/locales/ru-RU/index.js.map +0 -1
  130. package/lib/infrastructure/locales/sk-SK/index.d.ts +0 -34
  131. package/lib/infrastructure/locales/sk-SK/index.d.ts.map +0 -1
  132. package/lib/infrastructure/locales/sk-SK/index.js +0 -47
  133. package/lib/infrastructure/locales/sk-SK/index.js.map +0 -1
  134. package/lib/infrastructure/locales/sv-SE/index.d.ts +0 -34
  135. package/lib/infrastructure/locales/sv-SE/index.d.ts.map +0 -1
  136. package/lib/infrastructure/locales/sv-SE/index.js +0 -47
  137. package/lib/infrastructure/locales/sv-SE/index.js.map +0 -1
  138. package/lib/infrastructure/locales/th-TH/index.d.ts +0 -34
  139. package/lib/infrastructure/locales/th-TH/index.d.ts.map +0 -1
  140. package/lib/infrastructure/locales/th-TH/index.js +0 -47
  141. package/lib/infrastructure/locales/th-TH/index.js.map +0 -1
  142. package/lib/infrastructure/locales/tl-PH/index.d.ts +0 -34
  143. package/lib/infrastructure/locales/tl-PH/index.d.ts.map +0 -1
  144. package/lib/infrastructure/locales/tl-PH/index.js +0 -47
  145. package/lib/infrastructure/locales/tl-PH/index.js.map +0 -1
  146. package/lib/infrastructure/locales/tr-TR/index.d.ts +0 -34
  147. package/lib/infrastructure/locales/tr-TR/index.d.ts.map +0 -1
  148. package/lib/infrastructure/locales/tr-TR/index.js +0 -47
  149. package/lib/infrastructure/locales/tr-TR/index.js.map +0 -1
  150. package/lib/infrastructure/locales/uk-UA/index.d.ts +0 -34
  151. package/lib/infrastructure/locales/uk-UA/index.d.ts.map +0 -1
  152. package/lib/infrastructure/locales/uk-UA/index.js +0 -47
  153. package/lib/infrastructure/locales/uk-UA/index.js.map +0 -1
  154. package/lib/infrastructure/locales/vi-VN/index.d.ts +0 -34
  155. package/lib/infrastructure/locales/vi-VN/index.d.ts.map +0 -1
  156. package/lib/infrastructure/locales/vi-VN/index.js +0 -47
  157. package/lib/infrastructure/locales/vi-VN/index.js.map +0 -1
  158. package/lib/infrastructure/locales/zh-CN/index.d.ts +0 -34
  159. package/lib/infrastructure/locales/zh-CN/index.d.ts.map +0 -1
  160. package/lib/infrastructure/locales/zh-CN/index.js +0 -47
  161. package/lib/infrastructure/locales/zh-CN/index.js.map +0 -1
  162. package/lib/infrastructure/locales/zh-TW/index.d.ts +0 -34
  163. package/lib/infrastructure/locales/zh-TW/index.d.ts.map +0 -1
  164. package/lib/infrastructure/locales/zh-TW/index.js +0 -47
  165. package/lib/infrastructure/locales/zh-TW/index.js.map +0 -1
  166. package/src/infrastructure/locales/ar-SA/auth.json +0 -32
  167. package/src/infrastructure/locales/ar-SA/branding.json +0 -9
  168. package/src/infrastructure/locales/ar-SA/datetime.json +0 -140
  169. package/src/infrastructure/locales/ar-SA/errors.json +0 -43
  170. package/src/infrastructure/locales/ar-SA/flashcards.json +0 -287
  171. package/src/infrastructure/locales/ar-SA/general.json +0 -61
  172. package/src/infrastructure/locales/ar-SA/index.ts +0 -49
  173. package/src/infrastructure/locales/ar-SA/navigation.json +0 -58
  174. package/src/infrastructure/locales/ar-SA/onboarding.json +0 -76
  175. package/src/infrastructure/locales/ar-SA/settings.json +0 -53
  176. package/src/infrastructure/locales/bg-BG/auth.json +0 -32
  177. package/src/infrastructure/locales/bg-BG/branding.json +0 -9
  178. package/src/infrastructure/locales/bg-BG/datetime.json +0 -140
  179. package/src/infrastructure/locales/bg-BG/errors.json +0 -43
  180. package/src/infrastructure/locales/bg-BG/flashcards.json +0 -287
  181. package/src/infrastructure/locales/bg-BG/general.json +0 -61
  182. package/src/infrastructure/locales/bg-BG/index.ts +0 -49
  183. package/src/infrastructure/locales/bg-BG/navigation.json +0 -58
  184. package/src/infrastructure/locales/bg-BG/onboarding.json +0 -76
  185. package/src/infrastructure/locales/bg-BG/settings.json +0 -53
  186. package/src/infrastructure/locales/cs-CZ/auth.json +0 -32
  187. package/src/infrastructure/locales/cs-CZ/branding.json +0 -9
  188. package/src/infrastructure/locales/cs-CZ/datetime.json +0 -140
  189. package/src/infrastructure/locales/cs-CZ/errors.json +0 -43
  190. package/src/infrastructure/locales/cs-CZ/flashcards.json +0 -287
  191. package/src/infrastructure/locales/cs-CZ/general.json +0 -61
  192. package/src/infrastructure/locales/cs-CZ/index.ts +0 -49
  193. package/src/infrastructure/locales/cs-CZ/navigation.json +0 -58
  194. package/src/infrastructure/locales/cs-CZ/onboarding.json +0 -76
  195. package/src/infrastructure/locales/cs-CZ/settings.json +0 -53
  196. package/src/infrastructure/locales/da-DK/auth.json +0 -32
  197. package/src/infrastructure/locales/da-DK/branding.json +0 -9
  198. package/src/infrastructure/locales/da-DK/datetime.json +0 -140
  199. package/src/infrastructure/locales/da-DK/errors.json +0 -43
  200. package/src/infrastructure/locales/da-DK/flashcards.json +0 -287
  201. package/src/infrastructure/locales/da-DK/general.json +0 -61
  202. package/src/infrastructure/locales/da-DK/index.ts +0 -49
  203. package/src/infrastructure/locales/da-DK/navigation.json +0 -58
  204. package/src/infrastructure/locales/da-DK/onboarding.json +0 -76
  205. package/src/infrastructure/locales/da-DK/settings.json +0 -53
  206. package/src/infrastructure/locales/de-DE/auth.json +0 -32
  207. package/src/infrastructure/locales/de-DE/branding.json +0 -9
  208. package/src/infrastructure/locales/de-DE/datetime.json +0 -140
  209. package/src/infrastructure/locales/de-DE/errors.json +0 -43
  210. package/src/infrastructure/locales/de-DE/flashcards.json +0 -287
  211. package/src/infrastructure/locales/de-DE/general.json +0 -61
  212. package/src/infrastructure/locales/de-DE/index.ts +0 -49
  213. package/src/infrastructure/locales/de-DE/navigation.json +0 -58
  214. package/src/infrastructure/locales/de-DE/onboarding.json +0 -76
  215. package/src/infrastructure/locales/de-DE/settings.json +0 -53
  216. package/src/infrastructure/locales/el-GR/auth.json +0 -32
  217. package/src/infrastructure/locales/el-GR/branding.json +0 -9
  218. package/src/infrastructure/locales/el-GR/datetime.json +0 -140
  219. package/src/infrastructure/locales/el-GR/errors.json +0 -43
  220. package/src/infrastructure/locales/el-GR/flashcards.json +0 -287
  221. package/src/infrastructure/locales/el-GR/general.json +0 -61
  222. package/src/infrastructure/locales/el-GR/index.ts +0 -49
  223. package/src/infrastructure/locales/el-GR/navigation.json +0 -58
  224. package/src/infrastructure/locales/el-GR/onboarding.json +0 -76
  225. package/src/infrastructure/locales/el-GR/settings.json +0 -53
  226. package/src/infrastructure/locales/en-AU/branding.json +0 -11
  227. package/src/infrastructure/locales/en-AU/datetime.json +0 -140
  228. package/src/infrastructure/locales/en-AU/errors.json +0 -43
  229. package/src/infrastructure/locales/en-AU/flashcards.json +0 -83
  230. package/src/infrastructure/locales/en-AU/general.json +0 -61
  231. package/src/infrastructure/locales/en-AU/index.ts +0 -46
  232. package/src/infrastructure/locales/en-AU/navigation.json +0 -58
  233. package/src/infrastructure/locales/en-AU/onboarding.json +0 -76
  234. package/src/infrastructure/locales/en-AU/settings.json +0 -53
  235. package/src/infrastructure/locales/en-CA/branding.json +0 -11
  236. package/src/infrastructure/locales/en-CA/datetime.json +0 -140
  237. package/src/infrastructure/locales/en-CA/errors.json +0 -43
  238. package/src/infrastructure/locales/en-CA/flashcards.json +0 -83
  239. package/src/infrastructure/locales/en-CA/general.json +0 -61
  240. package/src/infrastructure/locales/en-CA/index.ts +0 -46
  241. package/src/infrastructure/locales/en-CA/navigation.json +0 -58
  242. package/src/infrastructure/locales/en-CA/onboarding.json +0 -76
  243. package/src/infrastructure/locales/en-CA/settings.json +0 -53
  244. package/src/infrastructure/locales/en-GB/branding.json +0 -11
  245. package/src/infrastructure/locales/en-GB/datetime.json +0 -140
  246. package/src/infrastructure/locales/en-GB/errors.json +0 -43
  247. package/src/infrastructure/locales/en-GB/flashcards.json +0 -83
  248. package/src/infrastructure/locales/en-GB/general.json +0 -61
  249. package/src/infrastructure/locales/en-GB/index.ts +0 -46
  250. package/src/infrastructure/locales/en-GB/navigation.json +0 -58
  251. package/src/infrastructure/locales/en-GB/onboarding.json +0 -76
  252. package/src/infrastructure/locales/en-GB/settings.json +0 -53
  253. package/src/infrastructure/locales/es-ES/auth.json +0 -32
  254. package/src/infrastructure/locales/es-ES/branding.json +0 -9
  255. package/src/infrastructure/locales/es-ES/datetime.json +0 -140
  256. package/src/infrastructure/locales/es-ES/errors.json +0 -43
  257. package/src/infrastructure/locales/es-ES/flashcards.json +0 -287
  258. package/src/infrastructure/locales/es-ES/general.json +0 -61
  259. package/src/infrastructure/locales/es-ES/index.ts +0 -49
  260. package/src/infrastructure/locales/es-ES/navigation.json +0 -58
  261. package/src/infrastructure/locales/es-ES/onboarding.json +0 -76
  262. package/src/infrastructure/locales/es-ES/settings.json +0 -53
  263. package/src/infrastructure/locales/es-MX/auth.json +0 -32
  264. package/src/infrastructure/locales/es-MX/branding.json +0 -9
  265. package/src/infrastructure/locales/es-MX/datetime.json +0 -140
  266. package/src/infrastructure/locales/es-MX/errors.json +0 -43
  267. package/src/infrastructure/locales/es-MX/flashcards.json +0 -276
  268. package/src/infrastructure/locales/es-MX/general.json +0 -61
  269. package/src/infrastructure/locales/es-MX/index.ts +0 -49
  270. package/src/infrastructure/locales/es-MX/navigation.json +0 -58
  271. package/src/infrastructure/locales/es-MX/onboarding.json +0 -76
  272. package/src/infrastructure/locales/es-MX/settings.json +0 -53
  273. package/src/infrastructure/locales/fi-FI/auth.json +0 -32
  274. package/src/infrastructure/locales/fi-FI/branding.json +0 -9
  275. package/src/infrastructure/locales/fi-FI/datetime.json +0 -140
  276. package/src/infrastructure/locales/fi-FI/errors.json +0 -43
  277. package/src/infrastructure/locales/fi-FI/flashcards.json +0 -287
  278. package/src/infrastructure/locales/fi-FI/general.json +0 -61
  279. package/src/infrastructure/locales/fi-FI/index.ts +0 -49
  280. package/src/infrastructure/locales/fi-FI/navigation.json +0 -58
  281. package/src/infrastructure/locales/fi-FI/onboarding.json +0 -76
  282. package/src/infrastructure/locales/fi-FI/settings.json +0 -53
  283. package/src/infrastructure/locales/fr-CA/auth.json +0 -32
  284. package/src/infrastructure/locales/fr-CA/branding.json +0 -9
  285. package/src/infrastructure/locales/fr-CA/datetime.json +0 -140
  286. package/src/infrastructure/locales/fr-CA/errors.json +0 -43
  287. package/src/infrastructure/locales/fr-CA/flashcards.json +0 -287
  288. package/src/infrastructure/locales/fr-CA/general.json +0 -61
  289. package/src/infrastructure/locales/fr-CA/index.ts +0 -49
  290. package/src/infrastructure/locales/fr-CA/navigation.json +0 -58
  291. package/src/infrastructure/locales/fr-CA/onboarding.json +0 -76
  292. package/src/infrastructure/locales/fr-CA/settings.json +0 -53
  293. package/src/infrastructure/locales/fr-FR/auth.json +0 -32
  294. package/src/infrastructure/locales/fr-FR/branding.json +0 -9
  295. package/src/infrastructure/locales/fr-FR/datetime.json +0 -140
  296. package/src/infrastructure/locales/fr-FR/errors.json +0 -43
  297. package/src/infrastructure/locales/fr-FR/flashcards.json +0 -287
  298. package/src/infrastructure/locales/fr-FR/general.json +0 -61
  299. package/src/infrastructure/locales/fr-FR/index.ts +0 -49
  300. package/src/infrastructure/locales/fr-FR/navigation.json +0 -58
  301. package/src/infrastructure/locales/fr-FR/onboarding.json +0 -76
  302. package/src/infrastructure/locales/fr-FR/settings.json +0 -53
  303. package/src/infrastructure/locales/hi-IN/auth.json +0 -32
  304. package/src/infrastructure/locales/hi-IN/branding.json +0 -9
  305. package/src/infrastructure/locales/hi-IN/datetime.json +0 -140
  306. package/src/infrastructure/locales/hi-IN/errors.json +0 -43
  307. package/src/infrastructure/locales/hi-IN/flashcards.json +0 -287
  308. package/src/infrastructure/locales/hi-IN/general.json +0 -61
  309. package/src/infrastructure/locales/hi-IN/index.ts +0 -49
  310. package/src/infrastructure/locales/hi-IN/navigation.json +0 -58
  311. package/src/infrastructure/locales/hi-IN/onboarding.json +0 -76
  312. package/src/infrastructure/locales/hi-IN/settings.json +0 -53
  313. package/src/infrastructure/locales/hr-HR/auth.json +0 -32
  314. package/src/infrastructure/locales/hr-HR/branding.json +0 -9
  315. package/src/infrastructure/locales/hr-HR/datetime.json +0 -140
  316. package/src/infrastructure/locales/hr-HR/errors.json +0 -43
  317. package/src/infrastructure/locales/hr-HR/flashcards.json +0 -276
  318. package/src/infrastructure/locales/hr-HR/general.json +0 -61
  319. package/src/infrastructure/locales/hr-HR/index.ts +0 -49
  320. package/src/infrastructure/locales/hr-HR/navigation.json +0 -58
  321. package/src/infrastructure/locales/hr-HR/onboarding.json +0 -76
  322. package/src/infrastructure/locales/hr-HR/settings.json +0 -53
  323. package/src/infrastructure/locales/hu-HU/auth.json +0 -32
  324. package/src/infrastructure/locales/hu-HU/branding.json +0 -9
  325. package/src/infrastructure/locales/hu-HU/datetime.json +0 -140
  326. package/src/infrastructure/locales/hu-HU/errors.json +0 -43
  327. package/src/infrastructure/locales/hu-HU/flashcards.json +0 -287
  328. package/src/infrastructure/locales/hu-HU/general.json +0 -61
  329. package/src/infrastructure/locales/hu-HU/index.ts +0 -49
  330. package/src/infrastructure/locales/hu-HU/navigation.json +0 -58
  331. package/src/infrastructure/locales/hu-HU/onboarding.json +0 -76
  332. package/src/infrastructure/locales/hu-HU/settings.json +0 -53
  333. package/src/infrastructure/locales/id-ID/auth.json +0 -32
  334. package/src/infrastructure/locales/id-ID/branding.json +0 -9
  335. package/src/infrastructure/locales/id-ID/datetime.json +0 -140
  336. package/src/infrastructure/locales/id-ID/errors.json +0 -43
  337. package/src/infrastructure/locales/id-ID/flashcards.json +0 -287
  338. package/src/infrastructure/locales/id-ID/general.json +0 -61
  339. package/src/infrastructure/locales/id-ID/index.ts +0 -49
  340. package/src/infrastructure/locales/id-ID/navigation.json +0 -58
  341. package/src/infrastructure/locales/id-ID/onboarding.json +0 -76
  342. package/src/infrastructure/locales/id-ID/settings.json +0 -53
  343. package/src/infrastructure/locales/it-IT/auth.json +0 -32
  344. package/src/infrastructure/locales/it-IT/branding.json +0 -9
  345. package/src/infrastructure/locales/it-IT/datetime.json +0 -140
  346. package/src/infrastructure/locales/it-IT/errors.json +0 -43
  347. package/src/infrastructure/locales/it-IT/flashcards.json +0 -287
  348. package/src/infrastructure/locales/it-IT/general.json +0 -61
  349. package/src/infrastructure/locales/it-IT/index.ts +0 -49
  350. package/src/infrastructure/locales/it-IT/navigation.json +0 -58
  351. package/src/infrastructure/locales/it-IT/onboarding.json +0 -76
  352. package/src/infrastructure/locales/it-IT/settings.json +0 -53
  353. package/src/infrastructure/locales/ja-JP/auth.json +0 -32
  354. package/src/infrastructure/locales/ja-JP/branding.json +0 -9
  355. package/src/infrastructure/locales/ja-JP/datetime.json +0 -140
  356. package/src/infrastructure/locales/ja-JP/errors.json +0 -43
  357. package/src/infrastructure/locales/ja-JP/flashcards.json +0 -287
  358. package/src/infrastructure/locales/ja-JP/general.json +0 -61
  359. package/src/infrastructure/locales/ja-JP/index.ts +0 -49
  360. package/src/infrastructure/locales/ja-JP/navigation.json +0 -58
  361. package/src/infrastructure/locales/ja-JP/onboarding.json +0 -76
  362. package/src/infrastructure/locales/ja-JP/settings.json +0 -53
  363. package/src/infrastructure/locales/ko-KR/auth.json +0 -32
  364. package/src/infrastructure/locales/ko-KR/branding.json +0 -9
  365. package/src/infrastructure/locales/ko-KR/datetime.json +0 -140
  366. package/src/infrastructure/locales/ko-KR/errors.json +0 -43
  367. package/src/infrastructure/locales/ko-KR/flashcards.json +0 -287
  368. package/src/infrastructure/locales/ko-KR/general.json +0 -61
  369. package/src/infrastructure/locales/ko-KR/index.ts +0 -49
  370. package/src/infrastructure/locales/ko-KR/navigation.json +0 -58
  371. package/src/infrastructure/locales/ko-KR/onboarding.json +0 -76
  372. package/src/infrastructure/locales/ko-KR/settings.json +0 -53
  373. package/src/infrastructure/locales/ms-MY/auth.json +0 -32
  374. package/src/infrastructure/locales/ms-MY/branding.json +0 -9
  375. package/src/infrastructure/locales/ms-MY/datetime.json +0 -140
  376. package/src/infrastructure/locales/ms-MY/errors.json +0 -43
  377. package/src/infrastructure/locales/ms-MY/flashcards.json +0 -287
  378. package/src/infrastructure/locales/ms-MY/general.json +0 -61
  379. package/src/infrastructure/locales/ms-MY/index.ts +0 -49
  380. package/src/infrastructure/locales/ms-MY/navigation.json +0 -58
  381. package/src/infrastructure/locales/ms-MY/onboarding.json +0 -76
  382. package/src/infrastructure/locales/ms-MY/settings.json +0 -53
  383. package/src/infrastructure/locales/nl-NL/auth.json +0 -32
  384. package/src/infrastructure/locales/nl-NL/branding.json +0 -9
  385. package/src/infrastructure/locales/nl-NL/datetime.json +0 -140
  386. package/src/infrastructure/locales/nl-NL/errors.json +0 -43
  387. package/src/infrastructure/locales/nl-NL/flashcards.json +0 -287
  388. package/src/infrastructure/locales/nl-NL/general.json +0 -61
  389. package/src/infrastructure/locales/nl-NL/index.ts +0 -49
  390. package/src/infrastructure/locales/nl-NL/navigation.json +0 -58
  391. package/src/infrastructure/locales/nl-NL/onboarding.json +0 -76
  392. package/src/infrastructure/locales/nl-NL/settings.json +0 -53
  393. package/src/infrastructure/locales/no-NO/auth.json +0 -32
  394. package/src/infrastructure/locales/no-NO/branding.json +0 -9
  395. package/src/infrastructure/locales/no-NO/datetime.json +0 -140
  396. package/src/infrastructure/locales/no-NO/errors.json +0 -43
  397. package/src/infrastructure/locales/no-NO/flashcards.json +0 -287
  398. package/src/infrastructure/locales/no-NO/general.json +0 -61
  399. package/src/infrastructure/locales/no-NO/index.ts +0 -49
  400. package/src/infrastructure/locales/no-NO/navigation.json +0 -58
  401. package/src/infrastructure/locales/no-NO/onboarding.json +0 -76
  402. package/src/infrastructure/locales/no-NO/settings.json +0 -53
  403. package/src/infrastructure/locales/pl-PL/auth.json +0 -32
  404. package/src/infrastructure/locales/pl-PL/branding.json +0 -9
  405. package/src/infrastructure/locales/pl-PL/datetime.json +0 -140
  406. package/src/infrastructure/locales/pl-PL/errors.json +0 -43
  407. package/src/infrastructure/locales/pl-PL/flashcards.json +0 -287
  408. package/src/infrastructure/locales/pl-PL/general.json +0 -61
  409. package/src/infrastructure/locales/pl-PL/index.ts +0 -49
  410. package/src/infrastructure/locales/pl-PL/navigation.json +0 -58
  411. package/src/infrastructure/locales/pl-PL/onboarding.json +0 -76
  412. package/src/infrastructure/locales/pl-PL/settings.json +0 -53
  413. package/src/infrastructure/locales/pt-BR/auth.json +0 -32
  414. package/src/infrastructure/locales/pt-BR/branding.json +0 -9
  415. package/src/infrastructure/locales/pt-BR/datetime.json +0 -140
  416. package/src/infrastructure/locales/pt-BR/errors.json +0 -43
  417. package/src/infrastructure/locales/pt-BR/flashcards.json +0 -287
  418. package/src/infrastructure/locales/pt-BR/general.json +0 -61
  419. package/src/infrastructure/locales/pt-BR/index.ts +0 -49
  420. package/src/infrastructure/locales/pt-BR/navigation.json +0 -58
  421. package/src/infrastructure/locales/pt-BR/onboarding.json +0 -76
  422. package/src/infrastructure/locales/pt-BR/settings.json +0 -53
  423. package/src/infrastructure/locales/pt-PT/auth.json +0 -32
  424. package/src/infrastructure/locales/pt-PT/branding.json +0 -9
  425. package/src/infrastructure/locales/pt-PT/datetime.json +0 -140
  426. package/src/infrastructure/locales/pt-PT/errors.json +0 -43
  427. package/src/infrastructure/locales/pt-PT/flashcards.json +0 -287
  428. package/src/infrastructure/locales/pt-PT/general.json +0 -61
  429. package/src/infrastructure/locales/pt-PT/index.ts +0 -49
  430. package/src/infrastructure/locales/pt-PT/navigation.json +0 -58
  431. package/src/infrastructure/locales/pt-PT/onboarding.json +0 -76
  432. package/src/infrastructure/locales/pt-PT/settings.json +0 -53
  433. package/src/infrastructure/locales/ro-RO/auth.json +0 -32
  434. package/src/infrastructure/locales/ro-RO/branding.json +0 -9
  435. package/src/infrastructure/locales/ro-RO/datetime.json +0 -140
  436. package/src/infrastructure/locales/ro-RO/errors.json +0 -43
  437. package/src/infrastructure/locales/ro-RO/flashcards.json +0 -287
  438. package/src/infrastructure/locales/ro-RO/general.json +0 -61
  439. package/src/infrastructure/locales/ro-RO/index.ts +0 -49
  440. package/src/infrastructure/locales/ro-RO/navigation.json +0 -58
  441. package/src/infrastructure/locales/ro-RO/onboarding.json +0 -76
  442. package/src/infrastructure/locales/ro-RO/settings.json +0 -53
  443. package/src/infrastructure/locales/ru-RU/auth.json +0 -32
  444. package/src/infrastructure/locales/ru-RU/branding.json +0 -9
  445. package/src/infrastructure/locales/ru-RU/datetime.json +0 -140
  446. package/src/infrastructure/locales/ru-RU/errors.json +0 -43
  447. package/src/infrastructure/locales/ru-RU/flashcards.json +0 -276
  448. package/src/infrastructure/locales/ru-RU/general.json +0 -61
  449. package/src/infrastructure/locales/ru-RU/index.ts +0 -49
  450. package/src/infrastructure/locales/ru-RU/navigation.json +0 -58
  451. package/src/infrastructure/locales/ru-RU/onboarding.json +0 -76
  452. package/src/infrastructure/locales/ru-RU/settings.json +0 -53
  453. package/src/infrastructure/locales/sk-SK/auth.json +0 -32
  454. package/src/infrastructure/locales/sk-SK/branding.json +0 -9
  455. package/src/infrastructure/locales/sk-SK/datetime.json +0 -140
  456. package/src/infrastructure/locales/sk-SK/errors.json +0 -43
  457. package/src/infrastructure/locales/sk-SK/flashcards.json +0 -287
  458. package/src/infrastructure/locales/sk-SK/general.json +0 -61
  459. package/src/infrastructure/locales/sk-SK/index.ts +0 -49
  460. package/src/infrastructure/locales/sk-SK/navigation.json +0 -58
  461. package/src/infrastructure/locales/sk-SK/onboarding.json +0 -76
  462. package/src/infrastructure/locales/sk-SK/settings.json +0 -53
  463. package/src/infrastructure/locales/sv-SE/auth.json +0 -32
  464. package/src/infrastructure/locales/sv-SE/branding.json +0 -9
  465. package/src/infrastructure/locales/sv-SE/datetime.json +0 -140
  466. package/src/infrastructure/locales/sv-SE/errors.json +0 -43
  467. package/src/infrastructure/locales/sv-SE/flashcards.json +0 -287
  468. package/src/infrastructure/locales/sv-SE/general.json +0 -61
  469. package/src/infrastructure/locales/sv-SE/index.ts +0 -49
  470. package/src/infrastructure/locales/sv-SE/navigation.json +0 -58
  471. package/src/infrastructure/locales/sv-SE/onboarding.json +0 -76
  472. package/src/infrastructure/locales/sv-SE/settings.json +0 -53
  473. package/src/infrastructure/locales/th-TH/auth.json +0 -32
  474. package/src/infrastructure/locales/th-TH/branding.json +0 -9
  475. package/src/infrastructure/locales/th-TH/datetime.json +0 -140
  476. package/src/infrastructure/locales/th-TH/errors.json +0 -43
  477. package/src/infrastructure/locales/th-TH/flashcards.json +0 -287
  478. package/src/infrastructure/locales/th-TH/general.json +0 -61
  479. package/src/infrastructure/locales/th-TH/index.ts +0 -49
  480. package/src/infrastructure/locales/th-TH/navigation.json +0 -58
  481. package/src/infrastructure/locales/th-TH/onboarding.json +0 -76
  482. package/src/infrastructure/locales/th-TH/settings.json +0 -53
  483. package/src/infrastructure/locales/tl-PH/auth.json +0 -32
  484. package/src/infrastructure/locales/tl-PH/branding.json +0 -9
  485. package/src/infrastructure/locales/tl-PH/datetime.json +0 -140
  486. package/src/infrastructure/locales/tl-PH/errors.json +0 -43
  487. package/src/infrastructure/locales/tl-PH/flashcards.json +0 -287
  488. package/src/infrastructure/locales/tl-PH/general.json +0 -61
  489. package/src/infrastructure/locales/tl-PH/index.ts +0 -49
  490. package/src/infrastructure/locales/tl-PH/navigation.json +0 -58
  491. package/src/infrastructure/locales/tl-PH/onboarding.json +0 -76
  492. package/src/infrastructure/locales/tl-PH/settings.json +0 -53
  493. package/src/infrastructure/locales/tr-TR/auth.json +0 -32
  494. package/src/infrastructure/locales/tr-TR/branding.json +0 -9
  495. package/src/infrastructure/locales/tr-TR/datetime.json +0 -140
  496. package/src/infrastructure/locales/tr-TR/errors.json +0 -43
  497. package/src/infrastructure/locales/tr-TR/flashcards.json +0 -287
  498. package/src/infrastructure/locales/tr-TR/general.json +0 -61
  499. package/src/infrastructure/locales/tr-TR/index.ts +0 -49
  500. package/src/infrastructure/locales/tr-TR/navigation.json +0 -58
  501. package/src/infrastructure/locales/tr-TR/onboarding.json +0 -76
  502. package/src/infrastructure/locales/tr-TR/settings.json +0 -53
  503. package/src/infrastructure/locales/uk-UA/auth.json +0 -32
  504. package/src/infrastructure/locales/uk-UA/branding.json +0 -9
  505. package/src/infrastructure/locales/uk-UA/datetime.json +0 -140
  506. package/src/infrastructure/locales/uk-UA/errors.json +0 -43
  507. package/src/infrastructure/locales/uk-UA/flashcards.json +0 -287
  508. package/src/infrastructure/locales/uk-UA/general.json +0 -61
  509. package/src/infrastructure/locales/uk-UA/index.ts +0 -49
  510. package/src/infrastructure/locales/uk-UA/navigation.json +0 -58
  511. package/src/infrastructure/locales/uk-UA/onboarding.json +0 -76
  512. package/src/infrastructure/locales/uk-UA/settings.json +0 -53
  513. package/src/infrastructure/locales/vi-VN/auth.json +0 -32
  514. package/src/infrastructure/locales/vi-VN/branding.json +0 -9
  515. package/src/infrastructure/locales/vi-VN/datetime.json +0 -140
  516. package/src/infrastructure/locales/vi-VN/errors.json +0 -43
  517. package/src/infrastructure/locales/vi-VN/flashcards.json +0 -287
  518. package/src/infrastructure/locales/vi-VN/general.json +0 -61
  519. package/src/infrastructure/locales/vi-VN/index.ts +0 -49
  520. package/src/infrastructure/locales/vi-VN/navigation.json +0 -58
  521. package/src/infrastructure/locales/vi-VN/onboarding.json +0 -76
  522. package/src/infrastructure/locales/vi-VN/settings.json +0 -53
  523. package/src/infrastructure/locales/zh-CN/auth.json +0 -32
  524. package/src/infrastructure/locales/zh-CN/branding.json +0 -9
  525. package/src/infrastructure/locales/zh-CN/datetime.json +0 -140
  526. package/src/infrastructure/locales/zh-CN/errors.json +0 -43
  527. package/src/infrastructure/locales/zh-CN/flashcards.json +0 -287
  528. package/src/infrastructure/locales/zh-CN/general.json +0 -61
  529. package/src/infrastructure/locales/zh-CN/index.ts +0 -49
  530. package/src/infrastructure/locales/zh-CN/navigation.json +0 -58
  531. package/src/infrastructure/locales/zh-CN/onboarding.json +0 -76
  532. package/src/infrastructure/locales/zh-CN/settings.json +0 -53
  533. package/src/infrastructure/locales/zh-TW/auth.json +0 -32
  534. package/src/infrastructure/locales/zh-TW/branding.json +0 -9
  535. package/src/infrastructure/locales/zh-TW/datetime.json +0 -140
  536. package/src/infrastructure/locales/zh-TW/errors.json +0 -43
  537. package/src/infrastructure/locales/zh-TW/flashcards.json +0 -287
  538. package/src/infrastructure/locales/zh-TW/general.json +0 -61
  539. package/src/infrastructure/locales/zh-TW/index.ts +0 -49
  540. package/src/infrastructure/locales/zh-TW/navigation.json +0 -58
  541. package/src/infrastructure/locales/zh-TW/onboarding.json +0 -76
  542. package/src/infrastructure/locales/zh-TW/settings.json +0 -53
@@ -1,6 +1,11 @@
1
1
  /**
2
2
  * i18next Configuration
3
3
  * Nested translation structure - common translations spread, domain translations nested
4
+ *
5
+ * AUTOMATIC LANGUAGE LOADING:
6
+ * - Uses require.context to auto-discover all language directories
7
+ * - No manual imports needed - all languages loaded automatically
8
+ * - Project translations merged with package defaults
4
9
  */
5
10
  import i18n from 'i18next';
6
11
  export default i18n;
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/i18n.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AA+F3B,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/config/i18n.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAgR3B,eAAe,IAAI,CAAC"}
@@ -1,35 +1,210 @@
1
1
  /**
2
2
  * i18next Configuration
3
3
  * Nested translation structure - common translations spread, domain translations nested
4
+ *
5
+ * AUTOMATIC LANGUAGE LOADING:
6
+ * - Uses require.context to auto-discover all language directories
7
+ * - No manual imports needed - all languages loaded automatically
8
+ * - Project translations merged with package defaults
4
9
  */
5
10
  import i18n from 'i18next';
6
11
  import { initReactI18next } from 'react-i18next';
7
12
  import { DEFAULT_LANGUAGE } from './languages';
8
13
  /**
9
- * Import all translations from modular folder structure
10
- * Each locale has an index.ts that merges all JSON files
14
+ * AUTOMATIC LANGUAGE LOADING
11
15
  *
12
- * Structure (OFFLINE-ONLY):
13
- * locales/
14
- * en-US/ (universal translations in localization domain)
15
- * index.ts (merges common.json, navigation.json, settings.json, onboarding.json, errors.json)
16
+ * Uses Metro bundler's require.context to automatically discover and load
17
+ * all language directories. No manual imports needed!
16
18
  *
17
- * All translations are offline-compatible and work without backend.
19
+ * Structure:
20
+ * locales/
21
+ * ar-SA/index.ts
22
+ * bg-BG/index.ts
23
+ * en-US/index.ts
24
+ * ... (all languages auto-discovered)
18
25
  */
19
- // Import universal translations from localization domain
20
- import localizationEnUS from '../locales/en-US';
26
+ // Auto-load all package locale directories using require.context
27
+ // This automatically discovers all language folders (ar-SA, bg-BG, en-US, etc.)
28
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
29
+ const packageLocalesContext = require.context('../locales', true, /\/index\.ts$/);
30
+ /**
31
+ * Load all package translations automatically
32
+ * Extracts language code from path (e.g., './ar-SA/index.ts' -> 'ar-SA')
33
+ */
34
+ const loadPackageTranslations = () => {
35
+ const packageTranslations = {};
36
+ packageLocalesContext.keys().forEach((key) => {
37
+ // Extract language code from path: './ar-SA/index.ts' -> 'ar-SA'
38
+ const match = key.match(/\.\/([^/]+)\/index\.ts$/);
39
+ if (match) {
40
+ const languageCode = match[1];
41
+ try {
42
+ const translations = packageLocalesContext(key);
43
+ packageTranslations[languageCode] = translations.default || translations;
44
+ /* eslint-disable-next-line no-console */
45
+ if (__DEV__)
46
+ console.log(`[i18n] āœ… Loaded package translations: ${languageCode}`);
47
+ }
48
+ catch (error) {
49
+ /* eslint-disable-next-line no-console */
50
+ if (__DEV__)
51
+ console.warn(`[i18n] āš ļø Failed to load package translations for ${languageCode}:`, error);
52
+ }
53
+ }
54
+ });
55
+ return packageTranslations;
56
+ };
57
+ const packageTranslations = loadPackageTranslations();
58
+ /**
59
+ * Try to load project-specific translations
60
+ * Metro bundler will resolve these at build time if they exist
61
+ * If they don't exist, the require will fail gracefully
62
+ */
63
+ let projectTranslations = {};
64
+ // Try to load project translations from common paths
65
+ // Metro bundler will include these if they exist at build time
66
+ try {
67
+ // Try DDD structure path with require.context for automatic discovery
68
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
69
+ const projectLocalesContext = require.context('../../../../../../src/domains/localization/infrastructure/locales', true, /\/index\.ts$/);
70
+ projectLocalesContext.keys().forEach((key) => {
71
+ const match = key.match(/\.\/([^/]+)\/index\.ts$/);
72
+ if (match) {
73
+ const languageCode = match[1];
74
+ try {
75
+ const translations = projectLocalesContext(key);
76
+ if (!projectTranslations[languageCode]) {
77
+ projectTranslations[languageCode] = {};
78
+ }
79
+ projectTranslations[languageCode] = translations.default || translations;
80
+ /* eslint-disable-next-line no-console */
81
+ if (__DEV__)
82
+ console.log(`[i18n] āœ… Loaded project translations: ${languageCode}`);
83
+ }
84
+ catch (error) {
85
+ /* eslint-disable-next-line no-console */
86
+ if (__DEV__)
87
+ console.warn(`[i18n] āš ļø Failed to load project translations for ${languageCode}:`, error);
88
+ }
89
+ }
90
+ });
91
+ /* eslint-disable-next-line no-console */
92
+ if (__DEV__)
93
+ console.log('[i18n] āœ… Loaded project translations from DDD structure');
94
+ }
95
+ catch (e1) {
96
+ try {
97
+ // Try alternative DDD structure path
98
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
99
+ const projectLocalesContext = require.context('../../../../../../domains/localization/infrastructure/locales', true, /\/index\.ts$/);
100
+ projectLocalesContext.keys().forEach((key) => {
101
+ const match = key.match(/\.\/([^/]+)\/index\.ts$/);
102
+ if (match) {
103
+ const languageCode = match[1];
104
+ try {
105
+ const translations = projectLocalesContext(key);
106
+ if (!projectTranslations[languageCode]) {
107
+ projectTranslations[languageCode] = {};
108
+ }
109
+ projectTranslations[languageCode] = translations.default || translations;
110
+ }
111
+ catch (error) {
112
+ // Ignore individual language errors
113
+ }
114
+ }
115
+ });
116
+ /* eslint-disable-next-line no-console */
117
+ if (__DEV__)
118
+ console.log('[i18n] āœ… Loaded project translations from alternative DDD structure');
119
+ }
120
+ catch (e2) {
121
+ try {
122
+ // Try simple structure path
123
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
124
+ const projectLocalesContext = require.context('../../../../../../src/locales', true, /\/index\.ts$/);
125
+ projectLocalesContext.keys().forEach((key) => {
126
+ const match = key.match(/\.\/([^/]+)\/index\.ts$/);
127
+ if (match) {
128
+ const languageCode = match[1];
129
+ try {
130
+ const translations = projectLocalesContext(key);
131
+ if (!projectTranslations[languageCode]) {
132
+ projectTranslations[languageCode] = {};
133
+ }
134
+ projectTranslations[languageCode] = translations.default || translations;
135
+ }
136
+ catch (error) {
137
+ // Ignore individual language errors
138
+ }
139
+ }
140
+ });
141
+ /* eslint-disable-next-line no-console */
142
+ if (__DEV__)
143
+ console.log('[i18n] āœ… Loaded project translations from simple structure');
144
+ }
145
+ catch (e3) {
146
+ // No project translations found - this is OK, use package defaults only
147
+ /* eslint-disable-next-line no-console */
148
+ if (__DEV__)
149
+ console.log('[i18n] ā„¹ļø No project-specific translations found, using package defaults only');
150
+ }
151
+ }
152
+ }
21
153
  /**
22
154
  * Translation Resources
23
- * Nested structure - domain-based organization with direct key access
24
- * Example: settings.theme.title, onboarding.welcome.title
155
+ * Merge package defaults with project-specific translations
156
+ * Project translations override package defaults (deep merge)
157
+ */
158
+ const mergeTranslations = (packageTranslations, projectTranslations) => {
159
+ if (!projectTranslations || Object.keys(projectTranslations).length === 0) {
160
+ return packageTranslations;
161
+ }
162
+ // Deep merge: project translations override package defaults
163
+ const merged = { ...packageTranslations };
164
+ for (const key in projectTranslations) {
165
+ if (projectTranslations.hasOwnProperty(key)) {
166
+ if (typeof projectTranslations[key] === 'object' &&
167
+ projectTranslations[key] !== null &&
168
+ !Array.isArray(projectTranslations[key]) &&
169
+ typeof packageTranslations[key] === 'object' &&
170
+ packageTranslations[key] !== null &&
171
+ !Array.isArray(packageTranslations[key])) {
172
+ // Deep merge nested objects
173
+ merged[key] = mergeTranslations(packageTranslations[key], projectTranslations[key]);
174
+ }
175
+ else {
176
+ // Override with project translation
177
+ merged[key] = projectTranslations[key];
178
+ }
179
+ }
180
+ }
181
+ return merged;
182
+ };
183
+ /**
184
+ * Build resources object for all languages
185
+ * Automatically includes all package languages + project languages
25
186
  */
26
- const resources = {
27
- 'en-US': {
28
- translation: {
29
- ...localizationEnUS,
30
- },
31
- },
187
+ const buildResources = () => {
188
+ const resources = {};
189
+ // Get all unique language codes from both package and project translations
190
+ const allLanguageCodes = new Set([
191
+ ...Object.keys(packageTranslations),
192
+ ...Object.keys(projectTranslations),
193
+ ]);
194
+ // Build resources for each language
195
+ allLanguageCodes.forEach((languageCode) => {
196
+ const packageTranslation = packageTranslations[languageCode] || {};
197
+ const projectTranslation = projectTranslations[languageCode] || {};
198
+ resources[languageCode] = {
199
+ translation: mergeTranslations(packageTranslation, projectTranslation),
200
+ };
201
+ });
202
+ /* eslint-disable-next-line no-console */
203
+ if (__DEV__)
204
+ console.log(`[i18n] šŸ“¦ Loaded ${Object.keys(resources).length} languages:`, Object.keys(resources).join(', '));
205
+ return resources;
32
206
  };
207
+ const resources = buildResources();
33
208
  /**
34
209
  * Initialize i18next
35
210
  * Deferred initialization to avoid React Native renderer conflicts
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/infrastructure/config/i18n.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAuB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpE;;;;;;;;;;GAUG;AAEH,yDAAyD;AACzD,OAAO,gBAAgB,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,+DAA+D;YACxF,eAAe,EAAE,GAAG,EAAE,2CAA2C;YACjE,YAAY,EAAE,GAAG,EAAE,oCAAoC;SACxD,CAAC,CAAC;QAEH,aAAa,GAAG,IAAI,CAAC;QACrB,yCAAyC;QACzC,IAAI,OAAO;YAAE,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,yCAAyC;QACzC,IAAI,OAAO;YAAE,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QAClE,mDAAmD;QACnD,yCAAyC;QACzC,IAAI,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC,CAAC;AAEF,4CAA4C;AAC5C,2DAA2D;AAC3D,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;IAClC,yCAAyC;IACzC,UAAU,CAAC,GAAG,EAAE;QACd,cAAc,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC;KAAM,CAAC;IACN,mCAAmC;IACnC,cAAc,EAAE,CAAC;AACnB,CAAC;AAED,eAAe,IAAI,CAAC"}
@@ -1,34 +1,29 @@
1
1
  /**
2
- * Auto-generated translation loader for en-US
2
+ * Auto-loader for en-US translation modules
3
3
  *
4
- * This file is automatically generated by:
5
- * npm run localization:create-loaders
4
+ * AUTOMATIC TRANSLATION FILE DETECTION:
5
+ * - Uses Metro bundler's require.context to auto-discover .json files
6
+ * - Adding new translation file = just create .json file (zero manual updates)
7
+ * - Build-time resolution (fast, no runtime overhead)
8
+ * - Works for all languages automatically
6
9
  *
7
- * DO NOT EDIT THIS FILE MANUALLY!
10
+ * OFFLINE-ONLY TRANSLATIONS (All domains work without backend):
11
+ * - Automatically imports ALL .json files in this directory
12
+ * - Alphabetically sorted for consistency
13
+ * - Type-safe with TypeScript
8
14
  *
9
- * Translation Modules:
10
- * - auth: auth.json
11
- * - branding: branding.json
12
- * - datetime: datetime.json
13
- * - errors: errors.json
14
- * - flashcards: flashcards.json
15
- * - general: general.json
16
- * - navigation: navigation.json
17
- * - onboarding: onboarding.json
18
- * - settings: settings.json
15
+ * USAGE:
16
+ * 1. Create new translation file: my_domain.json
17
+ * 2. File is auto-discovered and loaded
18
+ * 3. Access via t('my_domain.key')
19
19
  *
20
- * Generated: 2025-11-06T20:57:31.290Z
20
+ * This file is automatically generated by setup-languages.js script
21
+ * but can be manually edited if needed.
21
22
  */
22
- declare const translations: {
23
- auth: any;
24
- branding: any;
25
- datetime: any;
26
- errors: any;
27
- flashcards: any;
28
- general: any;
29
- navigation: any;
30
- onboarding: any;
31
- settings: any;
32
- };
23
+ /**
24
+ * Load all JSON modules automatically
25
+ * Extracts module name from path (e.g., './auth.json' -> 'auth')
26
+ */
27
+ declare const translations: Record<string, any>;
33
28
  export default translations;
34
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/locales/en-US/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAgBH,QAAA,MAAM,YAAY;;;;;;;;;;CAUjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/locales/en-US/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;;GAGG;AACH,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,CAAC;AAW7C,eAAe,YAAY,CAAC"}
@@ -1,47 +1,40 @@
1
1
  /**
2
- * Auto-generated translation loader for en-US
2
+ * Auto-loader for en-US translation modules
3
3
  *
4
- * This file is automatically generated by:
5
- * npm run localization:create-loaders
4
+ * AUTOMATIC TRANSLATION FILE DETECTION:
5
+ * - Uses Metro bundler's require.context to auto-discover .json files
6
+ * - Adding new translation file = just create .json file (zero manual updates)
7
+ * - Build-time resolution (fast, no runtime overhead)
8
+ * - Works for all languages automatically
6
9
  *
7
- * DO NOT EDIT THIS FILE MANUALLY!
10
+ * OFFLINE-ONLY TRANSLATIONS (All domains work without backend):
11
+ * - Automatically imports ALL .json files in this directory
12
+ * - Alphabetically sorted for consistency
13
+ * - Type-safe with TypeScript
8
14
  *
9
- * Translation Modules:
10
- * - auth: auth.json
11
- * - branding: branding.json
12
- * - datetime: datetime.json
13
- * - errors: errors.json
14
- * - flashcards: flashcards.json
15
- * - general: general.json
16
- * - navigation: navigation.json
17
- * - onboarding: onboarding.json
18
- * - settings: settings.json
15
+ * USAGE:
16
+ * 1. Create new translation file: my_domain.json
17
+ * 2. File is auto-discovered and loaded
18
+ * 3. Access via t('my_domain.key')
19
19
  *
20
- * Generated: 2025-11-06T20:57:31.290Z
20
+ * This file is automatically generated by setup-languages.js script
21
+ * but can be manually edited if needed.
21
22
  */
22
- // Import all translation modules
23
- // Use require for JSON files to ensure proper Metro bundler handling
24
- const auth = require('./auth.json');
25
- const branding = require('./branding.json');
26
- const datetime = require('./datetime.json');
27
- const errors = require('./errors.json');
28
- const flashcards = require('./flashcards.json');
29
- const general = require('./general.json');
30
- const navigation = require('./navigation.json');
31
- const onboarding = require('./onboarding.json');
32
- const settings = require('./settings.json');
33
- // Merge all modules into a single translation object
34
- // Using nested structure for better namespace organization
35
- const translations = {
36
- auth,
37
- branding,
38
- datetime,
39
- errors,
40
- flashcards,
41
- general,
42
- navigation,
43
- onboarding,
44
- settings,
45
- };
23
+ // Metro bundler require.context - auto-discover all .json files
24
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
25
+ const translationContext = require.context('./', false, /\.json$/);
26
+ /**
27
+ * Load all JSON modules automatically
28
+ * Extracts module name from path (e.g., './auth.json' -> 'auth')
29
+ */
30
+ const translations = {};
31
+ translationContext.keys().forEach((key) => {
32
+ // Extract module name from path: './auth.json' -> 'auth'
33
+ const match = key.match(/\.\/([^/]+)\.json$/);
34
+ if (match) {
35
+ const moduleName = match[1];
36
+ translations[moduleName] = translationContext(key);
37
+ }
38
+ });
46
39
  export default translations;
47
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/infrastructure/locales/en-US/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,iCAAiC;AACjC,qEAAqE;AACrE,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AACxC,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAChD,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAChD,MAAM,UAAU,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE5C,qDAAqD;AACrD,2DAA2D;AAC3D,MAAM,YAAY,GAAG;IACnB,IAAI;IACJ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/infrastructure/locales/en-US/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,gEAAgE;AAChE,iEAAiE;AACjE,MAAM,kBAAkB,GAAI,OAAe,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,YAAY,GAAwB,EAAE,CAAC;AAE7C,kBAAkB,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;IAChD,yDAAyD;IACzD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC9C,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC5B,YAAY,CAAC,UAAU,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,eAAe,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-localization",
3
- "version": "1.3.10",
3
+ "version": "1.5.0",
4
4
  "description": "Universal localization system for React Native apps with i18n support",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -81,43 +81,50 @@ function createAutoLoader(languageCode) {
81
81
  return false;
82
82
  }
83
83
 
84
- // Create require statements and namespace mapping
85
- // Use require instead of import for JSON files to ensure proper Metro bundler handling
86
- const requires = [];
87
- const namespaces = [];
88
- const descriptions = [];
89
-
90
- files.forEach(file => {
91
- const moduleName = file.replace('.json', '');
92
- requires.push(`const ${moduleName} = require('./${file}');`);
93
- namespaces.push(moduleName);
94
- descriptions.push(` * - ${moduleName}: ${file}`);
95
- });
96
-
97
- // Create the auto-loader content with nested structure
84
+ // Create the auto-loader content with require.context for automatic discovery
98
85
  const content = `/**
99
- * Auto-generated translation loader for ${languageCode}
86
+ * Auto-loader for ${languageCode} translation modules
100
87
  *
101
- * This file is automatically generated by:
102
- * npm run localization:create-loaders
88
+ * AUTOMATIC TRANSLATION FILE DETECTION:
89
+ * - Uses Metro bundler's require.context to auto-discover .json files
90
+ * - Adding new translation file = just create .json file (zero manual updates)
91
+ * - Build-time resolution (fast, no runtime overhead)
92
+ * - Works for all languages automatically
103
93
  *
104
- * DO NOT EDIT THIS FILE MANUALLY!
94
+ * OFFLINE-ONLY TRANSLATIONS (All domains work without backend):
95
+ * - Automatically imports ALL .json files in this directory
96
+ * - Alphabetically sorted for consistency
97
+ * - Type-safe with TypeScript
105
98
  *
106
- * Translation Modules:
107
- ${descriptions.join('\n')}
99
+ * USAGE:
100
+ * 1. Create new translation file: my_domain.json
101
+ * 2. File is auto-discovered and loaded
102
+ * 3. Access via t('my_domain.key')
103
+ *
104
+ * This file is automatically generated by setup-languages.js or createLocaleLoaders.js
105
+ * but can be manually edited if needed.
108
106
  *
109
107
  * Generated: ${new Date().toISOString()}
110
108
  */
111
109
 
112
- // Import all translation modules
113
- // Use require for JSON files to ensure proper Metro bundler handling
114
- ${requires.join('\n')}
110
+ // Metro bundler require.context - auto-discover all .json files
111
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
112
+ const translationContext = (require as any).context('./', false, /\\.json$/);
115
113
 
116
- // Merge all modules into a single translation object
117
- // Using nested structure for better namespace organization
118
- const translations = {
119
- ${namespaces.join(',\n ')},
120
- };
114
+ /**
115
+ * Load all JSON modules automatically
116
+ * Extracts module name from path (e.g., './auth.json' -> 'auth')
117
+ */
118
+ const translations: Record<string, any> = {};
119
+
120
+ translationContext.keys().forEach((key: string) => {
121
+ // Extract module name from path: './auth.json' -> 'auth'
122
+ const match = key.match(/\\.\\/([^/]+)\\.json$/);
123
+ if (match) {
124
+ const moduleName = match[1];
125
+ translations[moduleName] = translationContext(key);
126
+ }
127
+ });
121
128
 
122
129
  export default translations;
123
130
  `;
@@ -159,9 +159,122 @@ async function setupLanguages() {
159
159
  }
160
160
  }
161
161
 
162
+ // Create index.ts files for all languages (including en-US)
163
+ console.log(`\nšŸ“ Creating index.ts loaders for all languages...`);
164
+ let createdIndexFiles = 0;
165
+
166
+ // Create index.ts for en-US
167
+ const enUSIndexPath = path.join(enUSDir, 'index.ts');
168
+ if (!fs.existsSync(enUSIndexPath)) {
169
+ const enUSIndexContent = `/**
170
+ * Auto-loader for en-US translation modules
171
+ *
172
+ * AUTOMATIC TRANSLATION FILE DETECTION:
173
+ * - Uses Metro bundler's require.context to auto-discover .json files
174
+ * - Adding new translation file = just create .json file (zero manual updates)
175
+ * - Build-time resolution (fast, no runtime overhead)
176
+ * - Works for all languages automatically
177
+ *
178
+ * OFFLINE-ONLY TRANSLATIONS (All domains work without backend):
179
+ * - Automatically imports ALL .json files in this directory
180
+ * - Alphabetically sorted for consistency
181
+ * - Type-safe with TypeScript
182
+ *
183
+ * USAGE:
184
+ * 1. Create new translation file: my_domain.json
185
+ * 2. File is auto-discovered and loaded
186
+ * 3. Access via t('my_domain.key')
187
+ *
188
+ * This file is automatically generated by setup-languages.js
189
+ * but can be manually edited if needed.
190
+ */
191
+
192
+ // Metro bundler require.context - auto-discover all .json files
193
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
194
+ const translationContext = (require as any).context('./', false, /\\.json$/);
195
+
196
+ /**
197
+ * Load all JSON modules automatically
198
+ * Extracts module name from path (e.g., './auth.json' -> 'auth')
199
+ */
200
+ const translations: Record<string, any> = {};
201
+
202
+ translationContext.keys().forEach((key: string) => {
203
+ // Extract module name from path: './auth.json' -> 'auth'
204
+ const match = key.match(/\\.\\/([^/]+)\\.json$/);
205
+ if (match) {
206
+ const moduleName = match[1];
207
+ translations[moduleName] = translationContext(key);
208
+ }
209
+ });
210
+
211
+ export default translations;
212
+ `;
213
+ fs.writeFileSync(enUSIndexPath, enUSIndexContent, 'utf8');
214
+ console.log(` šŸ“„ Created: en-US/index.ts`);
215
+ createdIndexFiles++;
216
+ }
217
+
218
+ // Create index.ts for all other languages
219
+ for (const langCode of LANGUAGES) {
220
+ const langDir = path.join(localesDir, langCode);
221
+ const indexPath = path.join(langDir, 'index.ts');
222
+
223
+ if (fs.existsSync(langDir) && !fs.existsSync(indexPath)) {
224
+ const indexContent = `/**
225
+ * Auto-loader for ${langCode} translation modules
226
+ *
227
+ * AUTOMATIC TRANSLATION FILE DETECTION:
228
+ * - Uses Metro bundler's require.context to auto-discover .json files
229
+ * - Adding new translation file = just create .json file (zero manual updates)
230
+ * - Build-time resolution (fast, no runtime overhead)
231
+ * - Works for all languages automatically
232
+ *
233
+ * OFFLINE-ONLY TRANSLATIONS (All domains work without backend):
234
+ * - Automatically imports ALL .json files in this directory
235
+ * - Alphabetically sorted for consistency
236
+ * - Type-safe with TypeScript
237
+ *
238
+ * USAGE:
239
+ * 1. Create new translation file: my_domain.json
240
+ * 2. File is auto-discovered and loaded
241
+ * 3. Access via t('my_domain.key')
242
+ *
243
+ * This file is automatically generated by setup-languages.js
244
+ * but can be manually edited if needed.
245
+ */
246
+
247
+ // Metro bundler require.context - auto-discover all .json files
248
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
249
+ const translationContext = (require as any).context('./', false, /\\.json$/);
250
+
251
+ /**
252
+ * Load all JSON modules automatically
253
+ * Extracts module name from path (e.g., './auth.json' -> 'auth')
254
+ */
255
+ const translations: Record<string, any> = {};
256
+
257
+ translationContext.keys().forEach((key: string) => {
258
+ // Extract module name from path: './auth.json' -> 'auth'
259
+ const match = key.match(/\\.\\/([^/]+)\\.json$/);
260
+ if (match) {
261
+ const moduleName = match[1];
262
+ translations[moduleName] = translationContext(key);
263
+ }
264
+ });
265
+
266
+ export default translations;
267
+ `;
268
+ fs.writeFileSync(indexPath, indexContent, 'utf8');
269
+ console.log(` šŸ“„ Created: ${langCode}/index.ts`);
270
+ createdIndexFiles++;
271
+ }
272
+ }
273
+
162
274
  console.log(`\nāœ… Setup completed!`);
163
275
  console.log(` Directories created: ${createdDirs}`);
164
276
  console.log(` Files created: ${createdFiles}`);
277
+ console.log(` Index files created: ${createdIndexFiles}`);
165
278
  console.log(` Total languages: ${LANGUAGES.length + 1} (including en-US)`);
166
279
  console.log(
167
280
  `\nšŸ“ Next steps:`,