LocJSON Parser Plugin

Plugin source location: <serge_root>/lib/Serge/Engine/Plugin/parse_locjson.pm

This plugin is used to parse monolingual LocJSON files.

This is a validating parser. In case LocJSON format validation fails, the plugin can send an error report to specified recipients. If no email settings are provided, it will simply report the error in the console output.

Code Examples

products.locjson
{ "properties": { "comments": ["This file was generated by AwesomeTool"], }, "units": [ { "key": "welcomeMessage", "properties": { "comments": [ "{USER} is the first name of a signed in user" ] }, "source": [ "Hello, {USER}!" ] }, { "key": "signInButtonCaption", "properties": { "comments": [ "https://example.com/preview/sign-in.png" ] }, "source": [ "Sign In" ] }, { "key": "signInFooterText", "properties": { "comments": [ "This text is displayed below the sign in form.", "https://example.com/preview/sign-in.png" ] }, "source": [ "Please read our <a ", "href=\"https://example.com/legal/pp\">Privacy ", "Policy</a> and <a ", "href=\"https://example.com/legal/tos\">Terms of ", "Service</a>" ] } ] }

Please see the example configuration file below to learn why only title and certain description nodes are extracted here for translation.

Usage

example-project.serge