@tolgee/core 5.2.0-rc.d8d91b51.0 → 5.2.1
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/dist/tolgee.cjs.js +4 -2
- package/dist/tolgee.cjs.js.map +1 -1
- package/dist/tolgee.cjs.min.js +1 -1
- package/dist/tolgee.cjs.min.js.map +1 -1
- package/dist/tolgee.esm.js +4 -2
- package/dist/tolgee.esm.js.map +1 -1
- package/dist/tolgee.esm.min.mjs +1 -1
- package/dist/tolgee.esm.min.mjs.map +1 -1
- package/dist/tolgee.umd.js +4 -2
- package/dist/tolgee.umd.js.map +1 -1
- package/dist/tolgee.umd.min.js +1 -1
- package/dist/tolgee.umd.min.js.map +1 -1
- package/lib/Controller/State/initState.d.ts +2 -1
- package/lib/TolgeeCore.d.ts +3 -1
- package/lib/types/general.d.ts +1 -1
- package/package.json +2 -2
- package/src/Controller/Controller.ts +2 -2
- package/src/Controller/State/initState.ts +3 -1
- package/src/types/general.ts +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FallbackGeneral, FallbackLanguageOption, TreeTranslationsData, OnFormatError } from '../../types';
|
|
2
2
|
import { ObserverOptions, ObserverOptionsInternal } from './observerOptions';
|
|
3
3
|
export declare const DEFAULT_FORMAT_ERROR = "invalid";
|
|
4
|
+
export declare const DEFAULT_API_URL = "https://app.tolgee.io";
|
|
4
5
|
export declare type TolgeeStaticData = {
|
|
5
6
|
[key: string]: TreeTranslationsData | (() => Promise<TreeTranslationsData>);
|
|
6
7
|
};
|
|
@@ -10,7 +11,7 @@ export declare type TolgeeOptionsInternal = {
|
|
|
10
11
|
*/
|
|
11
12
|
language?: string;
|
|
12
13
|
/**
|
|
13
|
-
* Tolgee instance url (
|
|
14
|
+
* Tolgee instance url (default: https://app.tolgee.io)
|
|
14
15
|
*/
|
|
15
16
|
apiUrl?: string;
|
|
16
17
|
/**
|
package/lib/TolgeeCore.d.ts
CHANGED
|
@@ -132,7 +132,9 @@ declare const createTolgee: (options: TolgeeOptions) => Readonly<{
|
|
|
132
132
|
apiKey?: string | undefined;
|
|
133
133
|
projectId?: string | number | undefined;
|
|
134
134
|
language?: string | undefined;
|
|
135
|
-
defaultLanguage?: string | undefined;
|
|
135
|
+
defaultLanguage?: string | undefined; /**
|
|
136
|
+
* Turn off/on events emitting. Is on by default.
|
|
137
|
+
*/
|
|
136
138
|
availableLanguages?: string[] | undefined;
|
|
137
139
|
fallbackLanguage?: import("./types").FallbackLanguageOption;
|
|
138
140
|
ns?: string[] | undefined;
|
package/lib/types/general.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolgee/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.1",
|
|
4
4
|
"description": "Library providing ability to translate messages directly in context of developed application.",
|
|
5
5
|
"main": "./dist/tolgee.cjs.js",
|
|
6
6
|
"module": "./dist/tolgee.esm.js",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
65
|
"sideEffects": false,
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "10cc8e63d4cf191a569df8fbaf1f6774921321fa"
|
|
67
67
|
}
|
|
@@ -191,12 +191,12 @@ export const Controller = ({ options }: StateServiceProps) => {
|
|
|
191
191
|
|
|
192
192
|
function getTranslationNs({ key, ns }: KeyAndNamespacesInternal) {
|
|
193
193
|
const languages = state.getFallbackLangs();
|
|
194
|
-
const namespaces = getDefaultAndFallbackNs(ns);
|
|
194
|
+
const namespaces = getDefaultAndFallbackNs(ns || undefined);
|
|
195
195
|
return cache.getTranslationNs(namespaces, languages, key);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
function getTranslation({ key, ns }: KeyAndNamespacesInternal) {
|
|
199
|
-
const namespaces = getDefaultAndFallbackNs(ns);
|
|
199
|
+
const namespaces = getDefaultAndFallbackNs(ns || undefined);
|
|
200
200
|
const languages = state.getFallbackLangs();
|
|
201
201
|
return cache.getTranslationFallback(namespaces, languages, key);
|
|
202
202
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
} from './observerOptions';
|
|
13
13
|
|
|
14
14
|
export const DEFAULT_FORMAT_ERROR = 'invalid';
|
|
15
|
+
export const DEFAULT_API_URL = 'https://app.tolgee.io';
|
|
15
16
|
|
|
16
17
|
export type TolgeeStaticData = {
|
|
17
18
|
[key: string]: TreeTranslationsData | (() => Promise<TreeTranslationsData>);
|
|
@@ -24,7 +25,7 @@ export type TolgeeOptionsInternal = {
|
|
|
24
25
|
language?: string;
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
|
-
* Tolgee instance url (
|
|
28
|
+
* Tolgee instance url (default: https://app.tolgee.io)
|
|
28
29
|
*/
|
|
29
30
|
apiUrl?: string;
|
|
30
31
|
|
|
@@ -118,6 +119,7 @@ const defaultValues: TolgeeOptionsInternal = {
|
|
|
118
119
|
observerOptions: defaultObserverOptions,
|
|
119
120
|
observerType: 'invisible',
|
|
120
121
|
onFormatError: DEFAULT_FORMAT_ERROR,
|
|
122
|
+
apiUrl: DEFAULT_API_URL,
|
|
121
123
|
};
|
|
122
124
|
|
|
123
125
|
export const combineOptions = <T extends TolgeeOptions>(
|