mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-29 05:12:52 +00:00
Adds a note that languages.js is autogenerated
Add a comment about auto-generation to top of en.json file
This commit is contained in:
parent
fcc168af42
commit
ee5c8a4278
|
|
@ -25,7 +25,9 @@ let currentTranslations = {
|
|||
"pages-strings": {}
|
||||
};
|
||||
if (fs.existsSync(path)) {
|
||||
currentTranslations = JSON.parse(fs.readFileSync(CWD + "/i18n/en.json", "utf8"));
|
||||
currentTranslations = JSON.parse(
|
||||
fs.readFileSync(CWD + "/i18n/en.json", "utf8")
|
||||
);
|
||||
}
|
||||
|
||||
function writeFileAndCreateFolder(file, content) {
|
||||
|
|
@ -139,15 +141,24 @@ function execute() {
|
|||
"Translate";
|
||||
translations["pages-strings"] = Object.assign(
|
||||
translations["pages-strings"],
|
||||
currentTranslations["pages-strings"],
|
||||
currentTranslations["pages-strings"]
|
||||
);
|
||||
translations["localized-strings"] = Object.assign(
|
||||
translations["localized-strings"],
|
||||
currentTranslations["localized-strings"],
|
||||
currentTranslations["localized-strings"]
|
||||
);
|
||||
writeFileAndCreateFolder(
|
||||
CWD + "/i18n/en.json",
|
||||
JSON.stringify(translations, null, 2)
|
||||
JSON.stringify(
|
||||
Object.assign(
|
||||
{
|
||||
_comment: "This file is auto-generated by write-translations.js"
|
||||
},
|
||||
translations
|
||||
),
|
||||
null,
|
||||
2
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue