@openfin/workspace 20.1.13 → 20.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client-api-platform/src/api/language.d.ts +3 -2
- package/client-api-platform/src/shapes.d.ts +77 -8
- package/common/src/api/i18next.d.ts +2 -2
- package/home.js +1 -1
- package/home.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/notifications.js +1 -1
- package/notifications.js.map +1 -1
- package/package.json +1 -1
- package/store.js +1 -1
- package/store.js.map +1 -1
|
@@ -3,11 +3,12 @@ export declare function getLanguage(): Locale;
|
|
|
3
3
|
export declare const dispatchLanguageToBrowserWindows: (language: Locale) => Promise<void[]>;
|
|
4
4
|
export declare const setLanguage: (locale: Locale) => Promise<void>;
|
|
5
5
|
export declare function getLanguageResourcesInternal(): {
|
|
6
|
-
currentLanguage:
|
|
6
|
+
currentLanguage: string;
|
|
7
7
|
resources: import("i18next/typescript/options").Resource;
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* initLanguage()
|
|
11
|
-
* @param language - optional - ISO language code
|
|
11
|
+
* @param language - optional - ISO language code. Built-in languages are always accepted.
|
|
12
|
+
* Any language code defined in the external `translation-override.json` is also accepted.
|
|
12
13
|
*/
|
|
13
14
|
export default function initLanguage(language?: Locale): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type OpenFin from '@openfin/core';
|
|
2
|
-
import { IconProps
|
|
2
|
+
import type { IconProps } from '@openfin/ui-library';
|
|
3
3
|
import type { AnalyticsEvent, AnalyticsEventInternal } from '../../common/src/utils/usage-register';
|
|
4
4
|
import { CustomActionSpecifier, CustomButtonConfig } from '../../common/src/api/action';
|
|
5
5
|
import { Resource } from '../../common/src/api/i18next';
|
|
@@ -1746,9 +1746,9 @@ export interface WorkspacePlatformModule extends OpenFin.Platform {
|
|
|
1746
1746
|
*/
|
|
1747
1747
|
applyWorkspace(workspace: Workspace, options?: ApplyWorkspaceOptions): Promise<boolean>;
|
|
1748
1748
|
/**
|
|
1749
|
-
* Returns ISO language code of
|
|
1749
|
+
* Returns the ISO language code of the currently active language.
|
|
1750
1750
|
*
|
|
1751
|
-
* @returns
|
|
1751
|
+
* @returns The active language code (e.g. `'en-US'`, `'es-ES'`).
|
|
1752
1752
|
*
|
|
1753
1753
|
* @example Example of how to get the current language on Browser
|
|
1754
1754
|
*
|
|
@@ -2152,8 +2152,73 @@ export interface AnalyticsConfig {
|
|
|
2152
2152
|
*/
|
|
2153
2153
|
sendToOpenFin: boolean;
|
|
2154
2154
|
}
|
|
2155
|
-
|
|
2156
|
-
|
|
2155
|
+
/**
|
|
2156
|
+
* The built-in language codes supported by the Workspace Platform out of the box.
|
|
2157
|
+
*
|
|
2158
|
+
* @deprecated No longer used for language validation. The platform now accepts any language
|
|
2159
|
+
* code that has a resource bundle registered in i18next, including codes defined in an
|
|
2160
|
+
* external `translation-override.json`. This export will be removed in a future major version.
|
|
2161
|
+
*/
|
|
2162
|
+
export declare const SUPPORTED_LANGUAGES: string[];
|
|
2163
|
+
/**
|
|
2164
|
+
* An ISO language code accepted by the Workspace Platform.
|
|
2165
|
+
*
|
|
2166
|
+
* **Built-in languages** (supported out of the box):
|
|
2167
|
+
* - `en-US` — English (default)
|
|
2168
|
+
* - `de-DE` — German
|
|
2169
|
+
* - `ja-JP` — Japanese
|
|
2170
|
+
* - `ko-KR` — Korean
|
|
2171
|
+
* - `ru-RU` — Russian
|
|
2172
|
+
* - `zh-CN` — Chinese (Simplified)
|
|
2173
|
+
* - `zh-Hant` — Chinese (Traditional)
|
|
2174
|
+
*
|
|
2175
|
+
* **Adding custom languages** via `translationOverridesUrl`:
|
|
2176
|
+
*
|
|
2177
|
+
* Supply a `translationOverridesUrl` in your Desktop Owner Settings (DOS) or application manifest
|
|
2178
|
+
* pointing to a `translation-override.json` file. Any language code defined in that file will be
|
|
2179
|
+
* accepted at runtime in addition to the built-in list above.
|
|
2180
|
+
*
|
|
2181
|
+
* Example `translation-override.json`:
|
|
2182
|
+
* ```json
|
|
2183
|
+
* {
|
|
2184
|
+
* "x.x.x": {
|
|
2185
|
+
* "es-ES": {
|
|
2186
|
+
* "global.save": "Guardar",
|
|
2187
|
+
* "contextMenu.newWindow": "Nueva ventana"
|
|
2188
|
+
* }
|
|
2189
|
+
* }
|
|
2190
|
+
* }
|
|
2191
|
+
* ```
|
|
2192
|
+
*
|
|
2193
|
+
* The `translationOverridesUrl` can be configured in two ways:
|
|
2194
|
+
*
|
|
2195
|
+
* _Via Desktop Owner Settings_ (`dos.json` on macOS, registry on Windows):
|
|
2196
|
+
* ```json
|
|
2197
|
+
* {
|
|
2198
|
+
* "desktopSettings": {
|
|
2199
|
+
* "systemApps": {
|
|
2200
|
+
* "workspace": {
|
|
2201
|
+
* "customConfig": {
|
|
2202
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2203
|
+
* }
|
|
2204
|
+
* }
|
|
2205
|
+
* }
|
|
2206
|
+
* }
|
|
2207
|
+
* }
|
|
2208
|
+
* ```
|
|
2209
|
+
*
|
|
2210
|
+
* _Via the application manifest_ (under `platform.workspace`):
|
|
2211
|
+
* ```json
|
|
2212
|
+
* {
|
|
2213
|
+
* "platform": {
|
|
2214
|
+
* "workspace": {
|
|
2215
|
+
* "translationOverridesUrl": "https://example.com/translation-override.json"
|
|
2216
|
+
* }
|
|
2217
|
+
* }
|
|
2218
|
+
* }
|
|
2219
|
+
* ```
|
|
2220
|
+
*/
|
|
2221
|
+
export type Locale = string;
|
|
2157
2222
|
/**
|
|
2158
2223
|
* Configures the workspace to self-host using an asar bundle at the
|
|
2159
2224
|
* specified path.
|
|
@@ -2241,8 +2306,12 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2241
2306
|
*/
|
|
2242
2307
|
theme?: CustomThemes;
|
|
2243
2308
|
/**
|
|
2244
|
-
* Set
|
|
2245
|
-
*
|
|
2309
|
+
* Set the initial language for the Browser.
|
|
2310
|
+
*
|
|
2311
|
+
* The built-in ISO language codes are `'en-US'`, `'ja-JP'`, `'zh-CN'`, `'ko-KR'`,
|
|
2312
|
+
* `'ru-RU'`, `'de-DE'`, and `'zh-Hant'`. Any additional language code defined in an
|
|
2313
|
+
* external `translation-override.json` (configured via `translationOverridesUrl`) is
|
|
2314
|
+
* also accepted.
|
|
2246
2315
|
*
|
|
2247
2316
|
* @example
|
|
2248
2317
|
* ```ts
|
|
@@ -2255,7 +2324,7 @@ export interface WorkspacePlatformInitConfig {
|
|
|
2255
2324
|
* }
|
|
2256
2325
|
* });
|
|
2257
2326
|
* ```
|
|
2258
|
-
* @default 'en-
|
|
2327
|
+
* @default 'en-US'
|
|
2259
2328
|
*
|
|
2260
2329
|
*/
|
|
2261
2330
|
language?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import i18next, { type Resource } from 'i18next';
|
|
2
2
|
import { Locale } from '../../../client-api-platform/src/shapes';
|
|
3
|
-
declare function initI18next(language?: Locale): void
|
|
4
|
-
export declare const setLanguageInI18next: (locale: Locale) => void
|
|
3
|
+
declare function initI18next(language?: Locale): Promise<void>;
|
|
4
|
+
export declare const setLanguageInI18next: (locale: Locale) => Promise<void>;
|
|
5
5
|
declare const t: import("i18next").TFunction<["translation", ...string[]], undefined>;
|
|
6
6
|
export { initI18next, i18next, t, type Resource };
|
|
7
7
|
export { useTranslation } from 'react-i18next';
|