Closed osnoser1 closed 6 years ago
When you say store the language that was used, do not you mean the initial keys? That is, it should not be necessary to store the previous language.
The initial keys can be stored either in the localized attribute or some additional attribute.
With stored keys can be mapped through the dictionary of the new language.
Sorry for the delay in answering.
no by language i mean the localized flag that gets set on nodes that were translated - to avoid new translation on that if eg. a new node was added to the dom which (as not has localized attribute) needs translation => so setting eg. localized='de' and switching lng to 'en' we recognize that node needs translation again to the new language.
But yes...you're right also we would have to store the initial value of the node, incl. attributes like placeholder,...
Overall a lot of changes - not saying not possible - but for sure a lot of work to get that right again.
closing this for now...while i would love this - i think it's to much effort currently....but would accept a PR enabling this anytime.
might be possible. would need some bigger changes...would need to store the language that was used instead of storing localized=true on every element. So we could trigger a rerender here (https://github.com/i18next/i18nextify/blob/master/src/index.js#L182) like:
plus change all https://github.com/i18next/i18nextify/blob/master/src/index.js#L153 to some check against value !== new language
not sure i would go this path...