36 | | == Internationalizing Objects == |
| 38 | = Internationalizing Data Files (JSON, TXT, XML) = |
| 39 | Internationalizing strings from data files that are loaded by !JavaScript files is a two-step process. You must: |
| 40 | |
| 41 | 1. Configure the [wiki:Implementation_of_Internationalization_and_Localization#MessageExtractionSystem message extraction system] to extract the strings to translate from the data file. |
| 42 | 1. Use an internationalization function on the !JavaScript side after you load the data file. |
| 43 | |
| 44 | == Configuring the Message Extraction System for Regular XML Files == |
| 45 | Our message extraction system currently supports extracting data strings from: |
| 46 | |
| 47 | * '''Plain text files (.txt)'''. The content of plain text files can be extracted line by line. Paragraphs in these plain text files should not contain line breaks, otherwise each line is extracted as a separate message, which is not translator-friendly. |
| 48 | * '''JSON files'''. You can extract strings associated with a specific key or keys of any object in a given JSON file. |
| 49 | * '''XML files''', where you can extract: |
| 50 | * The content of specific elements (start and end tags). Currently, however, you cannot extract the value of an attribute of an XML element. For example, in `<PropertyName AttributeName="AttributeValue>PropertyValue</PropertyName>` you can extract "!PropertyValue" but you cannot extract "!AttributeValue". |
| 51 | * Strings from JSON data defined within an XML element. |
| 52 | |
| 53 | == Internationalizing Content that !JavaScript Files Load from Regular XML Files == |