In this window, you can choose how memoQ imports JSON files. This format is used in the localization of interactive websites as well as software products.
JSON stands for Java Script Object Notation. It's a text-based open standard and also a data-interchange format. JSON is easy to read and write for machines. It's based on a subset of the Java Script Programming Language.
JSON is used for serializing and transmitting structured data over a network connection (mainly to transmit data between a server and a web application). It is used as an alternative to XML.
JSON is a text format that is completely language-independent. It uses the syntax of the C-family programming languages such as C, C++ or C#.
The default character encoding for JSON is UTF-8, but JSON also supports UTF-16 and UTF-32.
To learn more about JSON: Click here (the link is available at the time of writing).
There are two types of JSON files. It's either a collection of name-value pairs of objects, or an ordered list of values.
memoQ uses the name-value pairs: memoQ imports the object name as context and the value as source text.
How to get here
1.Start importing a JSON document.
2.In the Document import options window, select the JSON documents, and click Change filter and configuration.
3.The Document import settings window appears. From the Filter drop-down list, choose JSON filter.
What can you do?
Choose the input encoding if necessary
Normally, memoQ detects the input encoding automatically.
If this doesn't work, clear the Automatically detect input encoding if possible check box. From the Select input encoding list, choose an encoding.
Always check if the text in Preview box appears correctly. Check thoroughly if every character is correct.
Choose the output encoding if necessary
Normally, memoQ exports the translation in the same encoding as in the input file.
If the input file isn't Unicode (e.g. UTF-8), and the target language has a different script, this isn't possible. When this happens, clear the Same as input check box. From the Select output encoding drop-down box, choose an encoding.
Don't clear the Write BOM for unicode encoded files at export check box. For the system that uses the translation, this may be required to recognize the correct encoding.
Get the context right - if there are nested blocks
Many JSON files have multiple nested blocks that look like this:
Normally, memoQ imports the name of the entry (the first part before the colon) as the context of the segment. But if the entry is part of a larger block (or several nested larger blocks), this context will not be unique. In this case, you can't efficiently use the name of the entry as the context. You need the entire 'path' of the entry, such as "Common"."metricCharacters".
To set this up, use the check boxes on the Context tab:
•To get all the context information there is: Check the Concatenate key structure into a single context ID check box.
•To add an even larger context, like a project or a document: Check the Add this text to the beginning of each context ID check box, and type the context label in the text box below it. You can invent this freely: the point is to make the context identifiers as unique as possible, so that you don't get false context matches from translation memories.
Fine-tune the JSON import - import only those keys that need translation
JSON files are used to describe data in general, similarly to XML files. Most of the time, a key - an item or an entry or a structure - in a JSON file is not text. It can be a number, a date, another data type, or a complex structure of further data.
If you need to translate text in a complex JSON file, you need to be able to extract translatable text.
To do this, use the Key options tab:
The exact logic is still to be determined.
When you finish
To confirm the settings, and return to the Document import options window: Click OK.
To return the Document import options window, and not change the filter settings: Click Cancel.
If this is a cascading filter, you can change the settings of another filter in the chain: Click the name of the filter at the top of the window.
In the Document import options window: Click OK again to start importing the documents.