-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhance(l10n): localize en-US link title #11011
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d9f84a5
enhance(l10n): localize en-US link title
caugner a9de3e3
test: update expectation
caugner e6be311
Update libs/l10n/l10n.ts
caugner 264750f
chore(l10n): remove periods
caugner d73040e
fixup! chore(l10n): remove periods
caugner 8f33cc6
refactor(libs): move Locale types to types
caugner 580c0a0
refactor(l10n): simplify {Strings => LocaleStringMap}
caugner 3ae5d78
refactor(l10n): rename {local => locale}String()
caugner 8f0236c
fix(kumascript): escape title
caugner ca64e36
chore(kumascript): remove unused import
caugner 307d53a
Merge branch 'main' into localize-en-us-link-title
caugner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mdn/yari-content-ja Can you please check this translation? 🙏