@lingo.dev/_spec 0.26.0 → 0.26.2
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/build/index.cjs +14 -12
- package/build/index.d.cts +4 -3
- package/build/index.d.ts +4 -3
- package/build/index.mjs +14 -12
- package/package.json +1 -1
package/build/index.cjs
CHANGED
@@ -193,8 +193,14 @@ var localeMap = {
|
|
193
193
|
sw: [
|
194
194
|
"sw-TZ",
|
195
195
|
// Tanzania
|
196
|
-
"sw-KE"
|
196
|
+
"sw-KE",
|
197
197
|
// Kenya
|
198
|
+
"sw-UG",
|
199
|
+
// Uganda
|
200
|
+
"sw-CD",
|
201
|
+
// Democratic Republic of Congo
|
202
|
+
"sw-RW"
|
203
|
+
// Rwanda
|
198
204
|
],
|
199
205
|
// Persian (Iran)
|
200
206
|
fa: ["fa-IR"],
|
@@ -237,7 +243,9 @@ var localeMap = {
|
|
237
243
|
// Tagalog (Philippines)
|
238
244
|
tl: ["tl-PH"],
|
239
245
|
// Telugu (India)
|
240
|
-
te: ["te-IN"]
|
246
|
+
te: ["te-IN"],
|
247
|
+
// Kinyarwanda (Rwanda)
|
248
|
+
rw: ["rw-RW"]
|
241
249
|
};
|
242
250
|
var localeCodesShort = Object.keys(localeMap);
|
243
251
|
var localeCodesFull = Object.values(localeMap).flat();
|
@@ -269,15 +277,6 @@ var resolveLocaleCode = (value) => {
|
|
269
277
|
}
|
270
278
|
throw new Error(`Invalid locale code: ${value}`);
|
271
279
|
};
|
272
|
-
var getAlternativeLocaleCodes = (locale) => {
|
273
|
-
if (locale.includes("-")) {
|
274
|
-
return [locale.replace(/-/g, "_")];
|
275
|
-
} else if (locale.includes("_")) {
|
276
|
-
return [locale.replace(/_/g, "-")];
|
277
|
-
} else {
|
278
|
-
return [];
|
279
|
-
}
|
280
|
-
};
|
281
280
|
var getLocaleCodeDelimiter = (locale) => {
|
282
281
|
if (locale.includes("_")) {
|
283
282
|
return "_";
|
@@ -297,6 +296,9 @@ var resolveOverridenLocale = (locale, delimiter) => {
|
|
297
296
|
}
|
298
297
|
return locale.replace(currentDelimiter, delimiter);
|
299
298
|
};
|
299
|
+
function normalizeLocale(locale) {
|
300
|
+
return locale.replaceAll("_", "-").replace(/([a-z]{2,3}-)r/, "$1");
|
301
|
+
}
|
300
302
|
|
301
303
|
// src/formats.ts
|
302
304
|
|
@@ -523,4 +525,4 @@ var defaultConfig = LATEST_CONFIG_DEFINITION.defaultValue;
|
|
523
525
|
|
524
526
|
|
525
527
|
|
526
|
-
exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; exports.configV0Definition = configV0Definition; exports.configV1Definition = configV1Definition; exports.configV1_1Definition = configV1_1Definition; exports.configV1_2Definition = configV1_2Definition; exports.configV1_3Definition = configV1_3Definition; exports.configV1_4Definition = configV1_4Definition; exports.defaultConfig = defaultConfig; exports.
|
528
|
+
exports.LATEST_CONFIG_DEFINITION = LATEST_CONFIG_DEFINITION; exports.bucketItemSchema = bucketItemSchema; exports.bucketTypeSchema = bucketTypeSchema; exports.bucketTypes = bucketTypes; exports.configV0Definition = configV0Definition; exports.configV1Definition = configV1Definition; exports.configV1_1Definition = configV1_1Definition; exports.configV1_2Definition = configV1_2Definition; exports.configV1_3Definition = configV1_3Definition; exports.configV1_4Definition = configV1_4Definition; exports.defaultConfig = defaultConfig; exports.getLocaleCodeDelimiter = getLocaleCodeDelimiter; exports.localeCodeSchema = localeCodeSchema; exports.localeCodes = localeCodes; exports.localeCodesFull = localeCodesFull; exports.localeCodesFullExplicitRegion = localeCodesFullExplicitRegion; exports.localeCodesFullUnderscore = localeCodesFullUnderscore; exports.localeCodesShort = localeCodesShort; exports.localeSchema = localeSchema; exports.normalizeLocale = normalizeLocale; exports.parseI18nConfig = parseI18nConfig; exports.resolveLocaleCode = resolveLocaleCode; exports.resolveOverridenLocale = resolveOverridenLocale;
|
package/build/index.d.cts
CHANGED
@@ -46,7 +46,7 @@ declare const localeMap: {
|
|
46
46
|
readonly no: readonly ["no-NO", "nb-NO", "nn-NO"];
|
47
47
|
readonly ro: readonly ["ro-RO"];
|
48
48
|
readonly sk: readonly ["sk-SK"];
|
49
|
-
readonly sw: readonly ["sw-TZ", "sw-KE"];
|
49
|
+
readonly sw: readonly ["sw-TZ", "sw-KE", "sw-UG", "sw-CD", "sw-RW"];
|
50
50
|
readonly fa: readonly ["fa-IR"];
|
51
51
|
readonly fil: readonly ["fil-PH"];
|
52
52
|
readonly pa: readonly ["pa-IN", "pa-PK"];
|
@@ -63,6 +63,7 @@ declare const localeMap: {
|
|
63
63
|
readonly zgh: readonly ["zgh-MA"];
|
64
64
|
readonly tl: readonly ["tl-PH"];
|
65
65
|
readonly te: readonly ["te-IN"];
|
66
|
+
readonly rw: readonly ["rw-RW"];
|
66
67
|
};
|
67
68
|
type LocaleCodeShort = keyof typeof localeMap;
|
68
69
|
type LocaleCodeFull = (typeof localeMap)[LocaleCodeShort][number];
|
@@ -74,9 +75,9 @@ declare const localeCodesFullExplicitRegion: string[];
|
|
74
75
|
declare const localeCodes: LocaleCode[];
|
75
76
|
declare const localeCodeSchema: Z.ZodEffects<Z.ZodString, string, string>;
|
76
77
|
declare const resolveLocaleCode: (value: LocaleCode) => LocaleCodeFull;
|
77
|
-
declare const getAlternativeLocaleCodes: (locale: string) => string[];
|
78
78
|
declare const getLocaleCodeDelimiter: (locale: string) => string | null;
|
79
79
|
declare const resolveOverridenLocale: (locale: string, delimiter?: "-" | "_" | null) => string;
|
80
|
+
declare function normalizeLocale(locale: string): string;
|
80
81
|
|
81
82
|
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"];
|
82
83
|
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>;
|
@@ -482,4 +483,4 @@ declare const defaultConfig: {
|
|
482
483
|
$schema: string;
|
483
484
|
};
|
484
485
|
|
485
|
-
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig,
|
486
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
package/build/index.d.ts
CHANGED
@@ -46,7 +46,7 @@ declare const localeMap: {
|
|
46
46
|
readonly no: readonly ["no-NO", "nb-NO", "nn-NO"];
|
47
47
|
readonly ro: readonly ["ro-RO"];
|
48
48
|
readonly sk: readonly ["sk-SK"];
|
49
|
-
readonly sw: readonly ["sw-TZ", "sw-KE"];
|
49
|
+
readonly sw: readonly ["sw-TZ", "sw-KE", "sw-UG", "sw-CD", "sw-RW"];
|
50
50
|
readonly fa: readonly ["fa-IR"];
|
51
51
|
readonly fil: readonly ["fil-PH"];
|
52
52
|
readonly pa: readonly ["pa-IN", "pa-PK"];
|
@@ -63,6 +63,7 @@ declare const localeMap: {
|
|
63
63
|
readonly zgh: readonly ["zgh-MA"];
|
64
64
|
readonly tl: readonly ["tl-PH"];
|
65
65
|
readonly te: readonly ["te-IN"];
|
66
|
+
readonly rw: readonly ["rw-RW"];
|
66
67
|
};
|
67
68
|
type LocaleCodeShort = keyof typeof localeMap;
|
68
69
|
type LocaleCodeFull = (typeof localeMap)[LocaleCodeShort][number];
|
@@ -74,9 +75,9 @@ declare const localeCodesFullExplicitRegion: string[];
|
|
74
75
|
declare const localeCodes: LocaleCode[];
|
75
76
|
declare const localeCodeSchema: Z.ZodEffects<Z.ZodString, string, string>;
|
76
77
|
declare const resolveLocaleCode: (value: LocaleCode) => LocaleCodeFull;
|
77
|
-
declare const getAlternativeLocaleCodes: (locale: string) => string[];
|
78
78
|
declare const getLocaleCodeDelimiter: (locale: string) => string | null;
|
79
79
|
declare const resolveOverridenLocale: (locale: string, delimiter?: "-" | "_" | null) => string;
|
80
|
+
declare function normalizeLocale(locale: string): string;
|
80
81
|
|
81
82
|
declare const bucketTypes: readonly ["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"];
|
82
83
|
declare const bucketTypeSchema: Z.ZodEnum<["android", "csv", "flutter", "html", "json", "markdown", "xcode-strings", "xcode-stringsdict", "xcode-xcstrings", "yaml", "yaml-root-key", "properties", "po", "xliff", "xml", "srt", "dato", "compiler", "vtt", "php", "po", "vue-json"]>;
|
@@ -482,4 +483,4 @@ declare const defaultConfig: {
|
|
482
483
|
$schema: string;
|
483
484
|
};
|
484
485
|
|
485
|
-
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig,
|
486
|
+
export { type BucketItem, type I18nConfig, LATEST_CONFIG_DEFINITION, type LocaleCode, type LocaleCodeFull, type LocaleCodeShort, bucketItemSchema, bucketTypeSchema, bucketTypes, configV0Definition, configV1Definition, configV1_1Definition, configV1_2Definition, configV1_3Definition, configV1_4Definition, defaultConfig, getLocaleCodeDelimiter, localeCodeSchema, localeCodes, localeCodesFull, localeCodesFullExplicitRegion, localeCodesFullUnderscore, localeCodesShort, localeSchema, normalizeLocale, parseI18nConfig, resolveLocaleCode, resolveOverridenLocale };
|
package/build/index.mjs
CHANGED
@@ -193,8 +193,14 @@ var localeMap = {
|
|
193
193
|
sw: [
|
194
194
|
"sw-TZ",
|
195
195
|
// Tanzania
|
196
|
-
"sw-KE"
|
196
|
+
"sw-KE",
|
197
197
|
// Kenya
|
198
|
+
"sw-UG",
|
199
|
+
// Uganda
|
200
|
+
"sw-CD",
|
201
|
+
// Democratic Republic of Congo
|
202
|
+
"sw-RW"
|
203
|
+
// Rwanda
|
198
204
|
],
|
199
205
|
// Persian (Iran)
|
200
206
|
fa: ["fa-IR"],
|
@@ -237,7 +243,9 @@ var localeMap = {
|
|
237
243
|
// Tagalog (Philippines)
|
238
244
|
tl: ["tl-PH"],
|
239
245
|
// Telugu (India)
|
240
|
-
te: ["te-IN"]
|
246
|
+
te: ["te-IN"],
|
247
|
+
// Kinyarwanda (Rwanda)
|
248
|
+
rw: ["rw-RW"]
|
241
249
|
};
|
242
250
|
var localeCodesShort = Object.keys(localeMap);
|
243
251
|
var localeCodesFull = Object.values(localeMap).flat();
|
@@ -269,15 +277,6 @@ var resolveLocaleCode = (value) => {
|
|
269
277
|
}
|
270
278
|
throw new Error(`Invalid locale code: ${value}`);
|
271
279
|
};
|
272
|
-
var getAlternativeLocaleCodes = (locale) => {
|
273
|
-
if (locale.includes("-")) {
|
274
|
-
return [locale.replace(/-/g, "_")];
|
275
|
-
} else if (locale.includes("_")) {
|
276
|
-
return [locale.replace(/_/g, "-")];
|
277
|
-
} else {
|
278
|
-
return [];
|
279
|
-
}
|
280
|
-
};
|
281
280
|
var getLocaleCodeDelimiter = (locale) => {
|
282
281
|
if (locale.includes("_")) {
|
283
282
|
return "_";
|
@@ -297,6 +296,9 @@ var resolveOverridenLocale = (locale, delimiter) => {
|
|
297
296
|
}
|
298
297
|
return locale.replace(currentDelimiter, delimiter);
|
299
298
|
};
|
299
|
+
function normalizeLocale(locale) {
|
300
|
+
return locale.replaceAll("_", "-").replace(/([a-z]{2,3}-)r/, "$1");
|
301
|
+
}
|
300
302
|
|
301
303
|
// src/formats.ts
|
302
304
|
import Z2 from "zod";
|
@@ -511,7 +513,6 @@ export {
|
|
511
513
|
configV1_3Definition,
|
512
514
|
configV1_4Definition,
|
513
515
|
defaultConfig,
|
514
|
-
getAlternativeLocaleCodes,
|
515
516
|
getLocaleCodeDelimiter,
|
516
517
|
localeCodeSchema,
|
517
518
|
localeCodes,
|
@@ -520,6 +521,7 @@ export {
|
|
520
521
|
localeCodesFullUnderscore,
|
521
522
|
localeCodesShort,
|
522
523
|
localeSchema,
|
524
|
+
normalizeLocale,
|
523
525
|
parseI18nConfig,
|
524
526
|
resolveLocaleCode,
|
525
527
|
resolveOverridenLocale
|