Theia API Documentation v1.65.0
    Preparing search index...
    • Marks a string for localization. If a localized bundle is available for the language specified by env.language and the bundle has a localized value for this message, then that localized value will be returned (with injected args values for any templated values).

      Parameters

      • message: string

        The message to localize. Supports index templating where strings like {0} and {1} are replaced by the item at that index in the args array.

      • ...args: (string | number | boolean)[]

        The arguments to be used in the localized string. The index of the argument is used to match the template placeholder in the localized string.

      Returns string

      localized string with injected arguments.

      `l10n.t('Hello {0}!', 'World');`
      
    • Marks a string for localization. If a localized bundle is available for the language specified by env.language and the bundle has a localized value for this message, then that localized value will be returned (with injected args values for any templated values).

      Parameters

      • message: string

        The message to localize. Supports named templating where strings like {foo} and {bar} are replaced by the value in the Record for that key (foo, bar, etc).

      • args: Record<string, any>

        The arguments to be used in the localized string. The name of the key in the record is used to match the template placeholder in the localized string.

      Returns string

      localized string with injected arguments.

      `l10n.t('Hello {name}', { name: 'Erich' });`
      
    • Marks a string for localization. If a localized bundle is available for the language specified by env.language and the bundle has a localized value for this message, then that localized value will be returned (with injected args values for any templated values).

      Parameters

      • options: {
            args?: (string | number | boolean)[] | Record<string, any>;
            comment: string | string[];
            message: string;
        }

        The options to use when localizing the message.

        • Optionalargs?: (string | number | boolean)[] | Record<string, any>

          The arguments to be used in the localized string. As an array, the index of the argument is used to match the template placeholder in the localized string. As a Record, the key is used to match the template placeholder in the localized string.

        • comment: string | string[]

          A comment to help translators understand the context of the message.

        • message: string

          The message to localize. If args is an array, this message supports index templating where strings like {0} and {1} are replaced by the item at that index in the args array. If args is a Record<string, any>, this supports named templating where strings like {foo} and {bar} are replaced by the value in the Record for that key (foo, bar, etc).

      Returns string

      localized string with injected arguments.