import { MtnaI18nDefaultOptions, MtnaI18nLanguageOption, MtnaI18nString, MtnaLanguageIds, MtnaLocaleId, MtnaLocaleIds } from '../models'; import { MtnaI18nGenericService } from './i18n-generic.service'; import * as i0 from "@angular/core"; export declare class MtnaI18nService extends MtnaI18nGenericService { constructor(_locale: string, _defaults?: MtnaI18nDefaultOptions); /** * Generates an array of internationalized strings from a list of available languages. * If no languages are provided, returns an array with 1 empty object. * @param options The available languages that can be generated * @param langPropName The property name matching the locales * @returns An array of default internationalized strings * @remarks the internationalized strings contain only the language property, no value properties */ createEmptyI18nStrings(options?: MtnaI18nLanguageOption[], langPropName?: string): MtnaI18nString[]; /** * Generates an internationalized string for the current locale & sets the value, if provided. * @param value A string value to set on the value property of the internationalized string. Defaults to empty string if not provided. * @returns An internationalized string for the current locale */ createI18nStringForDefaultLocale(value?: string | null): MtnaI18nString; /** * Extracts a string value from an internationalized string that matches the default locale. * If none match the locale, extracts from the i18n string with no defined language property, if it exists. * * @param i18nStrings The internationalized strings to search for a matching language * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the string value for the default locale. */ getDefaultI18nValue(i18nStrings: MtnaI18nString[] | null | undefined, langPropName?: string, valuePropName?: string): string | undefined; /** * Extracts a string value from an internationalized string that matches a specific locale ID. * If none match the locale, extracts from the i18n string with no defined language property, if it exists. * * @param localeId The specific locale ID to extract, i.e. en-US * @param i18nStrings The internationalized strings to search for a matching language * @param fallbackToEmptyLanguage Whether to fall back to an i18n string without a defined language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the string value for the specified locale */ getI18nValue(localeId: typeof MtnaLocaleIds.type | null | undefined, i18nStrings: MtnaI18nString[] | null | undefined, fallbackToEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): string | undefined; /** * Get all the i18n strings that don't match a given localeId. * * @param localeId The specific locale ID to filter out, i.e. en-US * @param i18nStrings The internationalized strings to filter * @param includeEmptyLanguage Whether to include i18n strings without a specified language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the {@link MtnaI18nString}s that don't match the given `localeId` */ getOtherI18nStrings(localeId: typeof MtnaLocaleIds.type, i18nStrings: MtnaI18nString[] | null | undefined, includeEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): MtnaI18nString[]; /** * Given all the language options an application supports, * transform it into a unique array of language IDs. * * @param options all the i18n language options for an app * @returns a unique array of language IDs */ getUniqueLanguageIdsFromOptions(options: MtnaI18nLanguageOption[]): Array; /** * Sets a string value on the internationalized string that matches the default locale, or has no locale. * If none match the conditions, appends a new i18n string for the default locale with the provided value. * @param newValue The value to set on the i18n string; Defaults to empty string if null or undefined. * @param i18nStrings The array of i18n strings for a given property * @returns An array of all provided i18n strings, with the new value set where relevant. */ setDefaultI18nValue(newValue: string | null | undefined, i18nStrings: MtnaI18nString[] | null | undefined): MtnaI18nString[]; /** * Sets a string value on the internationalized string that matches the provided locale. * If none match the locale, creates a new internationalized string with the locale. * @param newValue The value to set on the internationalized string * @param localeId The specific locale ID to update, i.e. en-US * @param i18nStrings The internationalized strings to search for a matching language * @param fallbackToEmptyLanguage Whether to fall back to an i18n string without a defined language, defaults to false. * @param langPropName the name of the language property * @param valuePropName the name of the value property * @returns the internationalized strings with relevant language updated/added */ setI18nValue(newValue: string | null | undefined, localeId: MtnaLocaleId, i18nStrings: MtnaI18nString[] | null | undefined, fallbackToEmptyLanguage?: boolean, langPropName?: string, valuePropName?: string): MtnaI18nString[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }