bcp47-language-tags 1.0.5 → 1.0.7

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/README.md CHANGED
@@ -9,6 +9,7 @@ list of language tags and typescript type for the `BCP-47` standard.
9
9
  ```typescript
10
10
  import { tags } from 'bcp-language-tags/en';
11
11
 
12
+ // list of language tags
12
13
  for(let tag of tags) {
13
14
  console.log(tag);
14
15
  }
@@ -64,9 +65,11 @@ import { tags } from 'bcp-language-tags/ru';
64
65
  import { tags } from 'bcp-language-tags/ar';
65
66
  import { tags } from 'bcp-language-tags/pt';
66
67
  import { tags } from 'bcp-language-tags/nl';
68
+ ```
67
69
 
70
+ ### List of all language tags
68
71
 
69
- //
72
+ ```typescript
70
73
  import allTags from 'bcp-language-tags';
71
74
  // {
72
75
  // "zh-CN": {
@@ -136,7 +139,11 @@ export type BCP47LanguageTag = {
136
139
  export type BCP47LanguageTags = Record<BCP47LanguageTagName,BCP47LanguageTag>
137
140
  ```
138
141
 
139
- ### API
142
+ ## API
143
+
144
+ ### getTag(tag: string): BCP47LanguageTag
145
+
146
+ get language tag.
140
147
 
141
148
  ```typescript
142
149
 
@@ -155,7 +162,13 @@ getTag('en-US')
155
162
  getTag('zh')
156
163
  // {"tag": "en-US", "name": "English (United States)", "nativeName": "English (United States)", "primary": true}
157
164
  getTag('en')
165
+ ```
166
+
167
+ ### getTags(tag: string): BCP47LanguageTag[]
158
168
 
169
+ list of language tags.
170
+
171
+ ```typescript
159
172
  // return all language tags
160
173
  getTags("zh")
161
174
  // output:
@@ -169,9 +182,19 @@ getTags("zh")
169
182
  // {"tag": "zh-CHT", "name": "Chinese (Traditional)", "nativeName": "繁體中文 (Traditional Chinese)"}
170
183
  // ]
171
184
 
185
+ getTags(["zh","en"])
186
+
187
+ getTags(["zh-CN","en-US"])
188
+
189
+ ```
190
+
191
+ ### getPrimaryTags(): BCP47LanguageTag[]
192
+
193
+ list of primary language tags.
194
+
195
+ ```typescript
172
196
  // return primary language tags
173
197
  getPrimaryTags()
174
-
175
198
  [
176
199
  {"tag": "zh-CN", "name": "Chinese (Simplified)", "nativeName": "简体中文", "primary": true},
177
200
  {"tag": "en-US", "name": "English (United States)", "nativeName": "English (United States)", "primary": true}
@@ -186,6 +209,25 @@ getPrimaryTags()
186
209
  {"tag": "pt-PT", "name": "Portuguese (Portugal)", "nativeName": "Português (Portugal)", "primary": true },
187
210
  {"tag": "ar-EG", "name": "Arabic (Egypt)", "nativeName": "العربية (مصر)", "primary": true }
188
211
  ]
212
+ ```
189
213
 
190
214
 
