-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance(l10n): localize en-US link title (#11011)
Co-authored-by: Leonid Vinogradov <win.leon@protonmail.com>
- Loading branch information
Showing
5 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Locale } from "../types/core.js"; | ||
|
||
type LocaleStringMap = Record<Locale, string>; | ||
|
||
function localeString(strings: LocaleStringMap) { | ||
return (locale: string) => strings[locale] ?? strings["en-US"]; | ||
} | ||
|
||
export const ONLY_AVAILABLE_IN_ENGLISH = localeString({ | ||
"en-US": "This page is currently only available in English", | ||
es: "Esta página está disponible solo en inglés", | ||
fr: "Cette page est actuellement disponible uniquement en anglais", | ||
ja: "このページは現在、英語のみで利用可能です。", | ||
ko: "이 페이지는 현재 영어로만 제공됩니다", | ||
"pt-BR": "Esta página está disponível apenas em inglês no momento", | ||
ru: "В настоящее время эта страница доступна только на английском языке", | ||
"zh-CN": "此页面目前仅提供英文版本", | ||
"zh-TW": "此頁面目前僅提供英文版本", | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export type Locale = | ||
| "en-US" | ||
| "es" | ||
| "fr" | ||
| "ja" | ||
| "ko" | ||
| "pt-BR" | ||
| "ru" | ||
| "zh-CN" | ||
| "zh-TW"; | ||
export type TranslatedLocale = Exclude<Locale, "en-US">; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters