import type { LanguageResources } from "@vertigis/arcgis-extensions/LanguageResources"; import type { FormatSettings } from "@vertigis/arcgis-extensions/support/FormatSettings"; import type { MeasurementSystem, RegionModelProperties } from "@vertigis/viewer-spec/app-config/common/RegionModelProperties"; import type { TranslatableText } from "@vertigis/viewer-spec/app-config/common/TranslatableText"; import type { LanguageManifest } from "../config"; import type { ConfigurableService } from "../services"; /** * Handles region concerns for the application. */ export interface RegionService extends ConfigurableService { /** * The current locale used by the application, e.g. "en", "de-AT". Defaults * to the value of `detectedLocale`. Use `setLocale()` to change the current * locale. */ readonly locale: string; /** * Determines whether the current locale uses a right-to-left script * (`true`), or else left-to-right (`false`). */ readonly isRtl: boolean; /** * The default measurement system based on the current local. */ readonly defaultMeasurementSystem: MeasurementSystem; /** * The detected locale configured by the browser. */ detectedLocale: string; /** * The measurement system used to determine distance units. */ measurementSystem: MeasurementSystem; /** * Whether or not to automatically detect the measurement system based on * the current locale. Setting `measurementSystem` directly will set this to * `false`. */ useAutoMeasurementSystem: boolean; /** * The fallback locale to use when language resources or formatting rules * are not available for the current locale. Defaults to "inv" (invariant). */ fallbackLocale: string; /** * Default format settings for the application. */ readonly formatSettings: FormatSettings; /** * Adds language resources that will be used for translation. * * @param resources The language resources to register. */ addLanguageResources(resources: LanguageManifest | LanguageResources): void; /** * Loads the resources for the specified locale so that they are available * for use. The current locale will not be changed. * * @param localeCode The locale code, e.g. "en", "fr-CA", etc. */ loadLocale(localeCode: string): Promise; /** * Sets the locale for the application and loads any locale-specific * resources. * * @param localeCode The locale code, e.g. "en", "fr-CA", etc. */ setLocale(localeCode: string): Promise; /** * Translates a string using the current locale, if possible. * * @param options Options for translation. If the text is a language * resource key, then a localized version of that resource will be used if * one exists, otherwise the original text is returned. * @param args The values to substitute into the format string if it * contains substitution placeholders (see utilities/string/format in * Vertigis Arc-X). */ translate(options: TranslatableText, ...args: unknown[]): string; }