Skip to content

Codeunit wDCR_TranslationMgt

Provides functions to translate labels, tags and descriptions used in reports (or any other object) to another language. The translations are stored in table <see cref="wDCR_Translation" />. You can add new translations, retrieve existing translations, automatically have to-do translations created, have report-specific translations or use available helper functions to more easily retrieve translations of descriptions of records from tables in the base application. The behaviour of the functions can be changed through settings in the Document Creator Setup.

Properties

Name Value
Access Public

Methods

wgFncAddTranslation(Text[50], Code[10], Text[100])

Creates a new translation for a tag for a target language. If a translation already exists, then the translation is updated.

Parameters

Type Name Description
Text[50] pTag The text to translate.
Code[10] pLanguageCode The language code of the target language.
Text[100] pTranslation The new translation for the tag.

wgFncAddTranslation(Text[50], Code[10], Integer, Text[100])

Creates a new report-specific translation for a tag for a target language. If a translation already exists, then the translation is updated.

Parameters

Type Name Description
Text[50] pTag The text to translate.
Code[10] pLanguageCode The language code of the target language.
Integer pReportId The target report ID.
Text[100] pTranslation The new translation for the tag.

wgFncGetCountryRegionTranslation(Code[10]):Text[50]

Retrieves the translation for a Country/Region, if it exists. If the translation does not exist, it returns the name of the Country/Region. If the Country/Region does not exist, it returns the value of <paramref name="pCode" />.

Parameters

Type Name Description
Code[10] pCode Code of the Country/Region

Returns

Type Description
Text[50] Translation for the Country/Region

wgFncGetCountryRegionTranslation(Code[10], Code[10]):Text[50]

Retrieves the translation for a Country/Region, if it exists. If the translation does not exist, it returns the name of the Country/Region. If the Country/Region does not exist, it returns the value of <paramref name="pCode" />.

Parameters

Type Name Description
Code[10] pCode Code of the Country/Region
Code[10] pLanguageCode Code of the Language

Returns

Type Description
Text[50] Translation for the Country/Region

wgFncGetItemTranslation(Code[20], Code[10]):Text[100]

Retrieves the translation for an Item, if it exists. If the translation does not exist, it returns the name of the Item. If the Item does not exist, it returns the value of <paramref name="pNo" />.

Parameters

Type Name Description
Code[20] pNo Item No.
Code[10] pVariantCode Variant Code

Returns

Type Description
Text[100] Translation for the Item

wgFncGetItemTranslation(Code[20], Code[10], Code[10]):Text[100]

Retrieves the translation for an Item, if it exists. If the translation does not exist, it returns the name of the Item. If the Item does not exist, it returns the value of <paramref name="pCode" />.

Parameters

Type Name Description
Code[20] pNo Item No.
Code[10] pVariantCode Variant Code
Code[10] pLanguageCode Code of the Language

Returns

Type Description
Text[100] Translation for the Item

wgFncGetPaymTermsTrl(Code[10]):Text[100]

Retrieves the translation for a payment term to the target language (set through wgFncSetLanguageCode). If no translation is found, the description of the payment term is returned.

Parameters

Type Name Description
Code[10] pCode The code of the payment term.

Returns

Type Description
Text[100] The translation of the payment term.

wgFncGetPaymTermsTrl(Code[10], Code[10]):Text[100]

Retrieves the translation for a payment term to the specified target language. If no translation is found, the description of the payment term is returned.

Parameters

Type Name Description
Code[10] pCode The code of the payment term.
Code[10] pLanguageCode The language code of the target language.

Returns

Type Description
Text[100] The translation of the payment term.

wgFncGetShipmMethodTrl(Code[10]):Text[100]

Retrieves the translation for a shipment method to the target language (set through wgFncSetLanguageCode). If no translation is found, the description of the shipment method is returned.

Parameters

Type Name Description
Code[10] pCode The code of the shipment method.

Returns

Type Description
Text[100] The translation of the shipment method.

wgFncGetShipmMethodTrl(Code[10], Code[10]):Text[100]

Retrieves the translation for a shipment method to the specified target language. If no translation is found, the description of the shipment method is returned.

Parameters

Type Name Description
Code[10] pCode The code of the shipment method.
Code[10] pLanguageCode The language code of the target language.

Returns

Type Description
Text[100] The translation of the shipment method.

wgFncGetUnitOfMeaseTrl(Code[10]):Text[50]

Retrieves the translation for a unit of measure to the target language (set through wgFncSetLanguageCode). If no translation is found, the description of the unit of measure is returned.

Parameters

Type Name Description
Code[10] pCode The code of the unit of measure.

Returns

Type Description
Text[50] The translation of the unit of measure.

wgFncGetUnitOfMeaseTrl(Code[10], Code[10]):Text[50]

Retrieves the translation for a unit of measure to the specified target language. If no translation is found, the description of the unit of measure is returned.

Parameters

Type Name Description
Code[10] pCode The code of the unit of measure.
Code[10] pLanguageCode The language code of the target language.

Returns

Type Description
Text[50] The translation of the unit of measure.

wgFncSetLanguageCode(Code[10])

Sets the target language to retrieve translations.

Parameters

Type Name Description
Code[10] pNewLanguageCode The language code of the target language.

wgFncSetReportId(Integer)

Sets the target report to retrieve report-specific translations.

Parameters

Type Name Description
Integer pNewReportId The target report ID.

wgFncTranslate(Text[50]):Text[100]

Translates a text to the target language (set through wgFncSetLanguageCode). If a target report ID was set (through wgFncSetReportId) then the report-specific translation for the tag is retrieved. If no translation is found a To-do translation record is automatically created for the target language and default language code.

Parameters

Type Name Description
Text[50] pTag The text to translate.

Returns

Type Description
Text[100] The translation of the tag.

wgFncTranslate(Text[50], Code[10]):Text[100]

Translates a text to the specified target language. If a target report ID was set (through wgFncSetReportId) then the report-specific translation for the tag is retrieved. If no translation is found a To-do translation record is automatically created for the target language and default language code.

Parameters

Type Name Description
Text[50] pTag The text to translate.
Code[10] pLanguageCode The language code of the target language.

Returns

Type Description
Text[100] The translation of the tag.

wgFncExportTranslations(Text, Integer)

Exports translations for selected languages and report IDs, prompting the user for a location to save the file.

Parameters

Type Name Description
Text pLanguageCodeFilter The language code or filter of the target language.
Integer pReportId Identifier of a report

wgFncImportTranslations

Imports translations from the xlf or zip file specified by the user.