@vocab/core 0.0.0-intl-dep-bump-202301323944
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/CHANGELOG.md +204 -0
- package/dist/declarations/src/ValidationError.d.ts +5 -0
- package/dist/declarations/src/compile.d.ts +6 -0
- package/dist/declarations/src/config.d.ts +4 -0
- package/dist/declarations/src/generate-language.d.ts +5 -0
- package/dist/declarations/src/icu-handler.d.ts +2 -0
- package/dist/declarations/src/index.d.ts +6 -0
- package/dist/declarations/src/load-translations.d.ts +30 -0
- package/dist/declarations/src/logger.d.ts +3 -0
- package/dist/declarations/src/runtime.d.ts +3 -0
- package/dist/declarations/src/translation-file.d.ts +2 -0
- package/dist/declarations/src/utils.d.ts +26 -0
- package/dist/declarations/src/validate/index.d.ts +3 -0
- package/dist/vocab-core.cjs.d.ts +1 -0
- package/dist/vocab-core.cjs.dev.js +948 -0
- package/dist/vocab-core.cjs.js +7 -0
- package/dist/vocab-core.cjs.prod.js +948 -0
- package/dist/vocab-core.esm.js +921 -0
- package/icu-handler/dist/vocab-core-icu-handler.cjs.d.ts +1 -0
- package/icu-handler/dist/vocab-core-icu-handler.cjs.dev.js +34 -0
- package/icu-handler/dist/vocab-core-icu-handler.cjs.js +7 -0
- package/icu-handler/dist/vocab-core-icu-handler.cjs.prod.js +34 -0
- package/icu-handler/dist/vocab-core-icu-handler.esm.js +26 -0
- package/icu-handler/package.json +4 -0
- package/package.json +57 -0
- package/runtime/dist/vocab-core-runtime.cjs.d.ts +1 -0
- package/runtime/dist/vocab-core-runtime.cjs.dev.js +15 -0
- package/runtime/dist/vocab-core-runtime.cjs.js +7 -0
- package/runtime/dist/vocab-core-runtime.cjs.prod.js +15 -0
- package/runtime/dist/vocab-core-runtime.esm.js +10 -0
- package/runtime/package.json +4 -0
- package/translation-file/dist/vocab-core-translation-file.cjs.d.ts +1 -0
- package/translation-file/dist/vocab-core-translation-file.cjs.dev.js +43 -0
- package/translation-file/dist/vocab-core-translation-file.cjs.js +7 -0
- package/translation-file/dist/vocab-core-translation-file.cjs.prod.js +43 -0
- package/translation-file/dist/vocab-core-translation-file.esm.js +39 -0
- package/translation-file/package.json +4 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# @vocab/core
|
|
2
|
+
|
|
3
|
+
## 0.0.0-intl-dep-bump-202301323944
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b63496a`](https://github.com/seek-oss/vocab/commit/b63496a4e25c1537e9b10057749e6660b24c777b) Thanks [@askoufis](https://github.com/askoufis)! - Update intl dependencies
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`b63496a`](https://github.com/seek-oss/vocab/commit/b63496a4e25c1537e9b10057749e6660b24c777b)]:
|
|
10
|
+
- @vocab/types@0.0.0-intl-dep-bump-202301323944
|
|
11
|
+
|
|
12
|
+
## 1.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`09a698a`](https://github.com/seek-oss/vocab/commit/09a698af6aff86a851e4f829916b8f1f6beaca58) [#89](https://github.com/seek-oss/vocab/pull/89) Thanks [@mikebarkmin](https://github.com/mikebarkmin)! - Add exports to packages with multiple entry points. This fixes
|
|
17
|
+
`ERR_UNSUPPORTED_DIR_IMPORT` issues e.g. with NextJS or other setups, which
|
|
18
|
+
rely on the new node resolver when using ESM packages.
|
|
19
|
+
|
|
20
|
+
## 1.1.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- [`87333d7`](https://github.com/seek-oss/vocab/commit/87333d79c4a883b07d7d8f2c272b16e2243c49bd) [#80](https://github.com/seek-oss/vocab/pull/80) Thanks [@askoufis](https://github.com/askoufis)! - Enable the creation of generated languages via the `generatedLanguages` config.
|
|
25
|
+
See [the docs] for more information and examples.
|
|
26
|
+
|
|
27
|
+
[the docs]: https://github.com/seek-oss/vocab#generated-languages
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`87333d7`](https://github.com/seek-oss/vocab/commit/87333d79c4a883b07d7d8f2c272b16e2243c49bd)]:
|
|
32
|
+
- @vocab/types@1.1.0
|
|
33
|
+
|
|
34
|
+
## 1.0.4
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- [`206c0fa`](https://github.com/seek-oss/vocab/commit/206c0fa36b05f23da593ebed801197c523477af6) [#78](https://github.com/seek-oss/vocab/pull/78) Thanks [@askoufis](https://github.com/askoufis)! - Fix incorrect language hierarchy when an extended language extends another language
|
|
39
|
+
|
|
40
|
+
## 1.0.3
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [`78e874f`](https://github.com/seek-oss/vocab/commit/78e874f720ca34d771072c09fe55b57ff3158e02) [#71](https://github.com/seek-oss/vocab/pull/71) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Only write compiled runtime files to disk if they have been changed
|
|
45
|
+
|
|
46
|
+
## 1.0.2
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- [`3ec6dba`](https://github.com/seek-oss/vocab/commit/3ec6dbaad590299cc33e2d9d4a877576eb05853a) [#63](https://github.com/seek-oss/vocab/pull/63) Thanks [@jahredhope](https://github.com/jahredhope)! - Migrate to new @formatjs/icu-messageformat-parser as intl-messageformat-parser has been deprecated
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [[`3ec6dba`](https://github.com/seek-oss/vocab/commit/3ec6dbaad590299cc33e2d9d4a877576eb05853a)]:
|
|
53
|
+
- @vocab/types@1.0.1
|
|
54
|
+
|
|
55
|
+
## 1.0.1
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- [`c9a38dd`](https://github.com/seek-oss/vocab/commit/c9a38dd15e2c2a47fc4d5eb2348fdd08a6982768) [#54](https://github.com/seek-oss/vocab/pull/54) Thanks [@jahredhope](https://github.com/jahredhope)! - Allow special characters within translation keys and messages
|
|
60
|
+
|
|
61
|
+
## 1.0.0
|
|
62
|
+
|
|
63
|
+
### Major Changes
|
|
64
|
+
|
|
65
|
+
- [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c) [#51](https://github.com/seek-oss/vocab/pull/51) Thanks [@jahredhope](https://github.com/jahredhope)! - Release v1.0.0
|
|
66
|
+
|
|
67
|
+
Release Vocab as v1.0.0 to signify a stable API and support future [semver versioning](https://semver.org/) releases.
|
|
68
|
+
|
|
69
|
+
Vocab has seen a lot of iteration and changes since it was first published on 20 November 2020. We are now confident with the API and believe Vocab is ready for common use.
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- [`0074382`](https://github.com/seek-oss/vocab/commit/007438273ef70f5d5ded45777933651ad8df36f6) [#52](https://github.com/seek-oss/vocab/pull/52) Thanks [@jahredhope](https://github.com/jahredhope)! - Remove React dependency on core types.
|
|
74
|
+
|
|
75
|
+
Direct use of tags in Translations now have stricter type definitions.
|
|
76
|
+
|
|
77
|
+
- Updated dependencies [[`0074382`](https://github.com/seek-oss/vocab/commit/007438273ef70f5d5ded45777933651ad8df36f6), [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c)]:
|
|
78
|
+
- @vocab/types@1.0.0
|
|
79
|
+
|
|
80
|
+
## 0.0.11
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- [`5b1fdc0`](https://github.com/seek-oss/vocab/commit/5b1fdc019522b12e7ef94b2fec57b54a9310d41c) [#46](https://github.com/seek-oss/vocab/pull/46) Thanks [@jahredhope](https://github.com/jahredhope)! - Enable the use of translation files directly with 3 new documented methods for working with translations.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
/**
|
|
88
|
+
* Retrieve messages. If not available, will attempt to load messages and resolve once complete.
|
|
89
|
+
*/
|
|
90
|
+
translations.getMessages(language);
|
|
91
|
+
/**
|
|
92
|
+
* Retrieve already loaded messages. Will return null if messages haven't been loaded.
|
|
93
|
+
*/
|
|
94
|
+
translations.getLoadedMessages(language);
|
|
95
|
+
/**
|
|
96
|
+
* Load messages for the given language. Resolving once complete.
|
|
97
|
+
*/
|
|
98
|
+
translations.load(language);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [[`5b1fdc0`](https://github.com/seek-oss/vocab/commit/5b1fdc019522b12e7ef94b2fec57b54a9310d41c)]:
|
|
102
|
+
- @vocab/types@0.0.9
|
|
103
|
+
|
|
104
|
+
## 0.0.10
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- [`7c96a14`](https://github.com/seek-oss/vocab/commit/7c96a142f602132d38c1df1a47a1f4657dc5c94c) [#43](https://github.com/seek-oss/vocab/pull/43) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Return `NonNullable<ReactNode>` instead of `ReactNode` from translation function
|
|
109
|
+
|
|
110
|
+
## 0.0.9
|
|
111
|
+
|
|
112
|
+
### Patch Changes
|
|
113
|
+
|
|
114
|
+
- [`3034bd3`](https://github.com/seek-oss/vocab/commit/3034bd3de610a9d1f3bfbd8caefa27064dee2710) [#40](https://github.com/seek-oss/vocab/pull/40) Thanks [@jahredhope](https://github.com/jahredhope)! - Fix .vocab files with no prefix not compiling
|
|
115
|
+
|
|
116
|
+
* [`c110745`](https://github.com/seek-oss/vocab/commit/c110745b79df1a8ade6b1d8a49e798b04a7b95e1) [#42](https://github.com/seek-oss/vocab/pull/42) Thanks [@jahredhope](https://github.com/jahredhope)! - Avoid overriding existing translations files for new directories
|
|
117
|
+
|
|
118
|
+
## 0.0.8
|
|
119
|
+
|
|
120
|
+
### Patch Changes
|
|
121
|
+
|
|
122
|
+
- [`f2fca67`](https://github.com/seek-oss/vocab/commit/f2fca679c66ae65405a0aa24f0a0e472026aad0d) [#36](https://github.com/seek-oss/vocab/pull/36) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Support custom locales for ICU message parsing
|
|
123
|
+
|
|
124
|
+
- Updated dependencies [[`f2fca67`](https://github.com/seek-oss/vocab/commit/f2fca679c66ae65405a0aa24f0a0e472026aad0d)]:
|
|
125
|
+
- @vocab/types@0.0.8
|
|
126
|
+
|
|
127
|
+
## 0.0.7
|
|
128
|
+
|
|
129
|
+
### Patch Changes
|
|
130
|
+
|
|
131
|
+
- [`283bcad`](https://github.com/seek-oss/vocab/commit/283bcada06e622ab14ed891743ed3f55cf09e245) [#33](https://github.com/seek-oss/vocab/pull/33) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Move all vocab files to single directory with configurable suffix
|
|
132
|
+
|
|
133
|
+
* [`ad0d240`](https://github.com/seek-oss/vocab/commit/ad0d2404545ded8e11621eae8f29467ff3352366) [#31](https://github.com/seek-oss/vocab/pull/31) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Move the node runtime from @vocab/webpack to @vocab/core
|
|
134
|
+
|
|
135
|
+
- [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb) [#34](https://github.com/seek-oss/vocab/pull/34) Thanks [@jahredhope](https://github.com/jahredhope)! - Create translation files for newly created vocab directories
|
|
136
|
+
|
|
137
|
+
* [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb) [#34](https://github.com/seek-oss/vocab/pull/34) Thanks [@jahredhope](https://github.com/jahredhope)! - Validate translation files as loaded. Providing additional error messaging.
|
|
138
|
+
|
|
139
|
+
* Updated dependencies [[`283bcad`](https://github.com/seek-oss/vocab/commit/283bcada06e622ab14ed891743ed3f55cf09e245), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb)]:
|
|
140
|
+
- @vocab/types@0.0.7
|
|
141
|
+
|
|
142
|
+
## 0.0.6
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- [`80a46c0`](https://github.com/seek-oss/vocab/commit/80a46c01a55408675f5822c3618519f80136c3ab) [#27](https://github.com/seek-oss/vocab/pull/27) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add `ignore` config for ignoring files/folders from cli scripts
|
|
147
|
+
|
|
148
|
+
* [`80a46c0`](https://github.com/seek-oss/vocab/commit/80a46c01a55408675f5822c3618519f80136c3ab) [#27](https://github.com/seek-oss/vocab/pull/27) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Ignore node_modules from push, pull and compile scripts
|
|
149
|
+
|
|
150
|
+
* Updated dependencies [[`80a46c0`](https://github.com/seek-oss/vocab/commit/80a46c01a55408675f5822c3618519f80136c3ab)]:
|
|
151
|
+
- @vocab/types@0.0.6
|
|
152
|
+
|
|
153
|
+
## 0.0.5
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- [`371ed16`](https://github.com/seek-oss/vocab/commit/371ed16a232a04dab13afa7e2b352dfb6724eea4) [#25](https://github.com/seek-oss/vocab/pull/25) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Watch alt language files as well as dev language
|
|
158
|
+
|
|
159
|
+
* [`c222d68`](https://github.com/seek-oss/vocab/commit/c222d68a3c0c24723a338eccb959798881f6a118) [#24](https://github.com/seek-oss/vocab/pull/24) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Changed glob constants to functions
|
|
160
|
+
|
|
161
|
+
## 0.0.4
|
|
162
|
+
|
|
163
|
+
### Patch Changes
|
|
164
|
+
|
|
165
|
+
- [`5f5c581`](https://github.com/seek-oss/vocab/commit/5f5c581a65bff28729ee19e1ec0bdea488a9d6c2) [#19](https://github.com/seek-oss/vocab/pull/19) Thanks [@jahredhope](https://github.com/jahredhope)! - Compile useable TypeScript importable files with `vocab compile`.
|
|
166
|
+
|
|
167
|
+
The new `vocab compile` step replaces `vocab generate-types` in creating a fully functional **translations.ts** file.
|
|
168
|
+
|
|
169
|
+
This allows vocab to be used **without the Webpack Plugin**, however use of the plugin is still heavily advised to ensure optimal loading of translation content on the web.
|
|
170
|
+
|
|
171
|
+
Support for unit testing is now better than ever! The newly created **translations.ts** means your unit test code will see the same code as available while rendering.
|
|
172
|
+
|
|
173
|
+
See the [documentation](https://github.com/seek-oss/vocab) for further usage details.
|
|
174
|
+
|
|
175
|
+
* [`02f943c`](https://github.com/seek-oss/vocab/commit/02f943ca892913b41f9e4720a72400777cf14b3d) [#17](https://github.com/seek-oss/vocab/pull/17) Thanks [@jahredhope](https://github.com/jahredhope)! - Add additional debug traces
|
|
176
|
+
|
|
177
|
+
* Updated dependencies [[`5f5c581`](https://github.com/seek-oss/vocab/commit/5f5c581a65bff28729ee19e1ec0bdea488a9d6c2)]:
|
|
178
|
+
- @vocab/types@0.0.5
|
|
179
|
+
|
|
180
|
+
## 0.0.3
|
|
181
|
+
|
|
182
|
+
### Patch Changes
|
|
183
|
+
|
|
184
|
+
- [`08de30d`](https://github.com/seek-oss/vocab/commit/08de30d338c2a5ebdcf14da7c736dddf22e7ca9e) [#14](https://github.com/seek-oss/vocab/pull/14) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add ability to override files namespace with \$namespace
|
|
185
|
+
|
|
186
|
+
* [`ed6cf40`](https://github.com/seek-oss/vocab/commit/ed6cf408973f2e9c4d07a71fcb52f40294ebaf65) [#13](https://github.com/seek-oss/vocab/pull/13) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Add validation script for identifying missing keys
|
|
187
|
+
|
|
188
|
+
- [`26b52f4`](https://github.com/seek-oss/vocab/commit/26b52f4878ded440841e08c858bdc9e685500c2a) [#16](https://github.com/seek-oss/vocab/pull/16) Thanks [@jahredhope](https://github.com/jahredhope)! - Enable debugging with DEBUG environment variable
|
|
189
|
+
|
|
190
|
+
* [`b5a5a05`](https://github.com/seek-oss/vocab/commit/b5a5a05a5bb87b48e6e9160af75f555728143ea2) [#15](https://github.com/seek-oss/vocab/pull/15) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Added watch mode to generate-types
|
|
191
|
+
|
|
192
|
+
* Updated dependencies [[`08de30d`](https://github.com/seek-oss/vocab/commit/08de30d338c2a5ebdcf14da7c736dddf22e7ca9e)]:
|
|
193
|
+
- @vocab/types@0.0.4
|
|
194
|
+
|
|
195
|
+
## 0.0.2
|
|
196
|
+
|
|
197
|
+
### Patch Changes
|
|
198
|
+
|
|
199
|
+
- [`4710f34`](https://github.com/seek-oss/vocab/commit/4710f341f2827643e3eff69ef7e26d44ec6e8a2b) [#8](https://github.com/seek-oss/vocab/pull/8) Thanks [@mattcompiles](https://github.com/mattcompiles)! - Infer `t` return type more intelligently
|
|
200
|
+
|
|
201
|
+
The translate key function (`t`) will now infer the return type as ReactNode only when the tag syntax is used.
|
|
202
|
+
|
|
203
|
+
- Updated dependencies [[`4710f34`](https://github.com/seek-oss/vocab/commit/4710f341f2827643e3eff69ef7e26d44ec6e8a2b)]:
|
|
204
|
+
- @vocab/types@0.0.3
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LoadedTranslation, UserConfig } from '@vocab/types';
|
|
2
|
+
export declare function generateRuntime(loadedTranslation: LoadedTranslation): Promise<void>;
|
|
3
|
+
export declare function watch(config: UserConfig): () => Promise<void>;
|
|
4
|
+
export declare function compile({ watch: shouldWatch }: {
|
|
5
|
+
watch?: boolean | undefined;
|
|
6
|
+
} | undefined, config: UserConfig): Promise<(() => Promise<void>) | undefined>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UserConfig } from '@vocab/types';
|
|
2
|
+
export declare function validateConfig(c: UserConfig): boolean;
|
|
3
|
+
export declare function resolveConfig(customConfigFilePath?: string): Promise<UserConfig | null>;
|
|
4
|
+
export declare function resolveConfigSync(customConfigFilePath?: string): UserConfig | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { MessageGenerator, TranslationsByKey } from '@vocab/types';
|
|
2
|
+
export declare function generateLanguageFromTranslations({ baseTranslations, generator, }: {
|
|
3
|
+
baseTranslations: TranslationsByKey<string>;
|
|
4
|
+
generator: MessageGenerator;
|
|
5
|
+
}): TranslationsByKey<string>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { compile, watch } from './compile';
|
|
2
|
+
export { validate } from './validate';
|
|
3
|
+
export { resolveConfig, resolveConfigSync, validateConfig } from './config';
|
|
4
|
+
export { getAltLanguages, getAltLanguageFilePath, getDevLanguageFileFromTsFile, } from './utils';
|
|
5
|
+
export { getUniqueKey, loadAllTranslations, loadTranslation, } from './load-translations';
|
|
6
|
+
export type { TranslationFile } from '@vocab/types';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TranslationsByKey, UserConfig, LoadedTranslation, LanguageTarget } from '@vocab/types';
|
|
2
|
+
import { Fallback } from './utils';
|
|
3
|
+
export declare function getUniqueKey(key: string, namespace: string): string;
|
|
4
|
+
export declare function mergeWithDevLanguageTranslation({ translation, devTranslation, }: {
|
|
5
|
+
translation: TranslationsByKey;
|
|
6
|
+
devTranslation: TranslationsByKey;
|
|
7
|
+
}): TranslationsByKey<string>;
|
|
8
|
+
export declare function getLanguageHierarchy({ languages, }: {
|
|
9
|
+
languages: Array<LanguageTarget>;
|
|
10
|
+
}): Map<string, string[]>;
|
|
11
|
+
export declare function getFallbackLanguageOrder({ languages, languageName, devLanguage, fallbacks, }: {
|
|
12
|
+
languages: LanguageTarget[];
|
|
13
|
+
languageName: string;
|
|
14
|
+
devLanguage: string;
|
|
15
|
+
fallbacks: Fallback;
|
|
16
|
+
}): string[];
|
|
17
|
+
export declare function loadAltLanguageFile({ filePath, languageName, devTranslation, fallbacks, }: {
|
|
18
|
+
filePath: string;
|
|
19
|
+
languageName: string;
|
|
20
|
+
devTranslation: TranslationsByKey;
|
|
21
|
+
fallbacks: Fallback;
|
|
22
|
+
}, { devLanguage, languages }: UserConfig): TranslationsByKey;
|
|
23
|
+
export declare function loadTranslation({ filePath, fallbacks, }: {
|
|
24
|
+
filePath: string;
|
|
25
|
+
fallbacks: Fallback;
|
|
26
|
+
}, userConfig: UserConfig): LoadedTranslation;
|
|
27
|
+
export declare function loadAllTranslations({ fallbacks, includeNodeModules, }: {
|
|
28
|
+
fallbacks: Fallback;
|
|
29
|
+
includeNodeModules: boolean;
|
|
30
|
+
}, config: UserConfig): Promise<Array<LoadedTranslation>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { TranslationModuleByLanguage, LanguageName, ParsedFormatFnByKey, TranslationFile } from '@vocab/types';
|
|
2
|
+
export declare function createTranslationFile<Language extends LanguageName, FormatFnByKey extends ParsedFormatFnByKey>(translationsByLanguage: TranslationModuleByLanguage<Language, FormatFnByKey>): TranslationFile<Language, FormatFnByKey>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { LanguageName, LanguageTarget, TranslationsByKey, TranslationMessagesByKey, UserConfig } from '@vocab/types';
|
|
2
|
+
export declare const defaultTranslationDirSuffix = ".vocab";
|
|
3
|
+
export declare const devTranslationFileName = "translations.json";
|
|
4
|
+
export declare type Fallback = 'none' | 'valid' | 'all';
|
|
5
|
+
export declare function isDevLanguageFile(filePath: string): boolean;
|
|
6
|
+
export declare function isAltLanguageFile(filePath: string): boolean;
|
|
7
|
+
export declare function isTranslationDirectory(filePath: string, { translationsDirectorySuffix, }: {
|
|
8
|
+
translationsDirectorySuffix?: string;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function getTranslationFolderGlob({ translationsDirectorySuffix, }: {
|
|
11
|
+
translationsDirectorySuffix?: string;
|
|
12
|
+
}): string;
|
|
13
|
+
export declare function getDevTranslationFileGlob({ translationsDirectorySuffix, }: {
|
|
14
|
+
translationsDirectorySuffix?: string;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function getAltTranslationFileGlob(config: UserConfig): string;
|
|
17
|
+
export declare function getAltLanguages({ devLanguage, languages, }: {
|
|
18
|
+
devLanguage: LanguageName;
|
|
19
|
+
languages: Array<LanguageTarget>;
|
|
20
|
+
}): string[];
|
|
21
|
+
export declare function getDevLanguageFileFromTsFile(tsFilePath: string): string;
|
|
22
|
+
export declare function getDevLanguageFileFromAltLanguageFile(altLanguageFilePath: string): string;
|
|
23
|
+
export declare function getTSFileFromDevLanguageFile(devLanguageFilePath: string): string;
|
|
24
|
+
export declare function getAltLanguageFilePath(devLanguageFilePath: string, language: string): string;
|
|
25
|
+
export declare function mapValues<Key extends string, OriginalValue, ReturnValue>(obj: Record<Key, OriginalValue>, func: (val: OriginalValue) => ReturnValue): TranslationMessagesByKey<Key>;
|
|
26
|
+
export declare function getTranslationMessages<Key extends string>(translations: TranslationsByKey<Key>): TranslationMessagesByKey<Key>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { UserConfig, LoadedTranslation, LanguageName } from '@vocab/types';
|
|
2
|
+
export declare function findMissingKeys(loadedTranslation: LoadedTranslation, devLanguageName: LanguageName, altLanguages: Array<LanguageName>): readonly [boolean, Record<string, string[]>];
|
|
3
|
+
export declare function validate(config: UserConfig): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./declarations/src/index";
|