Skip to content

Commit

Permalink
enhance(i18n): localize "(en-US)" suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Apr 23, 2024
1 parent 48cc6fd commit 656ab82
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
1 change: 0 additions & 1 deletion build/flaws/broken-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function mutateLink(
// As we still suggest the translated version even if we only
// have an English (US) version.
$element.attr("href", enUSFallback);
$element.append(` <small>(${DEFAULT_LOCALE})<small>`);
$element.addClass("only-in-en-us");
$element.attr("title", "Currently only available in English (US)");
} else if (suggestion) {
Expand Down
42 changes: 42 additions & 0 deletions client/src/document/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -942,3 +942,45 @@ kbd {
opacity: 0.4;
}
}

html a.only-in-en-us:after {
content: "(en-US)";
font-size: smaller;
vertical-align: super;
}

html[lang="de"] a.only-in-en-us:after {
content: "(engl.)";
}

html[lang="es"] a.only-in-en-us:after {
content: "(inglés)";
}

html[lang="fr"] a.only-in-en-us:after {
content: "(angl.)";
}

html[lang="ja"] a.only-in-en-us:after {
content: "(英語)";
}

html[lang="ko"] a.only-in-en-us:after {
content: "(영어)";
}

html[lang="ru"] a.only-in-en-us:after {
content: "(англ.)";
}

html[lang="pt-BR"] a.only-in-en-us:after {
content: "(inglês)";
}

html[lang="zh-CN"] a.only-in-en-us:after {
content: "(英语)";
}

html[lang="zh-TW"] a.only-in-en-us:after {
content: "(英語)";
}
2 changes: 1 addition & 1 deletion kumascript/src/api/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ const web = {
return (
'<a class="only-in-en-us" ' +
'title="Currently only available in English (US)" ' +
`href="${enUSPage.url}"${flawAttribute}>${content} <small>(en-US)</small></a>`
`href="${enUSPage.url}"${flawAttribute}>${content}</a>`
);
}
}
Expand Down

0 comments on commit 656ab82

Please sign in to comment.