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

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

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

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

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

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

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

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

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

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

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

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

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

Sets the target language to retrieve translations.

Parameters

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

wgFncSetLanguageCode

Sets the target language to retrieve translations.

Parameters

Type Name Description
Integer pNewLanguageID The (LC)ID of the target language.

wgFncSetReportId

Sets the target report to retrieve report-specific translations.

Parameters

Type Name Description
Integer pNewReportId The target report ID.

wgFncTranslate

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

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.