Server Administration > Configuration Localization Overview > Exporting and Importing Translations
Exporting and Importing Translations
The display name and description attributes for the Fields, Test Result Fields, Types, and States administrative objects are available for translations. For overridden fields and states, only the description attribute is available for translations. You can export the available values of the administrative objects and import the translation strings. However, permissions are required to export and import the translations.
* 
The export and import operations should be performed on the same server. If the servers are different, you must confirm the server and the port. If the AdminObjectTypeId, AdminObjectId, Name, and AdminTypeId values match in the server data, then the translations are imported in the database. However, it may cause data corruption.
Once the translation changes are imported, they can be migrated to a locked server by initiating the Admin Migration Wizard. These changes are identified as field changes that can have type changes associated with them.
Verifying User Permissions
To verify that a user has permissions to export and import the translations for specific administrative objects, use the following command from the CLI:
Example for field: im viewfield --user=typeAdmin --password=password field1
If the details are visible, it verifies that the user type Admin has the required permissions to export and import the translations for the field field1.
Exporting Translations
The export translations feature allows you to export the values of display name and description for the administrative objects. You can export all the available translations by locale. You can set a source locale (optional) and a target locale as part of the export command. You can also selectively export administrative objects to obtain the translations. Export can be done even when translations are not available for the attributes, as it is not bound by the localization property.
* 
Export translations can be done on a locked server.
You can export translations for the following administrative objects:
Fields
Test Result Fields
Types
States
To Export Translations
From the CLI, use the following command:
im exporttranslations --adminType=value --targetLocale=value --outputFile=value [--no|confirm]overwriteOutputFile --sourceLocale=value --user=name --password=password --hostname=server --port=number selection
Where:
--adminType—The field value that specifies the name of the administrative object, such as Field, Type, and State, to be exported.
--sourceLocale—The locale for which translated strings are available.
--targetLocale—The locale for which translations are required.
--hostname—The name of the host server where the PTC RV&S server is located.
--port—The port on the host server where thePTC RV&S server is located.
--outputFile—The path and name of the XML file to export the translations to.
[no|confirm]overwriteOutputFile—Use the following settings:
--[no]confirm—Specifies if to confirm deletion to overwrite the file. The default is to confirm.
selection—A set of multiple administrative object and its relevant instance, separated by a colon, such as Field:field1. When we have multiple sets, they are separated by space.
* 
If you use only overwriteOutputFile, the file is overwritten without asking for permission.
Use either the option adminType or the selection, such as Field:field1. If you use both, then an error message appears, indicating that the --adminType option is incompatible with an administrative object selection. If you do not provide either of these then, all the supported administrative objects are exported.
Examples
The following example explains how the command with adminType option works:
im exporttranslations --adminType=field --sourceLocale=en --targetLocale=de --hostname=localhost --port=7001 --outputFile=export.xml --confirmoverwriteOutputFile
This command exports the administrative object Field for the German as the target locale for which the source locale is English, and asks for confirmation before overwriting the administrative objects with the output file export.xml when the same output file exists at the same location.
The following example explains how the command with selection works: im exporttranslations--sourceLocale=en --targetLocale=de --hostname=localhost --port=7001 --outputFile=export.xml --confirmoverwriteOutputFile Field:Field1 Field:Field2 State:State1 Type:Type1
This command exports the translations for the administrative objects: Field (Field1, Field2), State(State1) and Type (Type1).
* 
If the outputfile option is not set, the file is created in the current working directory and is named as IntegrityTranslations_<timestamp>.xml.
The following example explains how the file is created in the current working directory:
im exporttranslations --adminType=field --sourceLocale=en --targetLocale=de --hostname=localhost --port=7001
This command exports the administrative object: Field, for German as target locale for which the source locale is English, in the current working directory with the file name as IntegrityTranslations_{timestamp}.xml.
Importing Translations
You can import the translations of display name and description for the administrative objects for the locale. The import translations feature allows you to import the translation strings for a locale, one locale at a time, and it is not bound by the localization property.
* 
Import translations cannot be done on a locked server.
You can import the translations for the attributes display name and description for the following administrative objects:
Fields
Test Result Fields
Types
States
To Import Translations
From the CLI, use the following command:
im importtranslations --inputFile=value --user=name --password=password --hostname=server --port=number
Where:
--hostname—The name of the host server where the PTC RV&S server is located.
--port—The port on the host server where the PTC RV&S server is located.
--inputFile—The name of the XML file that contains the translations to be imported.
For example, the command:
im importtranslations --hostname=localhost --port=7001 --inputFile==D:\Import\Importtranslations.xml Imports the translations for which the input file is located at D:\Import\Importtranslations.xml.
The XML file can be manually edited. The tags are case-sensitive and use the following sequence for the main tags. If the sequence is not followed, it results in an error in importing translationsstating that invalid content was found and does not import any of the translations.For more information about determining IDs of AdminObjectTypeId, AdminObjectId, Name, and AdminTypeId, see the CLI man pages for the im fields and im types commands.
The sequence for the tags is as follows:
ServerDetails— Provides information of the server from which the file is exported or is imported into. All the elements are required in this section.
TranslationData—Provides information about the translation data for the administrative objects.
OverrideTranslationData—Provides information about the translation data for the administrative object override attributes.
ServerDetails
Tags
Description
HostName
Hostname for the PTC RV&S server.
Port
Port for the PTC RV&S server.
ExportedDate
File export date.
UserName
User who exported or imported the translations.
SourceLocale
The source locale of the translations <SourceValue> or <SourceOverrideValue> have the data in this locale.
TargetLocale
The target locale of the translations <TargetValue> or <TargetOverrideValue> have the data in this locale.
TranslationData
Tags
Description
AdminObjectTypeId
Each object in PTC RV&S is identified by its type. The values are: field = 1, state = 2, project = 3, user = 4, group = 5, type = 6
These values must be same while importing and exporting.
AdminObjectId
Unique ID of the administrative object of the particular type.
Name
Name attribute of the administrative object. The server uses this element value for verification. If it does not match, the import command results in an error.
Attribute
The attribute that is localized (Display Name or Description).
SourceValue
The source value for the attribute on the server.
* 
This element value can be blank.
TargetValue
The target value for the attribute which needs to be imported in case of import operation, or the existing value for the target locale which is there on server during the export operation.
* 
If the display name value is blank, it results in an error.
If the description value is blank, the value is set to blank on the server.
OverrideTranslationData
Tags
Description
AdminObjectTypeId
Each object in PTC RV&S is identified by its type. Currently only field and state can be overridden in a type where the field or state is used. The values are: field = 1, state = 2
These values must be same while importing and exporting.
AdminObjectId
Unique ID of the administrative object of a particular type.
Name
Name attribute of the administrative object. The server uses this element value for verification. If it does not match, the import command results in an error.
Attribute
The override attribute which is localized. (At present, only description.)
AdminTypeId
Unique ID of the Type object on which the attribute is overridden.
SourceOverrideValue
The source value for the overridden attribute which is there on the server.
* 
This element value can be blank.
TargetOverrideValue
The target value for the overridden attribute that needs to be imported during the import operation, or the existing value for the target locale which is there on the server during the export operation.
* 
If the description value is blank, the value is set to blank on the server.
Was this helpful?