IRdsDictionaryTranslations.Locale

Syntax

Locale(Index: Integer): LocaleCodeID;

Parameters

Index. Index of a setting in the collection.

Description

The property is read-only.

The Locale property returns unique numeric identifier of the language, for which a setting with the specified index is meant.

Comments

A value of the Index parameter must be a non-negative number but smaller than the value of the IRdsDictionaryTranslations.Count property. Index of the first method in the collection is 0, index of the last one is IRdsDictionaryTranslations.Count - 1. Index numbering is continuous.

Example

Executing the example requires an MDM repository that contains the MDM dictionary. The repository identifier is RDS_REPO, the dictionary identifier is RDS_DICT. It is also necessary to add links to the Metabase and Rds system assemblies.

Sub UserSub;
Var
    Mb: IMetabase;
    RdsRepoDescr: IMetabaseObjectDescriptor;
    RdsDict: IRdsDictionary;
    DictTransl: IRdsDictionaryTranslations;
    Locale: LocaleCodeID;
Begin
    Mb := MetabaseClass.Active;
    RdsRepoDescr := Mb.ItemById("RDS_REPO");
    RdsDict := Mb.ItemByIdNamespace("RDS_DICT", RdsRepoDescr.Key).Edit As IRdsDictionary;
    DictTransl := RdsDict.Translations;
    If DictTransl.Count > 2 Then
        Locale := DictTransl.Locale(DictTransl.Count - 1);
        If DictTransl.RemoveByLocale(Locale) Then
            Debug.WriteLine(Removal completed successfully);
        End If;
    End If;
    (RdsDict As IMetabaseObject).Save;
End Sub UserSub;

After executing the example, the identifier of language for the last setting in the collection is obtained. Then this setting is removed. If removal has been completed successfully, a message is displayed in the console window.

See also:

IRdsDictionaryTranslations