Closed tortuetorche closed 4 years ago
The dot in the key name is not yet supported. Thinking about the best way to implement it. This feature will be available soon,
Alright, I'll send you a pull request of a possible solution, feel free to review it 👍
With pleasure,
Expected behavior
Javascript running in the web console:
Current behavior
Javascript running in the web console:
Versions
Translations
resources/lang/fr.json
:Comments
I think the root of this issue is here: https://github.com/GENL/matice/blob/50c08a0c12643bd8077e006e1aa9100e1445db87/src/js/Localization/core.ts#L195
Possible solution
With the help of a new boolean parameter (e.g
splitKey
ornoSplit
) for theLocalization::findSentence()
method, if an error occurs, we should fallback toconst parts = [key]
instead ofconst parts = key.split('.')
via thesplitKey
ornoSplit
flag parameter.Here a possible patch (need some tests) for the
src/js/Localization/core.ts
file: