Skip to content

Commit

Permalink
[Automated] Update translations
Browse files Browse the repository at this point in the history
  • Loading branch information
DangoCat authored and GarboMuffin committed Jan 7, 2025
1 parent c0b996d commit b7704fe
Show file tree
Hide file tree
Showing 5 changed files with 350 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/download-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
for branch in $all_branches; do
if [[ $branch == update-translations-* ]]; then
echo "Deleting branch: $branch"
GH_TOKEN="$FORK_GH_TOKEN" gh api "repos/$FORK_REPO/git/refs/heads/$branch" -X DELETE
git branch -d origin "$branch"
else
echo "Keeping branch: $branch"
fi
Expand Down
16 changes: 6 additions & 10 deletions development/download-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ const downloadTranslatedResource = async (resource, locale) => {
});
}

const translationsResponse = await fetch(urlToDownload, {
signal: AbortSignal.timeout(10000 * 60),
});
const translationsResponse = await fetch(urlToDownload);
const rawTranslations = await translationsResponse.json();
const withoutDeveloperComments = removeDeveloperComments(rawTranslations);
const withoutEmptyTranslations = removeEmptyTranslations(
Expand Down Expand Up @@ -193,18 +191,16 @@ const downloadAllResourceTranslations = async (resource) => {
const run = async () => {
console.log("This is going to take a while.");

const [runtimeStrings, metadataStrings] = await Promise.all([
downloadAllResourceTranslations(RUNTIME_RESOURCE),
downloadAllResourceTranslations(METADATA_RESOURCE),
]);

console.log('Downloading runtime...');
fs.writeFileSync(
pathUtil.join(__dirname, "../translations/extension-runtime.json"),
JSON.stringify(runtimeStrings, null, 4)
JSON.stringify(await downloadAllResourceTranslations(RUNTIME_RESOURCE), null, 4)
);

console.log('Downloading metadata...');
fs.writeFileSync(
pathUtil.join(__dirname, "../translations/extension-metadata.json"),
JSON.stringify(metadataStrings, null, 4)
JSON.stringify(await downloadAllResourceTranslations(METADATA_RESOURCE), null, 4)
);
};

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint": "eslint development extensions --max-warnings=0",
"format": "prettier . --write",
"check-format": "prettier . --check",
"upload-translations": "node development/upload-translations.js"
"upload-translations": "node development/upload-translations.js",
"download-translations": "node development/download-translations.js"
},
"repository": {
"type": "git",
Expand Down
6 changes: 4 additions & 2 deletions translations/extension-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@
"CST1229/images@description": "이미지를 다루는 블록들입니다.",
"CST1229/images@name": "이미지",
"CST1229/zip@description": ".zip 또는 .sb3 형식의 파일을 생성하고 수정합니다.",
"Clay/htmlEncode@description": "신뢰하지 않는 텍스트를 HTML에 안전하게 포함할 수 있도록 이스케이프화 합니다.",
"Clay/htmlEncode@description": "신뢰하지 않는 텍스트를 HTML에 안전하게 포함할 수 있도록 이스케이프 처리합니다.",
"Clay/htmlEncode@name": "HTML 인코딩",
"CubesterYT/KeySimulation@description": "키 입력과 마우스 입력을 시뮬레이션 합니다.",
"CubesterYT/KeySimulation@name": "키 시뮬레이션",
Expand Down Expand Up @@ -1426,7 +1426,9 @@
"vercte/dictionaries@name": "Словари"
},
"sl": {
"runtime-options@name": "Možnosti izvajanja"
"files@name": "Datoteke",
"runtime-options@name": "Možnosti izvajanja",
"text@name": "Besedilo"
},
"sv": {
"runtime-options@name": "Körtidsalternativ"
Expand Down
Loading

0 comments on commit b7704fe

Please sign in to comment.