gt-react 3.1.37 → 3.1.39

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 (344) hide show
  1. package/dist/mjs/client/client-only/GTClientProvider.d.ts.map +1 -1
  2. package/dist/mjs/client/client-only/GTClientProvider.js +4 -3
  3. package/dist/mjs/client/client-only/GTClientProvider.js.map +1 -1
  4. package/dist/mjs/client/client-only/helpers/renderDictionary.d.ts.map +1 -1
  5. package/dist/mjs/client/client-only/helpers/renderDictionary.js +84 -3
  6. package/dist/mjs/client/client-only/helpers/renderDictionary.js.map +1 -1
  7. package/dist/mjs/client/plural/ClientPlural.d.ts +2 -1
  8. package/dist/mjs/client/plural/ClientPlural.d.ts.map +1 -1
  9. package/dist/mjs/client/plural/ClientPlural.js +3 -2
  10. package/dist/mjs/client/plural/ClientPlural.js.map +1 -1
  11. package/dist/mjs/client/value/ClientValue.d.ts.map +1 -1
  12. package/dist/mjs/client/value/ClientValue.js +2 -1
  13. package/dist/mjs/client/value/ClientValue.js.map +1 -1
  14. package/dist/mjs/dictionary/createDictFunction.d.ts.map +1 -1
  15. package/dist/mjs/dictionary/createDictFunction.js +2 -4
  16. package/dist/mjs/dictionary/createDictFunction.js.map +1 -1
  17. package/dist/mjs/dictionary/createExecuteTFunction.d.ts +12 -0
  18. package/dist/mjs/dictionary/createExecuteTFunction.d.ts.map +1 -0
  19. package/dist/mjs/dictionary/createExecuteTFunction.js +88 -0
  20. package/dist/mjs/dictionary/createExecuteTFunction.js.map +1 -0
  21. package/dist/mjs/dictionary/createGetGTFunction.d.ts +1 -1
  22. package/dist/mjs/dictionary/createGetGTFunction.d.ts.map +1 -1
  23. package/dist/mjs/dictionary/createTFunction.d.ts.map +1 -1
  24. package/dist/mjs/dictionary/createTFunction.js +20 -10
  25. package/dist/mjs/dictionary/createTFunction.js.map +1 -1
  26. package/dist/mjs/primitives/createValues.d.ts +6 -0
  27. package/dist/mjs/primitives/createValues.d.ts.map +1 -0
  28. package/dist/mjs/primitives/createValues.js +13 -0
  29. package/dist/mjs/primitives/createValues.js.map +1 -0
  30. package/dist/mjs/primitives/flattenDictionary.d.ts +3 -3
  31. package/dist/mjs/primitives/flattenDictionary.js +3 -3
  32. package/dist/mjs/primitives/getEntryMetadata.d.ts +5 -0
  33. package/dist/mjs/primitives/getEntryMetadata.d.ts.map +1 -0
  34. package/dist/mjs/primitives/getEntryMetadata.js +14 -0
  35. package/dist/mjs/primitives/getEntryMetadata.js.map +1 -0
  36. package/dist/mjs/primitives/getEntryTranslationType.d.ts +2 -0
  37. package/dist/mjs/primitives/getEntryTranslationType.d.ts.map +1 -0
  38. package/dist/mjs/primitives/getEntryTranslationType.js +25 -0
  39. package/dist/mjs/primitives/getEntryTranslationType.js.map +1 -0
  40. package/dist/mjs/primitives/getRenderAttributes.d.ts +5 -0
  41. package/dist/mjs/primitives/getRenderAttributes.d.ts.map +1 -0
  42. package/dist/mjs/primitives/getRenderAttributes.js +21 -0
  43. package/dist/mjs/primitives/getRenderAttributes.js.map +1 -0
  44. package/dist/mjs/server/T.d.ts.map +1 -1
  45. package/dist/mjs/server/T.js +2 -5
  46. package/dist/mjs/server/T.js.map +1 -1
  47. package/dist/mjs/server/plural/InnerPlural.d.ts +2 -1
  48. package/dist/mjs/server/plural/InnerPlural.d.ts.map +1 -1
  49. package/dist/mjs/server/plural/InnerPlural.js +3 -2
  50. package/dist/mjs/server/plural/InnerPlural.js.map +1 -1
  51. package/dist/mjs/server/plural/createPluralComponent.d.ts +1 -1
  52. package/dist/mjs/server/plural/createPluralComponent.d.ts.map +1 -1
  53. package/dist/mjs/server/plural/createPluralComponent.js +2 -2
  54. package/dist/mjs/server/plural/createPluralComponent.js.map +1 -1
  55. package/dist/mjs/server/provider/GTProvider.d.ts +2 -3
  56. package/dist/mjs/server/provider/GTProvider.d.ts.map +1 -1
  57. package/dist/mjs/server/provider/GTProvider.js +8 -26
  58. package/dist/mjs/server/provider/GTProvider.js.map +1 -1
  59. package/dist/mjs/server/provider/createGTProviderComponent.d.ts +2 -3
  60. package/dist/mjs/server/provider/createGTProviderComponent.d.ts.map +1 -1
  61. package/dist/mjs/server/provider/createGTProviderComponent.js +2 -2
  62. package/dist/mjs/server/provider/createGTProviderComponent.js.map +1 -1
  63. package/dist/mjs/server/renderChildren.d.ts +1 -1
  64. package/dist/mjs/server/renderChildren.d.ts.map +1 -1
  65. package/dist/mjs/server/value/InnerValue.d.ts +2 -2
  66. package/dist/mjs/server/value/InnerValue.d.ts.map +1 -1
  67. package/dist/mjs/server/value/InnerValue.js +4 -4
  68. package/dist/mjs/server/value/InnerValue.js.map +1 -1
  69. package/dist/mjs/server.d.ts.map +1 -1
  70. package/dist/mjs/server.js +5 -4
  71. package/dist/mjs/server.js.map +1 -1
  72. package/package.json +1 -1
  73. package/dist/cjs/client/ClientProvider.d.ts +0 -19
  74. package/dist/cjs/client/ClientProvider.d.ts.map +0 -1
  75. package/dist/cjs/client/ClientProvider.js +0 -29
  76. package/dist/cjs/client/ClientProvider.js.map +0 -1
  77. package/dist/cjs/client/client-only/GTClientProvider.d.ts +0 -13
  78. package/dist/cjs/client/client-only/GTClientProvider.d.ts.map +0 -1
  79. package/dist/cjs/client/client-only/GTClientProvider.js +0 -94
  80. package/dist/cjs/client/client-only/GTClientProvider.js.map +0 -1
  81. package/dist/cjs/client/client-only/helpers/renderDictionary.d.ts +0 -2
  82. package/dist/cjs/client/client-only/helpers/renderDictionary.d.ts.map +0 -1
  83. package/dist/cjs/client/client-only/helpers/renderDictionary.js +0 -10
  84. package/dist/cjs/client/client-only/helpers/renderDictionary.js.map +0 -1
  85. package/dist/cjs/client/hooks/useBrowserLocale.d.ts +0 -7
  86. package/dist/cjs/client/hooks/useBrowserLocale.d.ts.map +0 -1
  87. package/dist/cjs/client/hooks/useBrowserLocale.js +0 -41
  88. package/dist/cjs/client/hooks/useBrowserLocale.js.map +0 -1
  89. package/dist/cjs/client/hooks/useDefaultLocale.d.ts +0 -5
  90. package/dist/cjs/client/hooks/useDefaultLocale.d.ts.map +0 -1
  91. package/dist/cjs/client/hooks/useDefaultLocale.js +0 -13
  92. package/dist/cjs/client/hooks/useDefaultLocale.js.map +0 -1
  93. package/dist/cjs/client/hooks/useGT.d.ts +0 -10
  94. package/dist/cjs/client/hooks/useGT.d.ts.map +0 -1
  95. package/dist/cjs/client/hooks/useGT.js +0 -61
  96. package/dist/cjs/client/hooks/useGT.js.map +0 -1
  97. package/dist/cjs/client/hooks/useLocale.d.ts +0 -5
  98. package/dist/cjs/client/hooks/useLocale.d.ts.map +0 -1
  99. package/dist/cjs/client/hooks/useLocale.js +0 -13
  100. package/dist/cjs/client/hooks/useLocale.js.map +0 -1
  101. package/dist/cjs/client/plural/ClientPlural.d.ts +0 -27
  102. package/dist/cjs/client/plural/ClientPlural.d.ts.map +0 -1
  103. package/dist/cjs/client/plural/ClientPlural.js +0 -77
  104. package/dist/cjs/client/plural/ClientPlural.js.map +0 -1
  105. package/dist/cjs/client/value/ClientValue.d.ts +0 -16
  106. package/dist/cjs/client/value/ClientValue.d.ts.map +0 -1
  107. package/dist/cjs/client/value/ClientValue.js +0 -42
  108. package/dist/cjs/client/value/ClientValue.js.map +0 -1
  109. package/dist/cjs/client/value/RenderClientVariable.d.ts +0 -6
  110. package/dist/cjs/client/value/RenderClientVariable.d.ts.map +0 -1
  111. package/dist/cjs/client/value/RenderClientVariable.js +0 -106
  112. package/dist/cjs/client/value/RenderClientVariable.js.map +0 -1
  113. package/dist/cjs/client/variables/ClientCurrency.d.ts +0 -13
  114. package/dist/cjs/client/variables/ClientCurrency.d.ts.map +0 -1
  115. package/dist/cjs/client/variables/ClientCurrency.js +0 -31
  116. package/dist/cjs/client/variables/ClientCurrency.js.map +0 -1
  117. package/dist/cjs/client/variables/ClientDateTime.d.ts +0 -12
  118. package/dist/cjs/client/variables/ClientDateTime.d.ts.map +0 -1
  119. package/dist/cjs/client/variables/ClientDateTime.js +0 -45
  120. package/dist/cjs/client/variables/ClientDateTime.js.map +0 -1
  121. package/dist/cjs/client/variables/ClientNum.d.ts +0 -12
  122. package/dist/cjs/client/variables/ClientNum.d.ts.map +0 -1
  123. package/dist/cjs/client/variables/ClientNum.js +0 -29
  124. package/dist/cjs/client/variables/ClientNum.js.map +0 -1
  125. package/dist/cjs/client/variables/ClientVar.d.ts +0 -21
  126. package/dist/cjs/client/variables/ClientVar.d.ts.map +0 -1
  127. package/dist/cjs/client/variables/ClientVar.js +0 -26
  128. package/dist/cjs/client/variables/ClientVar.js.map +0 -1
  129. package/dist/cjs/client.d.ts +0 -12
  130. package/dist/cjs/client.d.ts.map +0 -1
  131. package/dist/cjs/client.js +0 -27
  132. package/dist/cjs/client.js.map +0 -1
  133. package/dist/cjs/config/I18NConfiguration.d.ts +0 -135
  134. package/dist/cjs/config/I18NConfiguration.d.ts.map +0 -1
  135. package/dist/cjs/config/I18NConfiguration.js +0 -343
  136. package/dist/cjs/config/I18NConfiguration.js.map +0 -1
  137. package/dist/cjs/config/LocalDictionaryManager.d.ts +0 -31
  138. package/dist/cjs/config/LocalDictionaryManager.d.ts.map +0 -1
  139. package/dist/cjs/config/LocalDictionaryManager.js +0 -95
  140. package/dist/cjs/config/LocalDictionaryManager.js.map +0 -1
  141. package/dist/cjs/config/RemoteDictionaryManager.d.ts +0 -59
  142. package/dist/cjs/config/RemoteDictionaryManager.d.ts.map +0 -1
  143. package/dist/cjs/config/RemoteDictionaryManager.js +0 -120
  144. package/dist/cjs/config/RemoteDictionaryManager.js.map +0 -1
  145. package/dist/cjs/config/determineLocale.d.ts +0 -2
  146. package/dist/cjs/config/determineLocale.d.ts.map +0 -1
  147. package/dist/cjs/config/determineLocale.js +0 -32
  148. package/dist/cjs/config/determineLocale.js.map +0 -1
  149. package/dist/cjs/config/local/getDefaultFromEnv.d.ts +0 -12
  150. package/dist/cjs/config/local/getDefaultFromEnv.d.ts.map +0 -1
  151. package/dist/cjs/config/local/getDefaultFromEnv.js +0 -21
  152. package/dist/cjs/config/local/getDefaultFromEnv.js.map +0 -1
  153. package/dist/cjs/dictionary/createDictFunction.d.ts +0 -3
  154. package/dist/cjs/dictionary/createDictFunction.d.ts.map +0 -1
  155. package/dist/cjs/dictionary/createDictFunction.js +0 -13
  156. package/dist/cjs/dictionary/createDictFunction.js.map +0 -1
  157. package/dist/cjs/dictionary/createGetGTFunction.d.ts +0 -3
  158. package/dist/cjs/dictionary/createGetGTFunction.d.ts.map +0 -1
  159. package/dist/cjs/dictionary/createGetGTFunction.js +0 -10
  160. package/dist/cjs/dictionary/createGetGTFunction.js.map +0 -1
  161. package/dist/cjs/dictionary/createTFunction.d.ts +0 -12
  162. package/dist/cjs/dictionary/createTFunction.d.ts.map +0 -1
  163. package/dist/cjs/dictionary/createTFunction.js +0 -75
  164. package/dist/cjs/dictionary/createTFunction.js.map +0 -1
  165. package/dist/cjs/dictionary/getDictionaryEntry.d.ts +0 -2
  166. package/dist/cjs/dictionary/getDictionaryEntry.d.ts.map +0 -1
  167. package/dist/cjs/dictionary/getDictionaryEntry.js +0 -14
  168. package/dist/cjs/dictionary/getDictionaryEntry.js.map +0 -1
  169. package/dist/cjs/index.d.ts +0 -6
  170. package/dist/cjs/index.d.ts.map +0 -1
  171. package/dist/cjs/index.js +0 -15
  172. package/dist/cjs/index.js.map +0 -1
  173. package/dist/cjs/intl/createIntlFunction.d.ts +0 -6
  174. package/dist/cjs/intl/createIntlFunction.d.ts.map +0 -1
  175. package/dist/cjs/intl/createIntlFunction.js +0 -48
  176. package/dist/cjs/intl/createIntlFunction.js.map +0 -1
  177. package/dist/cjs/middleware/cookieSettings.d.ts +0 -2
  178. package/dist/cjs/middleware/cookieSettings.d.ts.map +0 -1
  179. package/dist/cjs/middleware/cookieSettings.js +0 -5
  180. package/dist/cjs/middleware/cookieSettings.js.map +0 -1
  181. package/dist/cjs/middleware/createNextMiddleware.d.ts +0 -10
  182. package/dist/cjs/middleware/createNextMiddleware.d.ts.map +0 -1
  183. package/dist/cjs/middleware/createNextMiddleware.js +0 -151
  184. package/dist/cjs/middleware/createNextMiddleware.js.map +0 -1
  185. package/dist/cjs/middleware.d.ts +0 -3
  186. package/dist/cjs/middleware.d.ts.map +0 -1
  187. package/dist/cjs/middleware.js +0 -9
  188. package/dist/cjs/middleware.js.map +0 -1
  189. package/dist/cjs/next/imports/imports.d.ts +0 -6
  190. package/dist/cjs/next/imports/imports.d.ts.map +0 -1
  191. package/dist/cjs/next/imports/imports.js +0 -84
  192. package/dist/cjs/next/imports/imports.js.map +0 -1
  193. package/dist/cjs/next/requestFunctions.d.ts +0 -21
  194. package/dist/cjs/next/requestFunctions.d.ts.map +0 -1
  195. package/dist/cjs/next/requestFunctions.js +0 -58
  196. package/dist/cjs/next/requestFunctions.js.map +0 -1
  197. package/dist/cjs/next.d.ts +0 -38
  198. package/dist/cjs/next.d.ts.map +0 -1
  199. package/dist/cjs/next.js +0 -58
  200. package/dist/cjs/next.js.map +0 -1
  201. package/dist/cjs/primitives/calculateID.d.ts +0 -2
  202. package/dist/cjs/primitives/calculateID.d.ts.map +0 -1
  203. package/dist/cjs/primitives/calculateID.js +0 -49
  204. package/dist/cjs/primitives/calculateID.js.map +0 -1
  205. package/dist/cjs/primitives/defaultVariableNames.d.ts +0 -3
  206. package/dist/cjs/primitives/defaultVariableNames.d.ts.map +0 -1
  207. package/dist/cjs/primitives/defaultVariableNames.js +0 -10
  208. package/dist/cjs/primitives/defaultVariableNames.js.map +0 -1
  209. package/dist/cjs/primitives/flattenDictionary.d.ts +0 -9
  210. package/dist/cjs/primitives/flattenDictionary.d.ts.map +0 -1
  211. package/dist/cjs/primitives/flattenDictionary.js +0 -29
  212. package/dist/cjs/primitives/flattenDictionary.js.map +0 -1
  213. package/dist/cjs/primitives/getDictionaryReference.d.ts +0 -8
  214. package/dist/cjs/primitives/getDictionaryReference.d.ts.map +0 -1
  215. package/dist/cjs/primitives/getDictionaryReference.js +0 -13
  216. package/dist/cjs/primitives/getDictionaryReference.js.map +0 -1
  217. package/dist/cjs/primitives/getPluralBranch.d.ts +0 -14
  218. package/dist/cjs/primitives/getPluralBranch.d.ts.map +0 -1
  219. package/dist/cjs/primitives/getPluralBranch.js +0 -88
  220. package/dist/cjs/primitives/getPluralBranch.js.map +0 -1
  221. package/dist/cjs/primitives/getValueBranch.d.ts +0 -9
  222. package/dist/cjs/primitives/getValueBranch.d.ts.map +0 -1
  223. package/dist/cjs/primitives/getValueBranch.js +0 -67
  224. package/dist/cjs/primitives/getValueBranch.js.map +0 -1
  225. package/dist/cjs/primitives/hasTransformation.d.ts +0 -3
  226. package/dist/cjs/primitives/hasTransformation.d.ts.map +0 -1
  227. package/dist/cjs/primitives/hasTransformation.js +0 -16
  228. package/dist/cjs/primitives/hasTransformation.js.map +0 -1
  229. package/dist/cjs/primitives/isPromise.d.ts +0 -7
  230. package/dist/cjs/primitives/isPromise.d.ts.map +0 -1
  231. package/dist/cjs/primitives/isPromise.js +0 -12
  232. package/dist/cjs/primitives/isPromise.js.map +0 -1
  233. package/dist/cjs/primitives/isValidReactNode.d.ts +0 -15
  234. package/dist/cjs/primitives/isValidReactNode.d.ts.map +0 -1
  235. package/dist/cjs/primitives/isValidReactNode.js +0 -27
  236. package/dist/cjs/primitives/isValidReactNode.js.map +0 -1
  237. package/dist/cjs/server/T.d.ts +0 -15
  238. package/dist/cjs/server/T.d.ts.map +0 -1
  239. package/dist/cjs/server/T.js +0 -101
  240. package/dist/cjs/server/T.js.map +0 -1
  241. package/dist/cjs/server/createTComponent.d.ts +0 -12
  242. package/dist/cjs/server/createTComponent.d.ts.map +0 -1
  243. package/dist/cjs/server/createTComponent.js +0 -31
  244. package/dist/cjs/server/createTComponent.js.map +0 -1
  245. package/dist/cjs/server/helpers/Resolver.d.ts +0 -5
  246. package/dist/cjs/server/helpers/Resolver.d.ts.map +0 -1
  247. package/dist/cjs/server/helpers/Resolver.js +0 -25
  248. package/dist/cjs/server/helpers/Resolver.js.map +0 -1
  249. package/dist/cjs/server/helpers/addGTIdentifier.d.ts +0 -11
  250. package/dist/cjs/server/helpers/addGTIdentifier.d.ts.map +0 -1
  251. package/dist/cjs/server/helpers/addGTIdentifier.js +0 -148
  252. package/dist/cjs/server/helpers/addGTIdentifier.js.map +0 -1
  253. package/dist/cjs/server/helpers/writeChildrenAsObjects.d.ts +0 -11
  254. package/dist/cjs/server/helpers/writeChildrenAsObjects.d.ts.map +0 -1
  255. package/dist/cjs/server/helpers/writeChildrenAsObjects.js +0 -116
  256. package/dist/cjs/server/helpers/writeChildrenAsObjects.js.map +0 -1
  257. package/dist/cjs/server/plural/InnerPlural.d.ts +0 -23
  258. package/dist/cjs/server/plural/InnerPlural.d.ts.map +0 -1
  259. package/dist/cjs/server/plural/InnerPlural.js +0 -34
  260. package/dist/cjs/server/plural/InnerPlural.js.map +0 -1
  261. package/dist/cjs/server/plural/createPluralComponent.d.ts +0 -12
  262. package/dist/cjs/server/plural/createPluralComponent.d.ts.map +0 -1
  263. package/dist/cjs/server/plural/createPluralComponent.js +0 -30
  264. package/dist/cjs/server/plural/createPluralComponent.js.map +0 -1
  265. package/dist/cjs/server/provider/GTProvider.d.ts +0 -14
  266. package/dist/cjs/server/provider/GTProvider.d.ts.map +0 -1
  267. package/dist/cjs/server/provider/GTProvider.js +0 -79
  268. package/dist/cjs/server/provider/GTProvider.js.map +0 -1
  269. package/dist/cjs/server/provider/createGTProviderComponent.d.ts +0 -11
  270. package/dist/cjs/server/provider/createGTProviderComponent.d.ts.map +0 -1
  271. package/dist/cjs/server/provider/createGTProviderComponent.js +0 -30
  272. package/dist/cjs/server/provider/createGTProviderComponent.js.map +0 -1
  273. package/dist/cjs/server/renderChildren.d.ts +0 -24
  274. package/dist/cjs/server/renderChildren.d.ts.map +0 -1
  275. package/dist/cjs/server/renderChildren.js +0 -177
  276. package/dist/cjs/server/renderChildren.js.map +0 -1
  277. package/dist/cjs/server/value/InnerValue.d.ts +0 -12
  278. package/dist/cjs/server/value/InnerValue.d.ts.map +0 -1
  279. package/dist/cjs/server/value/InnerValue.js +0 -30
  280. package/dist/cjs/server/value/InnerValue.js.map +0 -1
  281. package/dist/cjs/server/value/createValueComponent.d.ts +0 -13
  282. package/dist/cjs/server/value/createValueComponent.d.ts.map +0 -1
  283. package/dist/cjs/server/value/createValueComponent.js +0 -29
  284. package/dist/cjs/server/value/createValueComponent.js.map +0 -1
  285. package/dist/cjs/server/value/renderVariable.d.ts +0 -9
  286. package/dist/cjs/server/value/renderVariable.d.ts.map +0 -1
  287. package/dist/cjs/server/value/renderVariable.js +0 -66
  288. package/dist/cjs/server/value/renderVariable.js.map +0 -1
  289. package/dist/cjs/server/variables/Currency/Currency.d.ts +0 -15
  290. package/dist/cjs/server/variables/Currency/Currency.d.ts.map +0 -1
  291. package/dist/cjs/server/variables/Currency/Currency.js +0 -29
  292. package/dist/cjs/server/variables/Currency/Currency.js.map +0 -1
  293. package/dist/cjs/server/variables/Currency/createCurrencyComponent.d.ts +0 -8
  294. package/dist/cjs/server/variables/Currency/createCurrencyComponent.d.ts.map +0 -1
  295. package/dist/cjs/server/variables/Currency/createCurrencyComponent.js +0 -29
  296. package/dist/cjs/server/variables/Currency/createCurrencyComponent.js.map +0 -1
  297. package/dist/cjs/server/variables/DateTime/DateTime.d.ts +0 -13
  298. package/dist/cjs/server/variables/DateTime/DateTime.d.ts.map +0 -1
  299. package/dist/cjs/server/variables/DateTime/DateTime.js +0 -45
  300. package/dist/cjs/server/variables/DateTime/DateTime.js.map +0 -1
  301. package/dist/cjs/server/variables/DateTime/createDateTimeComponent.d.ts +0 -8
  302. package/dist/cjs/server/variables/DateTime/createDateTimeComponent.d.ts.map +0 -1
  303. package/dist/cjs/server/variables/DateTime/createDateTimeComponent.js +0 -29
  304. package/dist/cjs/server/variables/DateTime/createDateTimeComponent.js.map +0 -1
  305. package/dist/cjs/server/variables/Num/Num.d.ts +0 -14
  306. package/dist/cjs/server/variables/Num/Num.d.ts.map +0 -1
  307. package/dist/cjs/server/variables/Num/Num.js +0 -27
  308. package/dist/cjs/server/variables/Num/Num.js.map +0 -1
  309. package/dist/cjs/server/variables/Num/createNumComponent.d.ts +0 -8
  310. package/dist/cjs/server/variables/Num/createNumComponent.d.ts.map +0 -1
  311. package/dist/cjs/server/variables/Num/createNumComponent.js +0 -30
  312. package/dist/cjs/server/variables/Num/createNumComponent.js.map +0 -1
  313. package/dist/cjs/server/variables/Var/Var.d.ts +0 -12
  314. package/dist/cjs/server/variables/Var/Var.d.ts.map +0 -1
  315. package/dist/cjs/server/variables/Var/Var.js +0 -24
  316. package/dist/cjs/server/variables/Var/Var.js.map +0 -1
  317. package/dist/cjs/server/variables/Var/createVarComponent.d.ts +0 -7
  318. package/dist/cjs/server/variables/Var/createVarComponent.d.ts.map +0 -1
  319. package/dist/cjs/server/variables/Var/createVarComponent.js +0 -29
  320. package/dist/cjs/server/variables/Var/createVarComponent.js.map +0 -1
  321. package/dist/cjs/server.d.ts +0 -45
  322. package/dist/cjs/server.d.ts.map +0 -1
  323. package/dist/cjs/server.js +0 -148
  324. package/dist/cjs/server.js.map +0 -1
  325. package/dist/cjs/types/CreateGTProps.d.ts +0 -23
  326. package/dist/cjs/types/CreateGTProps.d.ts.map +0 -1
  327. package/dist/cjs/types/CreateGTProps.js +0 -3
  328. package/dist/cjs/types/CreateGTProps.js.map +0 -1
  329. package/dist/cjs/types/GeneralTranslationInterface.d.ts +0 -118
  330. package/dist/cjs/types/GeneralTranslationInterface.d.ts.map +0 -1
  331. package/dist/cjs/types/GeneralTranslationInterface.js +0 -3
  332. package/dist/cjs/types/GeneralTranslationInterface.js.map +0 -1
  333. package/dist/cjs/types/Variables.d.ts +0 -83
  334. package/dist/cjs/types/Variables.d.ts.map +0 -1
  335. package/dist/cjs/types/Variables.js +0 -3
  336. package/dist/cjs/types/Variables.js.map +0 -1
  337. package/dist/cjs/types/defaultGTProps.d.ts +0 -20
  338. package/dist/cjs/types/defaultGTProps.d.ts.map +0 -1
  339. package/dist/cjs/types/defaultGTProps.js +0 -31
  340. package/dist/cjs/types/defaultGTProps.js.map +0 -1
  341. package/dist/mjs/primitives/isPromise.d.ts +0 -7
  342. package/dist/mjs/primitives/isPromise.d.ts.map +0 -1
  343. package/dist/mjs/primitives/isPromise.js +0 -9
  344. package/dist/mjs/primitives/isPromise.js.map +0 -1
