Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83088cb

Browse files
bteacexbrayat
authored andcommitted
feat: print warning messages for unsupported locale
1 parent1b5cec7 commit83088cb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎utils/getLanguage.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ export default function getLanguage() {
6666
constlanguageFilePath=path.resolve(localesRoot,`${locale}.json`)
6767
constdoesLanguageExist=fs.existsSync(languageFilePath)
6868

69+
if(!doesLanguageExist){
70+
console.warn(
71+
`\x1B[33mThe locale langage "${locale}" is not supported, fallback to "en-US".\n\x1B[39m`
72+
)
73+
}
74+
6975
constlang:Language=doesLanguageExist
7076
?require(languageFilePath)
7177
:require(path.resolve(localesRoot,'en-US.json'))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp