@adminforth/i18n 1.0.23-next.1 → 1.0.23-next.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.
Files changed (3) hide show
  1. package/dist/index.js +12 -0
  2. package/index.ts +16 -0
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -674,6 +674,18 @@ ${JSON.stringify(strings.reduce((acc, s) => {
674
674
  return translations;
675
675
  });
676
676
  }
677
+ languagesList() {
678
+ return __awaiter(this, void 0, void 0, function* () {
679
+ return this.options.supportedLanguages.map((lang) => {
680
+ return {
681
+ code: lang,
682
+ nameOnNative: iso6391.getNativeName(lang),
683
+ nameEnglish: iso6391.getName(lang),
684
+ emojiFlag: lang.toUpperCase().replace(/./g, char => String.fromCodePoint(char.charCodeAt(0) + 127397)),
685
+ };
686
+ });
687
+ });
688
+ }
677
689
  feedCategoryTranslations(messages, category) {
678
690
  return __awaiter(this, void 0, void 0, function* () {
679
691
  const adminforth = this.adminforth;
package/index.ts CHANGED
@@ -796,6 +796,22 @@ JSON.stringify(strings.reduce((acc: object, s: { en_string: string }): object =>
796
796
  return translations;
797
797
  }
798
798
 
799
+ async languagesList(): Promise<{
800
+ code: LanguageCode;
801
+ nameOnNative: string;
802
+ nameEnglish: string;
803
+ emojiFlag: string;
804
+ }[]> {
805
+ return this.options.supportedLanguages.map((lang) => {
806
+ return {
807
+ code: lang as LanguageCode,
808
+ nameOnNative: iso6391.getNativeName(lang),
809
+ nameEnglish: iso6391.getName(lang),
810
+ emojiFlag: lang.toUpperCase().replace(/./g, char => String.fromCodePoint(char.charCodeAt(0) + 127397)),
811
+ };
812
+ });
813
+ }
814
+
799
815
  async feedCategoryTranslations(messages: {
800
816
  en_string: string;
801
817
  source: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/i18n",
3
- "version": "1.0.23-next.1",
3
+ "version": "1.0.23-next.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",