@@ -1,343 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __rest = (this && this.__rest) || function (s, e) {
35
- var t = {};
36
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
37
- t[p] = s[p];
38
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
39
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
40
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
41
- t[p[i]] = s[p[i]];
42
- }
43
- return t;
44
- };
45
- var __importDefault = (this && this.__importDefault) || function (mod) {
46
- return (mod && mod.__esModule) ? mod : { "default": mod };
47
- };
48
- Object.defineProperty(exports, "__esModule", { value: true });
49
- const generaltranslation_1 = __importStar(require("generaltranslation"));
50
- const RemoteDictionaryManager_1 = __importDefault(require("./RemoteDictionaryManager"));
51
- const getDictionaryEntry_1 = __importDefault(require("../dictionary/getDictionaryEntry"));
52
- const LocalDictionaryManager_1 = __importDefault(require("./LocalDictionaryManager"));
53
- const defaultGTProps_1 = __importDefault(require("../types/defaultGTProps"));
54
- class I18NConfiguration {
55
- constructor(_a) {
56
- var {
57
- // Cloud integration
58
- apiKey, projectID, baseURL, cacheURL, remoteSource, automaticTranslation,
59
- // Locale info
60
- getLocale, defaultLocale, approvedLocales,
61
- // Render method
62
- renderPrevious, renderMethod, renderTimeout,
63
- // Dictionaries
64
- dictionary, dictionaryName, translations,
65
- // Batching config
66
- maxConcurrentRequests, batchInterval,
67
- // Other metadata
68
- getMetadata } = _a, metadata = __rest(_a, ["apiKey", "projectID", "baseURL", "cacheURL", "remoteSource", "automaticTranslation", "getLocale", "defaultLocale", "approvedLocales", "renderPrevious", "renderMethod", "renderTimeout", "dictionary", "dictionaryName", "translations", "maxConcurrentRequests", "batchInterval", "getMetadata"]);
69
- // Validate required parameters
70
- if (!apiKey && (automaticTranslation && baseURL === defaultGTProps_1.default.baseURL)) {
71
- throw new Error("gt-react Error: Automatic translation requires an API key! Get an API key at www.generaltranslation.com.");
72
- }
73
- if (!projectID && ((automaticTranslation && baseURL === defaultGTProps_1.default.baseURL) || (remoteSource && cacheURL === defaultGTProps_1.default.cacheURL))) {
74
- throw new Error("gt-react Error: General Translation cloud services require a project ID! Find yours at www.generaltranslation.com/dashboard.");
75
- }
76
- // Cloud integration
77
- this.projectID = projectID;
78
- this.remoteSource = remoteSource;
79
- this.automaticTranslation = automaticTranslation;
80
- // Locales
81
- this.getLocale = getLocale;
82
- this.defaultLocale = defaultLocale;
83
- this.approvedLocales = approvedLocales;
84
- // Render method
85
- this.renderPrevious = renderPrevious;
86
- this.renderMethod = renderMethod;
87
- this.renderTimeout = renderTimeout;
88
- // Dictionaries
89
- this.dictionary = dictionary;
90
- this.dictionaryName = dictionaryName;
91
- this.translations = translations;
92
- // GT
93
- this.gt = new generaltranslation_1.default({ projectID, apiKey, defaultLanguage: defaultLocale, baseURL });
94
- // Other metadata
95
- this.getMetadata = getMetadata;
96
- this.metadata = Object.assign(Object.assign({ projectID: this.projectID, defaultLanguage: this.defaultLocale, dictionaryName }, (this.renderTimeout && { timeout: this.renderTimeout - batchInterval })), metadata);
97
- // Dictionary managers
98
- if (this.translations) {
99
- this._localDictionaryManager = new LocalDictionaryManager_1.default({
100
- translations: this.translations
101
- });
102
- }
103
- if (this.remoteSource) {
104
- this._remoteDictionaryManager = RemoteDictionaryManager_1.default;
105
- this._remoteDictionaryManager.setConfig({
106
- cacheURL, projectID
107
- });
108
- }
109
- // Batching
110
- this.maxConcurrentRequests = maxConcurrentRequests;
111
- this.batchInterval = batchInterval;
112
- this._queue = [];
113
- this._activeRequests = 0;
114
- this._translationCache = new Map(); // cache for ongoing promises, so things aren't translated twice
115
- this._startBatching();
116
- }
117
- /**
118
- * Gets the application's default locale
119
- * @returns {string} A BCP-47 language tag
120
- */
121
- getDefaultLocale() {
122
- return this.defaultLocale;
123
- }
124
- /**
125
- * Gets the list of approved locales for this app
126
- * @returns {string[] | undefined} A list of BCP-47 language tags, or undefined if none were provided
127
- */
128
- getApprovedLocales() {
129
- return this.approvedLocales;
130
- }
131
- /**
132
- * Get dictionary
133
- * @returns The entire dictionary, or an empty object if none found
134
- */
135
- getDictionary() {
136
- return this.dictionary;
137
- }
138
- /**
139
- * Get an entry from the dictionary
140
- * @returns An entry from the dictionary determined by id
141
- */
142
- getDictionaryEntry(id) {
143
- return (0, getDictionaryEntry_1.default)(id, this.dictionary);
144
- }
145
- /**
146
- * Get an entry from the dictionary
147
- * @returns An entry from the dictionary determined by id
148
- */
149
- automaticTranslationEnabled() {
150
- return this.automaticTranslation;
151
- }
152
- /**
153
- * Get the rendering instructions
154
- * @returns An object containing the current method and timeout.
155
- * As of 7/31/24: method is "skeleton", "replace", "hang", "subtle".
156
- * Timeout is a number or null, representing no assigned timeout.
157
- * renderPrevious determines whether a non-matching previous entry should be rendered while the new translation loads.
158
- */
159
- getRenderSettings() {
160
- return {
161
- method: this.renderMethod,
162
- timeout: this.renderTimeout,
163
- renderPrevious: this.renderPrevious
164
- };
165
- }
166
- /**
167
- * Check if translation is required based on the user's locale
168
- * @param locale - The user's locale
169
- * @returns True if translation is required, otherwise false
170
- */
171
- translationRequired(locale) {
172
- if (!locale)
173
- return false;
174
- if (this.approvedLocales && !this.approvedLocales.some(approvedLocale => (0, generaltranslation_1.isSameLanguage)(locale, approvedLocale)))
175
- return false;
176
- if ((0, generaltranslation_1.isSameLanguage)(locale, this.defaultLocale))
177
- return false;
178
- return true;
179
- }
180
- /**
181
- * Get the translation dictionaries for this user's locale, if they exist
182
- * @param locale - The language set by the user
183
- * @param dictionaryName - User-defined dictionary name, for distinguishing between multiple translation dictionaries for a single language.
184
- * @returns A promise that resolves to the translations.
185
- */
186
- getTranslations(locale_1) {
187
- return __awaiter(this, arguments, void 0, function* (locale, dictionaryName = this.dictionaryName) {
188
- let translations = {};
189
- const localPromise = this._localDictionaryManager ? this._localDictionaryManager.getDictionary(locale) : Promise.resolve(undefined);
190
- const remotePromise = this._remoteDictionaryManager ? this._remoteDictionaryManager.getDictionary(locale, dictionaryName) : Promise.resolve(undefined);
191
- const [local, remote] = yield Promise.all([localPromise, remotePromise]);
192
- if (local !== undefined) {
193
- translations.local = local;
194
- }
195
- if (remote !== undefined) {
196
- translations.remote = remote;
197
- }
198
- return translations;
199
- });
200
- }
201
- /**
202
- * Get the entry in the translation dictionary for the user's locale, if it exists
203
- * @param locale - The user's locale
204
- * @param key - Key in the dictionary. For strings, the original language version of that string. For React children, a hash.
205
- * @param dictionaryName - User-defined dictionary name, for distinguishing between multiple translation dictionaries for a single language.
206
- * @param translations - Optional translations to search.
207
- * @returns A promise that resolves to the a value in the translations.
208
- */
209
- getTranslation(locale_1, key_1) {
210
- return __awaiter(this, arguments, void 0, function* (locale, key, id = key, dictionaryName = this.dictionaryName, translations) {
211
- translations = translations || (yield this.getTranslations(locale, dictionaryName));
212
- if (translations.local) {
213
- const translation = (0, getDictionaryEntry_1.default)(id, translations.local);
214
- if (translation)
215
- return translation;
216
- }
217
- if (translations.remote) {
218
- if (translations.remote[id] && translations.remote[id].k === key)
219
- return translations.remote[id].t;
220
- }
221
- return null;
222
- });
223
- }
224
- /**
225
- * Translate content into language
226
- * @param params - Parameters for translation
227
- * @returns Translated string
228
- */
229
- intl(params) {
230
- return __awaiter(this, void 0, void 0, function* () {
231
- var _a;
232
- const cacheKey = JSON.stringify(params);
233
- if (this._translationCache.has(cacheKey)) {
234
- return this._translationCache.get(cacheKey);
235
- }
236
- const { content, targetLanguage, options } = params;
237
- const dictionaryName = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.dictionaryName) || this.dictionaryName;
238
- const translationPromise = new Promise((resolve, reject) => {
239
- this._queue.push({
240
- type: "intl",
241
- data: {
242
- content,
243
- targetLanguage,
244
- projectID: this.projectID,
245
- metadata: Object.assign(Object.assign(Object.assign({}, this.metadata), this.getMetadata()), options)
246
- },
247
- cache: (this._remoteDictionaryManager) ? this._remoteDictionaryManager.getTranslationRequested(targetLanguage, dictionaryName) : false,
248
- resolve,
249
- reject
250
- });
251
- });
252
- this._translationCache.set(cacheKey, translationPromise);
253
- return translationPromise.finally(() => this._translationCache.delete(cacheKey));
254
- });
255
- }
256
- /**
257
- * Translate the children components
258
- * @param params - Parameters for translation
259
- * @returns A promise that resolves when translation is complete
260
- */
261
- translateChildren(params) {
262
- return __awaiter(this, void 0, void 0, function* () {
263
- var _a;
264
- const cacheKey = JSON.stringify(params);
265
- if (this._translationCache.has(cacheKey)) {
266
- return this._translationCache.get(cacheKey);
267
- }
268
- const { children, targetLanguage, metadata } = params;
269
- const dictionaryName = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.dictionaryName) || this.dictionaryName;
270
- const translationPromise = new Promise((resolve, reject) => {
271
- this._queue.push({
272
- type: "react",
273
- data: {
274
- children,
275
- targetLanguage,
276
- metadata: Object.assign(Object.assign(Object.assign({}, this.metadata), this.getMetadata()), metadata)
277
- },
278
- cache: (this._remoteDictionaryManager) ? this._remoteDictionaryManager.getTranslationRequested(targetLanguage, dictionaryName) : false,
279
- resolve,
280
- reject
281
- });
282
- });
283
- this._translationCache.set(cacheKey, translationPromise);
284
- return translationPromise.finally(() => this._translationCache.delete(cacheKey));
285
- });
286
- }
287
- /**
288
- * Send a batch request for React translation
289
- * @param batch - The batch of requests to be sent
290
- */
291
- _sendBatchRequest(batch) {
292
- return __awaiter(this, void 0, void 0, function* () {
293
- this._activeRequests++;
294
- try {
295
- const bundlePromise = this.gt.bundleTranslation(batch);
296
- batch.forEach((item) => {
297
- if (this._remoteDictionaryManager && item.cache)
298
- this._remoteDictionaryManager.setTranslationRequested(item.data.targetLanguage, item.data.metadata.dictionaryName);
299
- });
300
- const results = yield bundlePromise;
301
- batch.forEach((item, index) => {
302
- const result = results[index];
303
- if (!result || result.error)
304
- return resolveBatchError(item);
305
- if (result && typeof result === 'object') {
306
- item.resolve(result.translation);
307
- if (result.translation && result.language && result.reference && this._remoteDictionaryManager) {
308
- this._remoteDictionaryManager.setDictionary(result.language, result.reference.dictionaryName, result.reference.key, result.reference.id, result.translation);
309
- }
310
- }
311
- });
312
- }
313
- catch (error) {
314
- console.error(error);
315
- batch.forEach(resolveBatchError);
316
- }
317
- finally {
318
- this._activeRequests--;
319
- }
320
- });
321
- }
322
- /**
323
- * Start the batching process with a set interval
324
- */
325
- _startBatching() {
326
- setInterval(() => {
327
- if (this._queue.length > 0 && this._activeRequests < this.maxConcurrentRequests) {
328
- this._sendBatchRequest(this._queue);
329
- this._queue = [];
330
- }
331
- }, this.batchInterval);
332
- }
333
- }
334
- exports.default = I18NConfiguration;
335
- // Resolve errors in the batch request
336
- const resolveBatchError = (item) => {
337
- if (item.type === "react")
338
- return item.resolve(null);
339
- if (item.type === "intl")
340
- return item.resolve(item.data.content);
341
- return item.resolve("");
342
- };
343
- //# sourceMappingURL=I18NConfiguration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"I18NConfiguration.js","sourceRoot":"","sources":["../../../src/config/I18NConfiguration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAwD;AACxD,wFAA6F;AAC7F,0FAAkE;AAClE,sFAA8D;AAC9D,6EAAqD;AAwBrD,MAAqB,iBAAiB;IAgClC,YAAY,EAkBc;YAlBd;QACR,oBAAoB;QACpB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,QAAQ,EACjB,YAAY,EAAE,oBAAoB;QAClC,cAAc;QACd,SAAS,EACT,aAAa,EACb,eAAe;QACf,gBAAgB;QAChB,cAAc,EAAE,YAAY,EAAE,aAAa;QAC3C,eAAe;QACf,UAAU,EAAE,cAAc,EAAE,YAAY;QACxC,kBAAkB;QAClB,qBAAqB,EAAE,aAAa;QACpC,iBAAiB;QACjB,WAAW,OAEW,EADnB,QAAQ,cAjBH,mSAkBX,CADc;QAEX,+BAA+B;QAC/B,IAAI,CAAC,MAAM,IAAI,CAAC,oBAAoB,IAAI,OAAO,KAAK,wBAAc,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;QAChI,CAAC;QACD,IAAI,CAAC,SAAS,IAAI,CAAC,CAAC,oBAAoB,IAAI,OAAO,KAAK,wBAAc,CAAC,OAAO,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,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChE,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC5B,CAAC,CAAA"}
@@ -1,31 +0,0 @@
1
- /**
2
- * LocalDictionaryManager is responsible for managing dictionaries loaded from local file paths.
3
- * @class
4
- */
5
- export default class LocalDictionaryManager {
6
- private translations;
7
- private localeCache;
8
- private dictionaryMap;
9
- private fetchPromises;
10
- /**
11
- * Creates an instance of LocalDictionaryManager.
12
- * @param {Object} params - Parameters object.
13
- * @param {Record<string, () => Promise<Record<string, any>>>} params.translations - A mapping of locale to a function that imports the corresponding dictionary.
14
- */
15
- constructor({ translations }: {
16
- translations: Record<string, () => Promise<Record<string, any>>>;
17
- });
18
- /**
19
- * Retrieves a dictionary based on locale.
20
- * @param {string} locale - The locale of the dictionary.
21
- * @returns {Promise<Record<string, any> | null>} The dictionary data or null if not found.
22
- */
23
- getDictionary(locale: string): Promise<Record<string, any> | null>;
24
- /**
25
- * Fetches a dictionary from the translations object using the provided function.
26
- * @param {string} locale - The locale of the dictionary.
27
- * @returns {Promise<Record<string, any> | null>} The fetched dictionary data or null if not found.
28
- */
29
- private _fetchDictionary;
30
- }
31
- //# sourceMappingURL=LocalDictionaryManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalDictionaryManager.d.ts","sourceRoot":"","sources":["../../../src/config/LocalDictionaryManager.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,sBAAsB;IACvC,OAAO,CAAC,YAAY,CAAqD;IACzE,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,aAAa,CAAmD;IAExE;;;;OAIG;gBACS,EAAE,YAAY,EAAE,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;KAAE;IAOlG;;;;OAIG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IA6CxE;;;;OAIG;YACW,gBAAgB;CAWjC"}
@@ -1,95 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const generaltranslation_1 = require("generaltranslation");
13
- /**
14
- * LocalDictionaryManager is responsible for managing dictionaries loaded from local file paths.
15
- * @class
16
- */
17
- class LocalDictionaryManager {
18
- /**
19
- * Creates an instance of LocalDictionaryManager.
20
- * @param {Object} params - Parameters object.
21
- * @param {Record<string, () => Promise<Record<string, any>>>} params.translations - A mapping of locale to a function that imports the corresponding dictionary.
22
- */
23
- constructor({ translations }) {
24
- this.translations = translations;
25
- this.localeCache = new Map();
26
- this.dictionaryMap = new Map();
27
- this.fetchPromises = new Map();
28
- }
29
- /**
30
- * Retrieves a dictionary based on locale.
31
- * @param {string} locale - The locale of the dictionary.
32
- * @returns {Promise<Record<string, any> | null>} The dictionary data or null if not found.
33
- */
34
- getDictionary(locale) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- // Check if the dictionary is already cached
37
- if (this.dictionaryMap.has(locale)) {
38
- return this.dictionaryMap.get(locale) || null;
39
- }
40
- // Check if there is an ongoing fetch for this locale
41
- if (this.fetchPromises.has(locale)) {
42
- return (yield this.fetchPromises.get(locale)) || null;
43
- }
44
- // Resolve the final locale
45
- let finalLocale = locale;
46
- if (!this.translations[finalLocale]) {
47
- finalLocale = this.localeCache.get(locale) || '';
48
- if (!finalLocale) {
49
- for (const key of Object.keys(this.translations)) {
50
- if ((0, generaltranslation_1.isSameLanguage)(key, locale)) {
51
- finalLocale = key;
52
- break;
53
- }
54
- }
55
- this.localeCache.set(locale, finalLocale);
56
- }
57
- }
58
- // If no valid finalLocale is found, return null
59
- if (!finalLocale || !this.translations[finalLocale]) {
60
- return null;
61
- }
62
- // Fetch the dictionary and cache the result
63
- const fetchPromise = this._fetchDictionary(finalLocale);
64
- this.fetchPromises.set(locale, fetchPromise);
65
- const retrievedDictionary = yield fetchPromise;
66
- this.fetchPromises.delete(locale);
67
- if (retrievedDictionary) {
68
- this.dictionaryMap.set(locale, retrievedDictionary);
69
- }
70
- return retrievedDictionary;
71
- });
72
- }
73
- /**
74
- * Fetches a dictionary from the translations object using the provided function.
75
- * @param {string} locale - The locale of the dictionary.
76
- * @returns {Promise<Record<string, any> | null>} The fetched dictionary data or null if not found.
77
- */
78
- _fetchDictionary(locale) {
79
- return __awaiter(this, void 0, void 0, function* () {
80
- try {
81
- const loadDictionary = this.translations[locale];
82
- if (!loadDictionary)
83
- throw new Error(`No translation function for locale: ${locale}`);
84
- const dictionary = yield loadDictionary();
85
- return dictionary;
86
- }
87
- catch (error) {
88
- console.error(`Error loading dictionary for locale ${locale}:`, error);
89
- return null;
90
- }
91
- });
92
- }
93
- }
94
- exports.default = LocalDictionaryManager;
95
- //# sourceMappingURL=LocalDictionaryManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LocalDictionaryManager.js","sourceRoot":"","sources":["../../../src/config/LocalDictionaryManager.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAoD;AAEpD;;;GAGG;AACH,MAA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C9C,CAAC;YACL,CAAC;YAED,gDAAgD;YAChD,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;gBAClD,OAAO,IAAI,CAAC;YAChB,CAAC;YAED,4CAA4C;YAC5C,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;YACxD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAE7C,MAAM,mBAAmB,GAAG,MAAM,YAAY,CAAC;YAC/C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAElC,IAAI,mBAAmB,EAAE,CAAC;gBACtB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,mBAAmB,CAAC;QAC/B,CAAC;KAAA;IAED;;;;OAIG;IACW,gBAAgB,CAAC,MAAc;;YACzC,IAAI,CAAC;gBACD,MAAM,cAAc,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;gBACjD,IAAI,CAAC,cAAc;oBAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,MAAM,EAAE,CAAC,CAAC;gBACtF,MAAM,UAAU,GAAG,MAAM,cAAc,EAAE,CAAC;gBAC1C,OAAO,UAAU,CAAC;YACtB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,uCAAuC,MAAM,GAAG,EAAE,KAAK,CAAC,CAAC;gBACvE,OAAO,IAAI,CAAC;YAChB,CAAC;QACL,CAAC;KAAA;CACJ;AApFD,yCAoFC"}
@@ -1,59 +0,0 @@
1
- /**
2
- * Configuration type for RemoteDictionaryManager.
3
- */
4
- type RemoteDictionaryConfig = {
5
- cacheURL: string;
6
- projectID: string;
7
- };
8
- /**
9
- * Manages remote dictionaries for translation purposes.
10
- */
11
- export declare class RemoteDictionaryManager {
12
- private config;
13
- private dictionaryMap;
14
- private fetchPromises;
15
- private requestedTranslations;
16
- /**
17
- * Creates an instance of RemoteDictionaryManager.
18
- */
19
- constructor();
20
- /**
21
- * Sets the configuration for the RemoteDictionaryManager.
22
- * @param {Partial<RemoteDictionaryConfig>} newConfig - The new configuration to apply.
23
- */
24
- setConfig(newConfig: Partial<RemoteDictionaryConfig>): void;
25
- /**
26
- * Fetches a dictionary from the remote cache.
27
- * @param {string} reference - The dictionary reference.
28
- * @returns {Promise<Record<string, any> | null>} The fetched dictionary or null if not found.
29
- */
30
- private _fetchDictionary;
31
- /**
32
- * Retrieves a dictionary based on locale and dictionary name.
33
- * @param {string} locale - The locale of the dictionary.
34
- * @param {string} dictionaryName - The name of the dictionary.
35
- * @returns {Promise<Record<string, any> | null>} The dictionary data or null if not found.
36
- */
37
- getDictionary(locale: string, dictionaryName: string): Promise<Record<string, any> | null>;
38
- /**
39
- * Sets a new entry in the specified dictionary.
40
- * @param {string} locale - The locale of the dictionary.
41
- * @param {string} dictionaryName - The name of the dictionary.
42
- * @param {string} key - The key for the new entry.
43
- * @param {string} [id=key] - The id for the new entry, defaults to key if not provided.
44
- * @param {any} translation - The translation value.
45
- * @returns {boolean} True if the entry was set successfully, false otherwise.
46
- */
47
- setDictionary(locale: string, dictionaryName: string, key: string, id: string | undefined, translation: any): boolean;
48
- /**
49
- * Marks a translation as requested for a given locale and dictionary
50
- */
51
- setTranslationRequested(locale: string, dictionaryName: string): void;
52
- /**
53
- * Checks if a translation has been requested for a given locale and dictionary
54
- */
55
- getTranslationRequested(locale: string, dictionaryName: string): boolean;
56
- }
57
- declare const remoteDictionaryManager: RemoteDictionaryManager;
58
- export default remoteDictionaryManager;
59
- //# sourceMappingURL=RemoteDictionaryManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RemoteDictionaryManager.d.ts","sourceRoot":"","sources":["../../../src/config/RemoteDictionaryManager.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED;;GAEG;AACH,qBAAa,uBAAuB;IAChC,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,aAAa,CAAmC;IACxD,OAAO,CAAC,aAAa,CAAmD;IACxE,OAAO,CAAC,qBAAqB,CAAuB;IAEpD;;OAEG;;IAWH;;;OAGG;IACH,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;IAI3D;;;;OAIG;YACW,gBAAgB;IAa9B;;;;;OAKG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAqBhG;;;;;;;;OAQG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,YAAM,EAAE,WAAW,EAAE,GAAG,GAAG,OAAO;IAQ/G;;OAEG;IACH,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAK9D;;OAEG;IACH,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO;CAK3E;AAED,QAAA,MAAM,uBAAuB,yBAAgC,CAAC;AAC9D,eAAe,uBAAuB,CAAC"}