Translation Collection Strings in SuiteCloud Projects
In SuiteCloud Development Framework (SDF), translated terms are stored in the SuiteCloud project as Translation Collection strings in XLIFF formatted files. Each translationcollection
object in the SuiteCloud project can optionally have one or more XLIFF (.xlf or .xliff) formatted file. A separate XLIFF file is used for each language.
Your translators can provide you with translated strings in XLIFF formatted files. The following example contains Spanish language translations for the custcollection_accommodation
Translation Collection:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="netsuite-database" source-language="en-US" target-language="es-ES" datatype="database">
<body>
<group collection="custcollection_accommodation">
<trans-unit id="FRONT_DESK">
<source>front desk</source>
<target>mostrador</target>
<note from="developer">The front desk of a hotel</note>
</trans-unit>
<trans-unit id="ACCOMMODATION">
<source>accommodation</source>
<target>alojamiento</target>
<note from="developer">The type of reservation.</note>
</trans-unit>
</group>
</body>
</file>
</xliff>
Each XLIFF file must meet the following requirements:
-
An XLIFF file can only be associated with a single
translationcollection
object, have a single target language, contain translations for that target language. -
Each XLIFF file must meet the XLIFF 1.2 Specification.
-
Each XLIFF file must be UTF–8 encoded.
-
Each XLIFF file must specify a target language.
-
For each XLIFF file, the target language must be different than the source language.
-
All XLIFF files must be located in the Translations directory at the root of the SuiteCloud project. If the Translations directory is needed and does not exist, create it. The Translations directory is not required when there are no XLIFF files are included with the
translationcollection
objects in the SuiteCloud project.
The path to the XLIFF file must be added to the deploy.xml
file. The asterisk (*) wildcard can be specified in the path to specify multiple files, but files in the Translation directory without the .xlf and .xliff file extensions are not included in deployment and do not appear in the deployment log. The following example adds the path to an XLIFF file containing Spanish language translations for the custcollection_accommodation
Translation Collection:
<deploy>
...
<translationimports>
<path>~/Translations/accommodation_es_ES.xlf</path>
</translationimports>
...
</deploy>
Consider the following information regarding translation string validation:
-
SuiteCloud project validation includes validation for translation string length. A validation error is returned when the string does not satisfy field length constraints for the field referencing the string. Consider the following information regarding string length validation:
-
When a translation string is referenced by multiple SDF custom objects, the length constraint is derived from both the minimum length and maximum length allowed for all fields on all objects referencing that string.
For example, if field A has a maximum length of 50 and field B has a maximum length of 20, then the following is true for a translation string with length of 30:
-
Field A referencing the translation string passes validation.
-
Field B referencing the translation string returns a validation error stating that the maximum length is 20.
-
-
The string length validation is run on all translation strings in the SuiteApp regardless of the default language of the account.
-
The string length validation is run as an account specific validation due to the re-use of terms, which includes object references that exist in the account and do not exist in the SuiteApp.
-
-
SuiteCloud project validation includes validation of translation strings for fields with uniqueness constraints. A validation error is returned when the uniqueness constraint for a field is not satisfied by the translation strings in the default language. Consider the following information regarding field uniqueness constraint validation:
-
The field uniqueness constraint validation compares the source string against both the name of the field of objects in the account and the value in the translation collection.
-
The field uniqueness constraint validation for translation strings is account-specific and only validated for the default language.
-
The XLIFF files can be omitted from the SuiteCloud project and added later in the target NetSuite account. For more information, see the following:
If no XLIFF files exist in the SuiteCloud project when it is deployed to an account, the files are still automatically created when exporting the Translation Collection from the account using the NetSuite UI. For more information, see Exporting a Translation Collection.