We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3642c1c commit df50c11Copy full SHA for df50c11
utils/getLanguage.ts
@@ -51,6 +51,18 @@ interface Language {
51
* @returns locale that linked with correct name
52
*/
53
function linkLocale(locale: string) {
54
+ // The C locale is the default system locale for POSIX systems.
55
+ // https://docs.oracle.com/cd/E36784_01/html/E36823/glmar.html
56
+ // https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
57
+ // It is common among containerized environments or minimal virtual environments
58
+ // though most user-facing systems would have a more specific locale set.
59
+ // The problem here is that the C locale is not a valid language tag for the Intl API.
60
+ // But it is not desirable to throw an error in this case.
61
+ // So we map it to 'en-US'.
62
+ if (locale === 'C') {
63
+ return 'en-US'
64
+ }
65
+
66
let linkedLocale: string
67
try {
68
linkedLocale = Intl.getCanonicalLocales(locale)[0]
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments