LRM JSON Support

From Lingoport Wiki
Revision as of 21:59, 16 September 2016 by Olibouban (talk | contribs) (Sample LRM Project Definition File for .json)
Jump to: navigation, search

LRM supports .json files which makes sense for translation. Not all .json files do.

Sample LRM Project Definition File for .json

{
 "site_heading": "Where can I find more information on the site?",
 "site_subHeading2": "Search",
 "enableGeo": "Enable location services in your browser to load local help results.",
 "findButton": "Find",
 "gettingStarted_title": "Getting Started",
 "gettingStarted_subHeading": "Here are the main things you need to know as you
get started.",
 "logging_off_account": "Log off"
}

Example of Supported .json Files

Simple is Best

If you want complexity

Caveat JSON structure changes can lead to problems with project on-boarded for file deltas (v. Full Files).

Example of a Non-Supported .json File

In what format should JSON Files be for LRM Handling ?

JSON extension is supported in The Lingoport Manager (LRM) 2.1 release. Well-formed JSON is required and specified by http://www.ietf.org/rfc/rfc4627.txt. In order to detect and import changes, LRM 2.1 requires JSON files to also adhere to the following standards.

  • The json files must follow this naming convention: filename_<locale>.json or filename_<locale>_<country>.json. For example, resources_en.json or resources_en_US.json, resources_fr.json or resources_fr_FR.json, etc.
  • If you can, avoid duplicate file names. Duplications incur more prep kits than necessary.
  • Arrays are not allowed in the context of JSON files as resource bundles. String references in the code, from an i18n point of view, is unmanageable for JSON arrays. In addition, many L10n vendors do not support JSON arrays. (Sample JSON files are located in LRM-Server-2.1/samples/JSON_Examples):
  • There is only one key/value per line.
    • Valid
      • "key1":"This is my value for key1",
      • "key2":"This is my value for key2"
    • Invalid
      • "key1":"This is my value for key1","key2":"This is my value for key2"
  • End-object character (curly bracket) may not exist on the same line as a key/value.
    • Valid
      • "keys": {
      • "key1":"This is my value for key1"
      • }
    • Invalid
      • "keys": {
      • "key1":"This is my value for key1"}
  • Values associated with a key must be a string. Numeric and boolean values are not allowed.
    • Valid
      • "key1":"0"
    • Invalid
      • "key1":0
      • "key1": true