191
- ```
215
+
216
+ # Recommendation
217
+
218
+ - [Internationalization Solution for React/Vue/Nodejs/Solidjs - VoerkaI18n](https://zhangfisher.github.io/voerka-i18n/)
219
+ - [React State Library - AutoStore](https://zhangfisher.github.io/autostore/)
220
+ - [Terminal Interface Development Enhancement Library - Logsets](https://zhangfisher.github.io/logsets/)
221
+ - [Log Output Library - VoerkaLogger](https://zhangfisher.github.io/voerkalogger/)
222
+ - [Decorator Development - FlexDecorators](https://zhangfisher.github.io/flex-decorators/)
223
+ - [Finite State Machine Library - FlexState](https://zhangfisher.github.io/flexstate/)
224
+ - [Universal Function Tool Library - FlexTools](https://zhangfisher.github.io/flex-tools/)
225
+ - [CSS-IN-JS Library - FlexStyled](https://zhangfisher.github.io/flexstyled/)
226
+ - [VSCode Plugin for Adding Comments to JSON Files - json_comments_extension](https://github.com/zhangfisher/json_comments_extension)
227
+ - [Library for Developing Interactive Command Line Programs - mixcli](https://github.com/zhangfisher/mixcli)
228
+ - [Powerful String Interpolation Variable Processing Tool Library - flexvars](https://github.com/zhangfisher/flexvars)
229
+ - [Frontend Link Debugging Assistant Tool - yald](https://github.com/zhangfisher/yald)
230
+ - [Asynchronous Signal - asyncsignal](https://github.com/zhangfisher/asyncsignal)
231
+ - [bundle Vue styles into JavaScript - vite-plugin-vue-style-bundler ](https://github.com/zhangfisher/vite-plugin-vue-style-bundler)
232
+ - [Tree Component- LiteTree](https://github.com/zhangfisher/lite-tree)
233
+
package/dist/ar.d.mts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/ar.d.ts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/ar.js CHANGED
@@ -52,11 +52,14 @@ function createTagUtils(tags2) {
52
52
  },
53
53
  getTags(language) {
54
54
  if (!language) return Object.values(tags2);
55
+ const lngs = Array.isArray(language) ? language : [language];
55
56
  const matchedTags = [];
56
57
  Object.entries(tags2).filter(([name, tag]) => {
57
- if (name.startsWith(language + "-")) {
58
- matchedTags.push(tag);
59
- }
58
+ lngs.forEach((lng) => {
59
+ if (name === lng || name.startsWith(lng + "-")) {
60
+ matchedTags.push(tag);
61
+ }
62
+ });
60
63
  });
61
64
  return matchedTags;
62
65
  },
package/dist/ar.mjs CHANGED
@@ -23,11 +23,14 @@ function createTagUtils(tags2) {
23
23
  },
24
24
  getTags(language) {
25
25
  if (!language) return Object.values(tags2);
26
+ const lngs = Array.isArray(language) ? language : [language];
26
27
  const matchedTags = [];
27
28
  Object.entries(tags2).filter(([name, tag]) => {
28
- if (name.startsWith(language + "-")) {
29
- matchedTags.push(tag);
30
- }
29
+ lngs.forEach((lng) => {
30
+ if (name === lng || name.startsWith(lng + "-")) {
31
+ matchedTags.push(tag);
32
+ }
33
+ });
31
34
  });
32
35
  return matchedTags;
33
36
  },
package/dist/de.d.mts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/de.d.ts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/de.js CHANGED
@@ -52,11 +52,14 @@ function createTagUtils(tags2) {
52
52
  },
53
53
  getTags(language) {
54
54
  if (!language) return Object.values(tags2);
55
+ const lngs = Array.isArray(language) ? language : [language];
55
56
  const matchedTags = [];
56
57
  Object.entries(tags2).filter(([name, tag]) => {
57
- if (name.startsWith(language + "-")) {
58
- matchedTags.push(tag);
59
- }
58
+ lngs.forEach((lng) => {
59
+ if (name === lng || name.startsWith(lng + "-")) {
60
+ matchedTags.push(tag);
61
+ }
62
+ });
60
63
  });
61
64
  return matchedTags;
62
65
  },
package/dist/de.mjs CHANGED
@@ -23,11 +23,14 @@ function createTagUtils(tags2) {
23
23
  },
24
24
  getTags(language) {
25
25
  if (!language) return Object.values(tags2);
26
+ const lngs = Array.isArray(language) ? language : [language];
26
27
  const matchedTags = [];
27
28
  Object.entries(tags2).filter(([name, tag]) => {
28
- if (name.startsWith(language + "-")) {
29
- matchedTags.push(tag);
30
- }
29
+ lngs.forEach((lng) => {
30
+ if (name === lng || name.startsWith(lng + "-")) {
31
+ matchedTags.push(tag);
32
+ }
33
+ });
31
34
  });
32
35
  return matchedTags;
33
36
  },
package/dist/en.d.mts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/en.d.ts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/en.js CHANGED
@@ -52,11 +52,14 @@ function createTagUtils(tags2) {
52
52
  },
53
53
  getTags(language) {
54
54
  if (!language) return Object.values(tags2);
55
+ const lngs = Array.isArray(language) ? language : [language];
55
56
  const matchedTags = [];
56
57
  Object.entries(tags2).filter(([name, tag]) => {
57
- if (name.startsWith(language + "-")) {
58
- matchedTags.push(tag);
59
- }
58
+ lngs.forEach((lng) => {
59
+ if (name === lng || name.startsWith(lng + "-")) {
60
+ matchedTags.push(tag);
61
+ }
62
+ });
60
63
  });
61
64
  return matchedTags;
62
65
  },
package/dist/en.mjs CHANGED
@@ -23,11 +23,14 @@ function createTagUtils(tags2) {
23
23
  },
24
24
  getTags(language) {
25
25
  if (!language) return Object.values(tags2);
26
+ const lngs = Array.isArray(language) ? language : [language];
26
27
  const matchedTags = [];
27
28
  Object.entries(tags2).filter(([name, tag]) => {
28
- if (name.startsWith(language + "-")) {
29
- matchedTags.push(tag);
30
- }
29
+ lngs.forEach((lng) => {
30
+ if (name === lng || name.startsWith(lng + "-")) {
31
+ matchedTags.push(tag);
32
+ }
33
+ });
31
34
  });
32
35
  return matchedTags;
33
36
  },
package/dist/es.d.mts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/es.d.ts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/es.js CHANGED
@@ -52,11 +52,14 @@ function createTagUtils(tags2) {
52
52
  },
53
53
  getTags(language) {
54
54
  if (!language) return Object.values(tags2);
55
+ const lngs = Array.isArray(language) ? language : [language];
55
56
  const matchedTags = [];
56
57
  Object.entries(tags2).filter(([name, tag]) => {
57
- if (name.startsWith(language + "-")) {
58
- matchedTags.push(tag);
59
- }
58
+ lngs.forEach((lng) => {
59
+ if (name === lng || name.startsWith(lng + "-")) {
60
+ matchedTags.push(tag);
61
+ }
62
+ });
60
63
  });
61
64
  return matchedTags;
62
65
  },
package/dist/es.mjs CHANGED
@@ -23,11 +23,14 @@ function createTagUtils(tags2) {
23
23
  },
24
24
  getTags(language) {
25
25
  if (!language) return Object.values(tags2);
26
+ const lngs = Array.isArray(language) ? language : [language];
26
27
  const matchedTags = [];
27
28
  Object.entries(tags2).filter(([name, tag]) => {
28
- if (name.startsWith(language + "-")) {
29
- matchedTags.push(tag);
30
- }
29
+ lngs.forEach((lng) => {
30
+ if (name === lng || name.startsWith(lng + "-")) {
31
+ matchedTags.push(tag);
32
+ }
33
+ });
31
34
  });
32
35
  return matchedTags;
33
36
  },
package/dist/fr.d.mts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/fr.d.ts CHANGED
@@ -6,6 +6,8 @@ type BCP47LanguageTag = {
6
6
  primary: boolean;
7
7
  };
8
8
  type BCP47LanguageTags = Record<BCP47LanguageTagName, BCP47LanguageTag>;
9
+ type PrimaryLanguageTags = "zh-CN" | "en-US" | "ja-JP" | "ko-KR" | "ru-RU" | "es-ES" | "fr-FR" | "de-DE" | "it-IT" | "ar-EG" | "pt-PT" | "nl-NL";
10
+ type PrimaryLanguageTages = Record<PrimaryLanguageTags, BCP47LanguageTags>;
9
11
 
10
12
  declare const tags: {
11
13
  "zh-CN": {
@@ -760,7 +762,7 @@ declare const tags: {
760
762
  };
761
763
  };
762
764
  declare const getTag: (tag: string) => BCP47LanguageTag | undefined;
763
- declare const getTags: (language?: string) => BCP47LanguageTag[];
765
+ declare const getTags: (language?: string | string[]) => BCP47LanguageTag[];
764
766
  declare const getPrimaryTags: () => BCP47LanguageTag[];
765
767
 
766
- export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, getPrimaryTags, getTag, getTags, tags };
768
+ export { type BCP47LanguageTag, type BCP47LanguageTagName, type BCP47LanguageTags, type PrimaryLanguageTages, type PrimaryLanguageTags, getPrimaryTags, getTag, getTags, tags };
package/dist/fr.js CHANGED
@@ -52,11 +52,14 @@ function createTagUtils(tags2) {
52
52
  },
53
53
  getTags(language) {
54
54
  if (!language) return Object.values(tags2);
55
+ const lngs = Array.isArray(language) ? language : [language];
55
56
  const matchedTags = [];
56
57
  Object.entries(tags2).filter(([name, tag]) => {
57
- if (name.startsWith(language + "-")) {
58
- matchedTags.push(tag);
59
- }
58
+ lngs.forEach((lng) => {
59
+ if (name === lng || name.startsWith(lng + "-")) {
60
+ matchedTags.push(tag);
61
+ }
62
+ });
60
63
  });
61
64
  return matchedTags;
62
65
  },
package/dist/fr.mjs CHANGED
@@ -23,11 +23,14 @@ function createTagUtils(tags2) {
23
23
  },
24
24
  getTags(language) {
25
25
  if (!language) return Object.values(tags2);
26
+ const lngs = Array.isArray(language) ? language : [language];
26
27
  const matchedTags = [];
27
28
  Object.entries(tags2).filter(([name, tag]) => {
28
- if (name.startsWith(language + "-")) {
29
- matchedTags.push(tag);
30
- }
29
+ lngs.forEach((lng) => {
30
+ if (name === lng || name.startsWith(lng + "-")) {
31
+ matchedTags.push(tag);
32
+ }
33
+ });
31
34
  });
32
35
  return matchedTags;
33
36
  },