diff options
Diffstat (limited to 'src/locale/helpers.ts')
-rw-r--r-- | src/locale/helpers.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts index 4b9002586..bce4e6590 100644 --- a/src/locale/helpers.ts +++ b/src/locale/helpers.ts @@ -18,6 +18,11 @@ export function code3ToCode2(lang: string): string { return lang } +export function codeToLanguageName(lang: string): string { + const lang2 = code3ToCode2(lang) + return LANGUAGES_MAP_CODE2[lang2]?.name || lang +} + export function getPostLanguage( post: AppBskyFeedDefs.PostView, ): string | undefined { |