mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 14:38:50 +02:00
ESLintify Part 3 (#846)
* ESLintify Part 3 * ESLintify Part 3 * ESLintify Part 3
This commit is contained in:
parent
5ac2cee658
commit
a7a214fb3a
54 changed files with 435 additions and 497 deletions
|
@ -47,19 +47,13 @@ function translate(str) {
|
|||
// if a translated string doesn't exist, but english does then fallback
|
||||
if (doesTranslationExist(str, 'en')) {
|
||||
console.error(
|
||||
"Could not find a string translation in '" +
|
||||
language +
|
||||
"' for string '" +
|
||||
str +
|
||||
"'. Using English version instead."
|
||||
`Could not find a string translation in '${language}' for string '${str}'. Using English version instead.`
|
||||
);
|
||||
|
||||
return parseEscapeSequences(translation.en['pages-strings'][str]);
|
||||
}
|
||||
throw new Error(
|
||||
"Text that you've identified for translation ('" +
|
||||
str +
|
||||
"') hasn't been added to the global list in 'en.json'. To solve this problem run 'yarn write-translations'."
|
||||
`Text that you've identified for translation ('${str}') hasn't been added to the global list in 'en.json'. To solve this problem run 'yarn write-translations'.`
|
||||
);
|
||||
}
|
||||
return parseEscapeSequences(translation[language]['pages-strings'][str]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue