@vocab/phrase 0.0.0-package-files-20231142931 → 0.0.0-push-split-translation-files-20230508031119
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/LICENSE +21 -0
- package/dist/declarations/src/csv.d.ts +9 -0
- package/dist/declarations/src/file.d.ts +4 -4
- package/dist/declarations/src/index.d.ts +2 -2
- package/dist/declarations/src/logger.d.ts +3 -3
- package/dist/declarations/src/phrase-api.d.ts +12 -10
- package/dist/declarations/src/pull-translations.d.ts +7 -7
- package/dist/declarations/src/push-translations.d.ts +11 -10
- package/dist/vocab-phrase.cjs.dev.js +141 -77
- package/dist/vocab-phrase.cjs.prod.js +141 -77
- package/dist/vocab-phrase.esm.js +138 -74
- package/package.json +9 -8
- package/CHANGELOG.md +0 -154
package/dist/vocab-phrase.esm.js
CHANGED
|
@@ -5,6 +5,7 @@ import FormData from 'form-data';
|
|
|
5
5
|
import fetch from 'node-fetch';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
import debug from 'debug';
|
|
8
|
+
import { stringify } from 'csv-stringify/sync';
|
|
8
9
|
|
|
9
10
|
const mkdir = promises.mkdir;
|
|
10
11
|
const writeFile = promises.writeFile;
|
|
@@ -15,14 +16,60 @@ const log = (...params) => {
|
|
|
15
16
|
console.log(chalk.yellow('Vocab'), ...params);
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
function translationsToCsv(translations, devLanguage) {
|
|
20
|
+
const languages = Object.keys(translations);
|
|
21
|
+
const altLanguages = languages.filter(language => language !== devLanguage);
|
|
22
|
+
// Ensure languages are ordered for locale mapping
|
|
23
|
+
// Might not need this anymore?
|
|
24
|
+
// const orderedLanguages = [devLanguage, ...altLanguages];
|
|
25
|
+
|
|
26
|
+
const devLanguageTranslations = translations[devLanguage];
|
|
27
|
+
const csvFilesByLanguage = Object.fromEntries(languages.map(language => [language, []]));
|
|
28
|
+
Object.entries(devLanguageTranslations).map(([key, {
|
|
29
|
+
message,
|
|
30
|
+
description,
|
|
31
|
+
tags
|
|
32
|
+
}]) => {
|
|
33
|
+
const sharedData = [key, description, tags === null || tags === void 0 ? void 0 : tags.join(',')];
|
|
34
|
+
const devLanguageRow = [...sharedData, message];
|
|
35
|
+
csvFilesByLanguage[devLanguage].push(devLanguageRow);
|
|
36
|
+
altLanguages.map(language => {
|
|
37
|
+
var _translations$languag, _translations$languag2;
|
|
38
|
+
const altTranslationMessage = (_translations$languag = translations[language]) === null || _translations$languag === void 0 ? void 0 : (_translations$languag2 = _translations$languag[key]) === null || _translations$languag2 === void 0 ? void 0 : _translations$languag2.message;
|
|
39
|
+
if (altTranslationMessage) {
|
|
40
|
+
csvFilesByLanguage[language].push([...sharedData, altTranslationMessage]);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const csvFilesWithKeys = Object.fromEntries(Object.entries(csvFilesByLanguage).filter(([_, csvFile]) => csvFile.length > 0));
|
|
45
|
+
const csvFileStrings = Object.fromEntries(Object.entries(csvFilesWithKeys).map(([language, csvFile]) => {
|
|
46
|
+
const csvFileString = stringify(csvFile, {
|
|
47
|
+
delimiter: ',',
|
|
48
|
+
header: false
|
|
49
|
+
});
|
|
50
|
+
return [language, csvFileString];
|
|
51
|
+
}));
|
|
52
|
+
|
|
53
|
+
// Column indices start at 1
|
|
54
|
+
const keyIndex = 1;
|
|
55
|
+
const commentIndex = keyIndex + 1;
|
|
56
|
+
const tagColumn = commentIndex + 1;
|
|
57
|
+
return {
|
|
58
|
+
csvFileStrings,
|
|
59
|
+
keyIndex,
|
|
60
|
+
commentIndex,
|
|
61
|
+
tagColumn
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* eslint-disable no-console */
|
|
18
66
|
function _callPhrase(path, options = {}) {
|
|
19
67
|
const phraseApiToken = process.env.PHRASE_API_TOKEN;
|
|
20
|
-
|
|
21
68
|
if (!phraseApiToken) {
|
|
22
69
|
throw new Error('Missing PHRASE_API_TOKEN');
|
|
23
70
|
}
|
|
24
|
-
|
|
25
|
-
|
|
71
|
+
return fetch(path, {
|
|
72
|
+
...options,
|
|
26
73
|
headers: {
|
|
27
74
|
Authorization: `token ${phraseApiToken}`,
|
|
28
75
|
// Provide identification via User Agent as requested in https://developers.phrase.com/api/#overview--identification-via-user-agent
|
|
@@ -31,30 +78,26 @@ function _callPhrase(path, options = {}) {
|
|
|
31
78
|
}
|
|
32
79
|
}).then(async response => {
|
|
33
80
|
console.log(`${path}: ${response.status} - ${response.statusText}`);
|
|
34
|
-
|
|
35
|
-
|
|
81
|
+
const secondsUntilLimitReset = Math.ceil(Number.parseFloat(response.headers.get('X-Rate-Limit-Reset') || '0') - Date.now() / 1000);
|
|
82
|
+
console.log(`Rate Limit: ${response.headers.get('X-Rate-Limit-Remaining')} of ${response.headers.get('X-Rate-Limit-Limit')} remaining. (${secondsUntilLimitReset} seconds remaining)`);
|
|
83
|
+
trace('\nLink:', response.headers.get('Link'), '\n');
|
|
84
|
+
// Print All Headers:
|
|
36
85
|
// console.log(Array.from(r.headers.entries()));
|
|
37
86
|
|
|
38
87
|
try {
|
|
39
88
|
var _response$headers$get;
|
|
40
|
-
|
|
41
89
|
const result = await response.json();
|
|
42
90
|
trace(`Internal Result (Length: ${result.length})\n`);
|
|
43
|
-
|
|
44
91
|
if ((!options.method || options.method === 'GET') && (_response$headers$get = response.headers.get('Link')) !== null && _response$headers$get !== void 0 && _response$headers$get.includes('rel=next')) {
|
|
45
92
|
var _response$headers$get2, _response$headers$get3;
|
|
46
|
-
|
|
47
93
|
const [, nextPageUrl] = (_response$headers$get2 = (_response$headers$get3 = response.headers.get('Link')) === null || _response$headers$get3 === void 0 ? void 0 : _response$headers$get3.match(/<([^>]*)>; rel=next/)) !== null && _response$headers$get2 !== void 0 ? _response$headers$get2 : [];
|
|
48
|
-
|
|
49
94
|
if (!nextPageUrl) {
|
|
50
95
|
throw new Error("Can't parse next page URL");
|
|
51
96
|
}
|
|
52
|
-
|
|
53
97
|
console.log('Results received with next page: ', nextPageUrl);
|
|
54
98
|
const nextPageResult = await _callPhrase(nextPageUrl, options);
|
|
55
99
|
return [...result, ...nextPageResult];
|
|
56
100
|
}
|
|
57
|
-
|
|
58
101
|
return result;
|
|
59
102
|
} catch (e) {
|
|
60
103
|
console.error('Unable to parse response as JSON', e);
|
|
@@ -62,19 +105,15 @@ function _callPhrase(path, options = {}) {
|
|
|
62
105
|
}
|
|
63
106
|
});
|
|
64
107
|
}
|
|
65
|
-
|
|
66
108
|
async function callPhrase(relativePath, options = {}) {
|
|
67
109
|
const projectId = process.env.PHRASE_PROJECT_ID;
|
|
68
|
-
|
|
69
110
|
if (!projectId) {
|
|
70
111
|
throw new Error('Missing PHRASE_PROJECT_ID');
|
|
71
112
|
}
|
|
72
|
-
|
|
73
113
|
return _callPhrase(`https://api.phrase.com/v2/projects/${projectId}/${relativePath}`, options).then(result => {
|
|
74
114
|
if (Array.isArray(result)) {
|
|
75
115
|
console.log('Result length:', result.length);
|
|
76
116
|
}
|
|
77
|
-
|
|
78
117
|
return result;
|
|
79
118
|
}).catch(error => {
|
|
80
119
|
console.error(`Error calling phrase for ${relativePath}:`, error);
|
|
@@ -84,44 +123,64 @@ async function callPhrase(relativePath, options = {}) {
|
|
|
84
123
|
async function pullAllTranslations(branch) {
|
|
85
124
|
const phraseResult = await callPhrase(`translations?branch=${branch}&per_page=100`);
|
|
86
125
|
const translations = {};
|
|
87
|
-
|
|
88
126
|
for (const r of phraseResult) {
|
|
89
127
|
if (!translations[r.locale.code]) {
|
|
90
128
|
translations[r.locale.code] = {};
|
|
91
129
|
}
|
|
92
|
-
|
|
93
130
|
translations[r.locale.code][r.key.name] = {
|
|
94
131
|
message: r.content
|
|
95
132
|
};
|
|
96
133
|
}
|
|
97
|
-
|
|
98
134
|
return translations;
|
|
99
135
|
}
|
|
100
|
-
async function
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
contentType: 'application/json',
|
|
105
|
-
filename: `${locale}.json`
|
|
106
|
-
});
|
|
107
|
-
formData.append('file_format', 'json');
|
|
108
|
-
formData.append('locale_id', locale);
|
|
109
|
-
formData.append('branch', branch);
|
|
110
|
-
formData.append('update_translations', 'true');
|
|
111
|
-
log('Starting to upload:', locale, '\n');
|
|
136
|
+
async function pushTranslations(translationsByLanguage, {
|
|
137
|
+
devLanguage,
|
|
138
|
+
branch
|
|
139
|
+
}) {
|
|
112
140
|
const {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
|
|
141
|
+
csvFileStrings,
|
|
142
|
+
keyIndex,
|
|
143
|
+
commentIndex,
|
|
144
|
+
tagColumn
|
|
145
|
+
} = translationsToCsv(translationsByLanguage, devLanguage);
|
|
146
|
+
const uploadIds = [];
|
|
147
|
+
for (const [language, csvFileString] of Object.entries(csvFileStrings)) {
|
|
148
|
+
const formData = new FormData();
|
|
149
|
+
const fileContents = Buffer.from(csvFileString);
|
|
150
|
+
formData.append('file', fileContents, {
|
|
151
|
+
contentType: 'text/csv',
|
|
152
|
+
filename: 'translations.csv'
|
|
153
|
+
});
|
|
154
|
+
formData.append('file_format', 'csv');
|
|
155
|
+
formData.append('branch', branch);
|
|
156
|
+
formData.append('update_translations', 'true');
|
|
157
|
+
formData.append('update_descriptions', 'true');
|
|
158
|
+
formData.append('locale_id', language);
|
|
159
|
+
formData.append('format_options[key_index]', keyIndex);
|
|
160
|
+
formData.append('format_options[comment_index]', commentIndex);
|
|
161
|
+
formData.append('format_options[tag_column]', tagColumn);
|
|
162
|
+
formData.append('format_options[enable_pluralization]', 'false');
|
|
163
|
+
log(`Uploading translations for language ${language}`);
|
|
164
|
+
const result = await callPhrase(`uploads`, {
|
|
165
|
+
method: 'POST',
|
|
166
|
+
body: formData
|
|
167
|
+
});
|
|
168
|
+
trace('Upload result:\n', result);
|
|
169
|
+
if (result && 'id' in result) {
|
|
170
|
+
log('Upload ID:', result.id, '\n');
|
|
171
|
+
log('Successfully Uploaded\n');
|
|
172
|
+
} else {
|
|
173
|
+
log(`Error uploading: ${result === null || result === void 0 ? void 0 : result.message}\n`);
|
|
174
|
+
log('Response:', result);
|
|
175
|
+
throw new Error('Error uploading');
|
|
176
|
+
}
|
|
177
|
+
uploadIds.push(result.id);
|
|
178
|
+
}
|
|
120
179
|
return {
|
|
121
|
-
|
|
180
|
+
uploadIds
|
|
122
181
|
};
|
|
123
182
|
}
|
|
124
|
-
async function deleteUnusedKeys(uploadId,
|
|
183
|
+
async function deleteUnusedKeys(uploadId, branch) {
|
|
125
184
|
const query = `unmentioned_in_upload:${uploadId}`;
|
|
126
185
|
const {
|
|
127
186
|
records_affected
|
|
@@ -132,7 +191,6 @@ async function deleteUnusedKeys(uploadId, locale, branch) {
|
|
|
132
191
|
},
|
|
133
192
|
body: JSON.stringify({
|
|
134
193
|
branch,
|
|
135
|
-
locale_id: locale,
|
|
136
194
|
q: query
|
|
137
195
|
})
|
|
138
196
|
});
|
|
@@ -161,57 +219,54 @@ async function pull({
|
|
|
161
219
|
trace(`Pulling translations from Phrase for languages ${config.devLanguage} and ${alternativeLanguages.join(', ')}`);
|
|
162
220
|
const phraseLanguages = Object.keys(allPhraseTranslations);
|
|
163
221
|
trace(`Found Phrase translations for languages ${phraseLanguages.join(', ')}`);
|
|
164
|
-
|
|
165
222
|
if (!phraseLanguages.includes(config.devLanguage)) {
|
|
166
223
|
throw new Error(`Phrase did not return any translations for the configured development language "${config.devLanguage}".\nPlease ensure this language is present in your Phrase project's configuration.`);
|
|
167
224
|
}
|
|
168
|
-
|
|
169
225
|
const allVocabTranslations = await loadAllTranslations({
|
|
170
226
|
fallbacks: 'none',
|
|
171
|
-
includeNodeModules: false
|
|
227
|
+
includeNodeModules: false,
|
|
228
|
+
withTags: true
|
|
172
229
|
}, config);
|
|
173
|
-
|
|
174
230
|
for (const loadedTranslation of allVocabTranslations) {
|
|
175
231
|
const devTranslations = loadedTranslation.languages[config.devLanguage];
|
|
176
|
-
|
|
177
232
|
if (!devTranslations) {
|
|
178
233
|
throw new Error('No dev language translations loaded');
|
|
179
234
|
}
|
|
180
|
-
|
|
181
|
-
|
|
235
|
+
const defaultValues = {
|
|
236
|
+
...devTranslations
|
|
182
237
|
};
|
|
183
238
|
const localKeys = Object.keys(defaultValues);
|
|
184
|
-
|
|
185
239
|
for (const key of localKeys) {
|
|
186
|
-
defaultValues[key] = {
|
|
240
|
+
defaultValues[key] = {
|
|
241
|
+
...defaultValues[key],
|
|
187
242
|
...allPhraseTranslations[config.devLanguage][getUniqueKey(key, loadedTranslation.namespace)]
|
|
188
243
|
};
|
|
189
244
|
}
|
|
190
245
|
|
|
246
|
+
// Only write a `_meta` field if necessary
|
|
247
|
+
if (Object.keys(loadedTranslation.metadata).length > 0) {
|
|
248
|
+
defaultValues._meta = loadedTranslation.metadata;
|
|
249
|
+
}
|
|
191
250
|
await writeFile(loadedTranslation.filePath, `${JSON.stringify(defaultValues, null, 2)}\n`);
|
|
192
|
-
|
|
193
251
|
for (const alternativeLanguage of alternativeLanguages) {
|
|
194
252
|
if (alternativeLanguage in allPhraseTranslations) {
|
|
195
|
-
const altTranslations = {
|
|
253
|
+
const altTranslations = {
|
|
254
|
+
...loadedTranslation.languages[alternativeLanguage]
|
|
196
255
|
};
|
|
197
256
|
const phraseAltTranslations = allPhraseTranslations[alternativeLanguage];
|
|
198
|
-
|
|
199
257
|
for (const key of localKeys) {
|
|
200
258
|
var _phraseAltTranslation;
|
|
201
|
-
|
|
202
259
|
const phraseKey = getUniqueKey(key, loadedTranslation.namespace);
|
|
203
260
|
const phraseTranslationMessage = (_phraseAltTranslation = phraseAltTranslations[phraseKey]) === null || _phraseAltTranslation === void 0 ? void 0 : _phraseAltTranslation.message;
|
|
204
|
-
|
|
205
261
|
if (!phraseTranslationMessage) {
|
|
206
262
|
trace(`Missing translation. No translation for key ${key} in phrase as ${phraseKey} in language ${alternativeLanguage}.`);
|
|
207
263
|
continue;
|
|
208
264
|
}
|
|
209
|
-
|
|
210
|
-
|
|
265
|
+
altTranslations[key] = {
|
|
266
|
+
...altTranslations[key],
|
|
211
267
|
message: phraseTranslationMessage
|
|
212
268
|
};
|
|
213
269
|
}
|
|
214
|
-
|
|
215
270
|
const altTranslationFilePath = getAltLanguageFilePath(loadedTranslation.filePath, alternativeLanguage);
|
|
216
271
|
await mkdir(path.dirname(altTranslationFilePath), {
|
|
217
272
|
recursive: true
|
|
@@ -223,7 +278,8 @@ async function pull({
|
|
|
223
278
|
}
|
|
224
279
|
|
|
225
280
|
/**
|
|
226
|
-
*
|
|
281
|
+
* Uploads translations to the Phrase API for each language.
|
|
282
|
+
* A unique namespace is appended to each key using the file path the key came from.
|
|
227
283
|
*/
|
|
228
284
|
async function push({
|
|
229
285
|
branch,
|
|
@@ -231,42 +287,50 @@ async function push({
|
|
|
231
287
|
}, config) {
|
|
232
288
|
const allLanguageTranslations = await loadAllTranslations({
|
|
233
289
|
fallbacks: 'none',
|
|
234
|
-
includeNodeModules: false
|
|
290
|
+
includeNodeModules: false,
|
|
291
|
+
withTags: true
|
|
235
292
|
}, config);
|
|
236
293
|
trace(`Pushing translations to branch ${branch}`);
|
|
237
294
|
const allLanguages = config.languages.map(v => v.name);
|
|
238
295
|
await ensureBranch(branch);
|
|
239
296
|
trace(`Pushing translations to phrase for languages ${allLanguages.join(', ')}`);
|
|
240
297
|
const phraseTranslations = {};
|
|
241
|
-
|
|
242
298
|
for (const loadedTranslation of allLanguageTranslations) {
|
|
243
299
|
for (const language of allLanguages) {
|
|
244
300
|
const localTranslations = loadedTranslation.languages[language];
|
|
245
|
-
|
|
246
301
|
if (!localTranslations) {
|
|
247
302
|
continue;
|
|
248
303
|
}
|
|
249
|
-
|
|
250
304
|
if (!phraseTranslations[language]) {
|
|
251
305
|
phraseTranslations[language] = {};
|
|
252
306
|
}
|
|
253
|
-
|
|
307
|
+
const {
|
|
308
|
+
metadata: {
|
|
309
|
+
tags: sharedTags = []
|
|
310
|
+
}
|
|
311
|
+
} = loadedTranslation;
|
|
254
312
|
for (const localKey of Object.keys(localTranslations)) {
|
|
255
313
|
const phraseKey = getUniqueKey(localKey, loadedTranslation.namespace);
|
|
256
|
-
|
|
314
|
+
const {
|
|
315
|
+
tags = [],
|
|
316
|
+
...localTranslation
|
|
317
|
+
} = localTranslations[localKey];
|
|
318
|
+
if (language === config.devLanguage) {
|
|
319
|
+
localTranslation.tags = [...tags, ...sharedTags];
|
|
320
|
+
}
|
|
321
|
+
phraseTranslations[language][phraseKey] = localTranslation;
|
|
257
322
|
}
|
|
258
323
|
}
|
|
259
324
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
325
|
+
const {
|
|
326
|
+
uploadIds
|
|
327
|
+
} = await pushTranslations(phraseTranslations, {
|
|
328
|
+
devLanguage: config.devLanguage,
|
|
329
|
+
branch
|
|
330
|
+
});
|
|
331
|
+
if (deleteUnusedKeys$1) {
|
|
332
|
+
for (const uploadId of uploadIds) {
|
|
333
|
+
await deleteUnusedKeys(uploadId, branch);
|
|
270
334
|
}
|
|
271
335
|
}
|
|
272
336
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vocab/phrase",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-push-split-translation-files-20230508031119",
|
|
4
4
|
"main": "dist/vocab-phrase.cjs.js",
|
|
5
5
|
"module": "dist/vocab-phrase.esm.js",
|
|
6
6
|
"author": "SEEK",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@vocab/core": "^1.
|
|
10
|
-
"@vocab/types": "^0.0.0-package-files-20231142931",
|
|
9
|
+
"@vocab/core": "^1.3.1",
|
|
11
10
|
"chalk": "^4.1.0",
|
|
11
|
+
"csv-stringify": "^6.2.3",
|
|
12
12
|
"debug": "^4.3.1",
|
|
13
13
|
"form-data": "^3.0.0",
|
|
14
14
|
"node-fetch": "^2.6.1"
|
|
15
15
|
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
],
|
|
19
16
|
"devDependencies": {
|
|
17
|
+
"@types/debug": "^4.1.5",
|
|
20
18
|
"@types/node-fetch": "^2.5.7"
|
|
21
|
-
}
|
|
22
|
-
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
]
|
|
23
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
# @vocab/phrase
|
|
2
|
-
|
|
3
|
-
## 0.0.0-package-files-20231142931
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- [`29c81d3`](https://github.com/seek-oss/vocab/commit/29c81d370799f631d97c45e727b8cf81453bd398) Thanks [@askoufis](https://github.com/askoufis)! - Exclude source files from package build
|
|
8
|
-
|
|
9
|
-
- Updated dependencies [[`29c81d3`](https://github.com/seek-oss/vocab/commit/29c81d370799f631d97c45e727b8cf81453bd398)]:
|
|
10
|
-
- @vocab/types@0.0.0-package-files-20231142931
|
|
11
|
-
|
|
12
|
-
## 1.1.0
|
|
13
|
-
|
|
14
|
-
### Minor Changes
|
|
15
|
-
|
|
16
|
-
- [`66ed22c`](https://github.com/seek-oss/vocab/commit/66ed22cac6f89018d5fd69fd6f6408e090e1a382) [#93](https://github.com/seek-oss/vocab/pull/93) Thanks [@askoufis](https://github.com/askoufis)! - Add an optional `deleteUnusedKeys` flag to the `push` function. If set to `true`, unused keys will be deleted from Phrase after translations are pushed.
|
|
17
|
-
|
|
18
|
-
**EXAMPLE USAGE**:
|
|
19
|
-
|
|
20
|
-
```js
|
|
21
|
-
import { push } from '@vocab/phrase';
|
|
22
|
-
|
|
23
|
-
const vocabConfig = {
|
|
24
|
-
devLanguage: 'en',
|
|
25
|
-
language: ['en', 'fr'],
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
await push({ branch: 'myBranch', deleteUnusedKeys: true }, vocabConfig);
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Patch Changes
|
|
32
|
-
|
|
33
|
-
- [`159d559`](https://github.com/seek-oss/vocab/commit/159d559c87c66c3e91c707fb45a1f67ebec07b4d) [#91](https://github.com/seek-oss/vocab/pull/91) Thanks [@askoufis](https://github.com/askoufis)! - Improve error message when Phrase doesn't return any translations for the dev language
|
|
34
|
-
|
|
35
|
-
## 1.0.1
|
|
36
|
-
|
|
37
|
-
### Patch Changes
|
|
38
|
-
|
|
39
|
-
- [`20eec77`](https://github.com/seek-oss/vocab/commit/20eec770705d05048ad8b32575cb92720b887f5b) [#76](https://github.com/seek-oss/vocab/pull/76) Thanks [@askoufis](https://github.com/askoufis)! - `vocab pull` no longer errors when phrase returns no translations for a configured language
|
|
40
|
-
|
|
41
|
-
## 1.0.0
|
|
42
|
-
|
|
43
|
-
### Major Changes
|
|
44
|
-
|
|
45
|
-
- [`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
|
|
46
|
-
|
|
47
|
-
Release Vocab as v1.0.0 to signify a stable API and support future [semver versioning](https://semver.org/) releases.
|
|
48
|
-
|
|
49
|
-
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.
|
|
50
|
-
|
|
51
|
-
### Patch Changes
|
|
52
|
-
|
|
53
|
-
- Updated dependencies [[`0074382`](https://github.com/seek-oss/vocab/commit/007438273ef70f5d5ded45777933651ad8df36f6), [`3031054`](https://github.com/seek-oss/vocab/commit/303105440851db6126f0606e1607745b27dd981c)]:
|
|
54
|
-
- @vocab/core@1.0.0
|
|
55
|
-
- @vocab/types@1.0.0
|
|
56
|
-
|
|
57
|
-
## 0.0.11
|
|
58
|
-
|
|
59
|
-
### Patch Changes
|
|
60
|
-
|
|
61
|
-
- Updated dependencies [[`5b1fdc0`](https://github.com/seek-oss/vocab/commit/5b1fdc019522b12e7ef94b2fec57b54a9310d41c)]:
|
|
62
|
-
- @vocab/core@0.0.11
|
|
63
|
-
- @vocab/types@0.0.9
|
|
64
|
-
|
|
65
|
-
## 0.0.10
|
|
66
|
-
|
|
67
|
-
### Patch Changes
|
|
68
|
-
|
|
69
|
-
- Updated dependencies [[`7c96a14`](https://github.com/seek-oss/vocab/commit/7c96a142f602132d38c1df1a47a1f4657dc5c94c)]:
|
|
70
|
-
- @vocab/core@0.0.10
|
|
71
|
-
|
|
72
|
-
## 0.0.9
|
|
73
|
-
|
|
74
|
-
### Patch Changes
|
|
75
|
-
|
|
76
|
-
- Updated dependencies [[`3034bd3`](https://github.com/seek-oss/vocab/commit/3034bd3de610a9d1f3bfbd8caefa27064dee2710), [`c110745`](https://github.com/seek-oss/vocab/commit/c110745b79df1a8ade6b1d8a49e798b04a7b95e1)]:
|
|
77
|
-
- @vocab/core@0.0.9
|
|
78
|
-
|
|
79
|
-
## 0.0.8
|
|
80
|
-
|
|
81
|
-
### Patch Changes
|
|
82
|
-
|
|
83
|
-
- Updated dependencies [[`f2fca67`](https://github.com/seek-oss/vocab/commit/f2fca679c66ae65405a0aa24f0a0e472026aad0d)]:
|
|
84
|
-
- @vocab/core@0.0.8
|
|
85
|
-
- @vocab/types@0.0.8
|
|
86
|
-
|
|
87
|
-
## 0.0.7
|
|
88
|
-
|
|
89
|
-
### Patch Changes
|
|
90
|
-
|
|
91
|
-
- [`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
|
|
92
|
-
|
|
93
|
-
- Updated dependencies [[`283bcad`](https://github.com/seek-oss/vocab/commit/283bcada06e622ab14ed891743ed3f55cf09e245), [`ad0d240`](https://github.com/seek-oss/vocab/commit/ad0d2404545ded8e11621eae8f29467ff3352366), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb), [`f3992ef`](https://github.com/seek-oss/vocab/commit/f3992efbf08939ebf853fac650a49cc46dc51dfb)]:
|
|
94
|
-
- @vocab/core@0.0.7
|
|
95
|
-
- @vocab/types@0.0.7
|
|
96
|
-
|
|
97
|
-
## 0.0.6
|
|
98
|
-
|
|
99
|
-
### Patch Changes
|
|
100
|
-
|
|
101
|
-
- [`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
|
|
102
|
-
|
|
103
|
-
* [`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
|
|
104
|
-
|
|
105
|
-
* Updated dependencies [[`80a46c0`](https://github.com/seek-oss/vocab/commit/80a46c01a55408675f5822c3618519f80136c3ab), [`80a46c0`](https://github.com/seek-oss/vocab/commit/80a46c01a55408675f5822c3618519f80136c3ab)]:
|
|
106
|
-
- @vocab/core@0.0.6
|
|
107
|
-
- @vocab/types@0.0.6
|
|
108
|
-
|
|
109
|
-
## 0.0.5
|
|
110
|
-
|
|
111
|
-
### Patch Changes
|
|
112
|
-
|
|
113
|
-
- Updated dependencies [[`371ed16`](https://github.com/seek-oss/vocab/commit/371ed16a232a04dab13afa7e2b352dfb6724eea4), [`c222d68`](https://github.com/seek-oss/vocab/commit/c222d68a3c0c24723a338eccb959798881f6a118)]:
|
|
114
|
-
- @vocab/core@0.0.5
|
|
115
|
-
|
|
116
|
-
## 0.0.4
|
|
117
|
-
|
|
118
|
-
### Patch Changes
|
|
119
|
-
|
|
120
|
-
- [`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`.
|
|
121
|
-
|
|
122
|
-
The new `vocab compile` step replaces `vocab generate-types` in creating a fully functional **translations.ts** file.
|
|
123
|
-
|
|
124
|
-
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.
|
|
125
|
-
|
|
126
|
-
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.
|
|
127
|
-
|
|
128
|
-
See the [documentation](https://github.com/seek-oss/vocab) for further usage details.
|
|
129
|
-
|
|
130
|
-
* [`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
|
|
131
|
-
|
|
132
|
-
* Updated dependencies [[`5f5c581`](https://github.com/seek-oss/vocab/commit/5f5c581a65bff28729ee19e1ec0bdea488a9d6c2), [`02f943c`](https://github.com/seek-oss/vocab/commit/02f943ca892913b41f9e4720a72400777cf14b3d)]:
|
|
133
|
-
- @vocab/core@0.0.4
|
|
134
|
-
- @vocab/types@0.0.5
|
|
135
|
-
|
|
136
|
-
## 0.0.3
|
|
137
|
-
|
|
138
|
-
### Patch Changes
|
|
139
|
-
|
|
140
|
-
- [`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
|
|
141
|
-
|
|
142
|
-
* [`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
|
|
143
|
-
|
|
144
|
-
* Updated dependencies [[`08de30d`](https://github.com/seek-oss/vocab/commit/08de30d338c2a5ebdcf14da7c736dddf22e7ca9e), [`ed6cf40`](https://github.com/seek-oss/vocab/commit/ed6cf408973f2e9c4d07a71fcb52f40294ebaf65), [`26b52f4`](https://github.com/seek-oss/vocab/commit/26b52f4878ded440841e08c858bdc9e685500c2a), [`b5a5a05`](https://github.com/seek-oss/vocab/commit/b5a5a05a5bb87b48e6e9160af75f555728143ea2)]:
|
|
145
|
-
- @vocab/core@0.0.3
|
|
146
|
-
- @vocab/types@0.0.4
|
|
147
|
-
|
|
148
|
-
## 0.0.2
|
|
149
|
-
|
|
150
|
-
### Patch Changes
|
|
151
|
-
|
|
152
|
-
- Updated dependencies [[`4710f34`](https://github.com/seek-oss/vocab/commit/4710f341f2827643e3eff69ef7e26d44ec6e8a2b), [`4710f34`](https://github.com/seek-oss/vocab/commit/4710f341f2827643e3eff69ef7e26d44ec6e8a2b)]:
|
|
153
|
-
- @vocab/types@0.0.3
|
|
154
|
-
- @vocab/core@0.0.2
|