Changes between Version 2 and Version 3 of Internationalization


Ignore:
Timestamp:
Apr 13, 2014, 12:08:06 PM (10 years ago)
Author:
Adrián Chaves
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Internationalization

    v2 v3  
    1 
     1= Internationalizing GUI Files =
     2TODO
    23
     4= Internationalizing !JavaScript Files =
    35== Internationalizing Strings in !JavaScript ==
    46To internationalize a string in a 0 A.D. !JavaScript file, simply use the following global functions:
     
    3436TODO: sprintf.
    3537
    36 == Internationalizing Objects ==
     38= Internationalizing Data Files (JSON, TXT, XML) =
     39Internationalizing 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 ==
     45Our 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 ==
    3754TODO: translateObjectKeys