Smartling

From Lingoport Wiki
Jump to navigation Jump to search

Smartling Configuration

[Admin]

To reach the Smartling configuration from Command Center, first go to the Settings page, set the Maintenance Mode, select the card for the Translation Management Systems & Machine Translation. On the TMS page, you will see a number of option: Click the Smartling card.

Smartling ID

the first part of the configuration requires identifiers from your Smartling account:

  • User ID
  • Secret Key
  • Project ID

In addition, an API user (See the Settings > Users and Teams card) is required to accept callbacks from Smartling.

Location of files on disk

Next, we recommend using the following by default. This can be changed for multiple instances of a Smartling connection. Pick the rate of import schedule. In the example below, Localyzer will check every 2 hours for new translations coming back from Smartling.

Optional Context Server

One option here is to add a Context Server (See: About InContext Translation )



Smartling Locale Codes

The Locale codes in Smartling were created based on Smartling published list. In case new locales are added by Smartling, you may want to add them here. Typically, one would not change anything here and simply click Next.

Connection Naming

Finally, name the TMS configuration for Smartling.


Smartling Usage

Now that a Smartling configuration is created, projects can use it. It is part of the basic Localyzer project configuration as shown below.

Smartling Directives

Smartling allows for directives when file formats require handling outside of the default one. Please contact Smartling when setting up directives for your files. Localyzer sends the directives via the Smartling API and overwrite Project Level Directives on the Smartling instance side. Directives configured on the Localyzer side must be formatted in a correct JSON file.

The following are links to directive documentation based on the file type:

LRM Supported Types:

Some of the directives are handled directly by Lingoport Localyzer and will overwrite other directives. Those are:

  • namespace
  • yaml_locale_substitution for YAML
  • exclude_path is a special case. For JSON, Lingoport must handle that directive in a precise way. See below.

Without a directive file for a file type, Smartling will handle files by default.

Some directives, such as the following, are ignored and not passed via the API:

  • fileUri
  • file

Contact Smartling support to ensure the correctness of the directives.

Directive files are added by file type (JSON, resx, etc.). For instance, for a Localyzer project sending JSON file may have this file:

smartling_json_directives.json

{
    "string_format": "icu",
    "translate_paths": {
      "instruction": "*/description",
	  "key": "{*}/message",
	  "path": "*/message",
     },
     "variants_enabled": "true"
}

exclude_path & translate_paths

Localyzer Directive Files may include translate_path attributes. 

  • For XML Directive files the translate_paths directive value  will be ignored. Smartling handles Android-XML and Resx files. For custom XML parser, LRM will set the translate_paths directive value.
  • Localyzer handles exclude_path for JSON files.


Example:

If a Localyzer Directive file is configured as follows:

"translate_paths" : [
      {
        "path" : "/nodes/*",
        "exclude_path" : "*/comment"
      },
      {
        "path" : "/messages/*",
        "exclude_path" : "*/note"
      }
    ] 

The actual data passed via the API will include the Localyzer specific exclude_path:

"translate_paths" : [
      {
        "path" : "/nodes/*",
        "exclude_path" : "*/comment"
      },    
      {
        "path" : "/nodes/*",
        "exclude_path": "_*"
      },
      {
        "path" : "/messages/*",
        "exclude_path" : "*/note"
      },
      {
        "path" : "/messages/*",
        "exclude_path": "_*"
      }
    ]

If the exclude_path is not configured in the Localyzer directive, as follows:

"translate_paths" : [
      {
        "path" : "/nodes/*",
        "instruction": "*/description"
      }
    ] 

The actual data passed via the API will include an exclude_path directive:

"translate_paths" : [
      {
        "path" : "/nodes/*",
        "instruction": "*/description",
        "exclude_path": "_*"
      }
    ]

Smartling and Context

Depending on the type of files and the parsing/filtering of those file types, instructions with the InContext server links may appear above the string to translate in the Smartling translation workbench.

Below is an example when a properties file with context for each of the strings to translate has been captured. As one navigates to the next line, the yellow instruction shows a link to click to view the context, here for the Payment Method of our demonstration application.