Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Track changed key in I18n JSON

Avatar

Level 4

Hello there,

 

Recently we have converted our i18n translator nodes to JSON for the performance improvement. We have seen the performance improvement for the same.

Now, We are unable to find the last modified by for the individual key(like we had it on node).

Is there any way in JSON to track the changes at key level.

i.e. Last modified by for the key level.

Your suggestions are much appreciated.

Thanks

Nanda

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi,

so you need to track the changes in order to debug any problems? Sounds a bit scary ... Is it possible to continue to use your node-based approach (as did before) and export the complete i18n nodes into a JSON when a node has changed? So you could use the old approach to keep track of changes and the new one to improve performance.

Jörg

View solution in original post

4 Replies

Avatar

Level 5

Didn't understand your question, sounds like you are trying to get the value in the JSON for any particular key ?

 

Object.keys(myVar).forEach(function(k) {if(k === "typeA") {// do stuff}else if (k === "typeB") {// do more stuff}else {// do something}});

Avatar

Employee Advisor

Hi,

how do you maintain your i18n translations on your systems? Do you directly modify them on production? Is it part of your authoring process? And why is the last modification of individual keys important to you?

If it isn't a party of your authoring processes and workflows, I would store the JSON file always in version control system and deploy it along with your code; and then you can easily track the changes.

Jörg

Avatar

Level 4

Hi Jörg,

We are not maintaining the I18N JSON in the version control system. We have huge number of keys and on each release author may add/modify the keys. We have more number of release cycle which caused the conflicts in i18n json.So we have decided to not to maintained it in version control system

They will change the I18N values as part of authoring process. Author will change the values directly in production environment. 

Why to track the changes?

Say on particular release author has changed few existing keys with wrong values which break the functionality in the production.In the JSON approach, we can track the changes at language level. We cannot track the changes at the key level like the changes can be easily track in i18n node approach.How can we track the changes for this scenario?

Thanks

Nanda

Avatar

Correct answer by
Employee Advisor

Hi,

so you need to track the changes in order to debug any problems? Sounds a bit scary ... Is it possible to continue to use your node-based approach (as did before) and export the complete i18n nodes into a JSON when a node has changed? So you could use the old approach to keep track of changes and the new one to improve performance.

Jörg