Skip to content

Commit

Permalink
Update translation workflows (#1866)
Browse files Browse the repository at this point in the history
- update upload translations sanity checks to be more strict
- schedule download translations workflow to run twice per week
  • Loading branch information
GarboMuffin authored Jan 13, 2025
1 parent 43b3ccb commit 3967ce3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/download-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Download translations

on:
workflow_dispatch:
schedule:
# Time 10:44 was chosen at random to avoid periods of high load.
- cron: "44 10 * * WED,SAT"

concurrency:
group: "download-translations"
Expand Down
14 changes: 8 additions & 6 deletions development/upload-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ const Builder = require("./builder");

const uploadRuntimeStrings = async (strings) => {
if (
typeof strings["lab/text@_Animated Text"].string !== "string" ||
typeof strings["lab/text@_Animated Text"].developer_comment !== "string" ||
Object.keys(strings).length < 500
strings["lab/text@_Animated Text"].string !== "Animated Text" ||
strings["lab/text@_Animated Text"].developer_comment !==
"Part of the 'Animated Text' extension." ||
Object.keys(strings).length < 1500
) {
throw new Error("Sanity check failed.");
}
Expand All @@ -29,9 +30,10 @@ const uploadRuntimeStrings = async (strings) => {

const uploadMetadataStrings = async (strings) => {
if (
typeof strings["lab/text@name"].string !== "string" ||
typeof strings["lab/text@name"].developer_comment !== "string" ||
Object.keys(strings).length < 100
strings["lab/text@name"].string !== "Animated Text" ||
strings["lab/text@name"].developer_comment !==
"Name of the 'Animated Text' extension in the extension gallery." ||
Object.keys(strings).length < 150
) {
throw new Error("Sanity check failed.");
}
Expand Down

0 comments on commit 3967ce3

Please sign in to comment.