JSON Key-Value

File extension: json

I18n type: KEYVALUEJSON

This format is used by many JavaScript frameworks such as AngularJS and applications. It's a JSON file, where every key is associated with a value (a nested JSON document, a nested list, or a translation string).

How we calculate each hash

At Transifex we use some special techniques to parse and compile JSON files. These techniques, unfortunately, lead to special treatment of a string's respective key. For example, if we were to use a 'flat' JSON file such as this:

Escape special characters

So, at this point you've probably noticed that . characters are important, very important. Therefore, if you wish to calculate the hash of a JSON string, you must escape all \ and . characters before calculating the hash. This can be achieved using an algorithm (Python) similar to the following: