Skip to content

Commit

Permalink
make sure the order of script gen is not random
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmaSd committed Jan 26, 2024
1 parent 153ab6e commit a48d6b3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
6 changes: 3 additions & 3 deletions distro/io.github.sigmasd.stimulator.desktop
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[Desktop Entry]
Name=Stimulator
Name[et]=Stimulaator
Name[ar]=المحفز
Name[et]=Stimulaator
Name[fr]=Stimulateur
Comment=Keep your computer awake
Comment[et]=Hoia oma arvuti ärkvel
Comment[ar]=أبقِ جهاز الكمبيوتر مستيقظًا
Comment[et]=Hoia oma arvuti ärkvel
Comment[fr]=Gardez votre ordinateur éveillé
Keywords=caffeine;nosleep;awake;keepawake;keepon;
Keywords[et]=kofeiin;eiuinu;ärkvel;hoiaärkvel;jätka;
Keywords[ar]=كافيين; بدون نوم; مستيقظ;
Keywords[et]=kofeiin;eiuinu;ärkvel;hoiaärkvel;jätka;
Keywords[fr]=caféine;pas de someil;éveillé;
TryExec=stimulator
Exec=stimulator %F
Expand Down
24 changes: 14 additions & 10 deletions scripts/compileTranslations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,20 @@ async function genDesktopFile() {
const names = [`Name=${EN_UI_LABELS.AppName}`];
const comments = [`Comment=${EN_UI_LABELS.Comments}`];
const keywords = [`Keywords=${EN_UI_LABELS.Keywords}`];
for await (const lang of Deno.readDir("./po")) {
const langName = lang.name.slice(0, -3);
if (langName === "en") continue;
await i18next.changeLanguage(langName);
const name = i18n(langName)(EN_UI_LABELS.AppName);
const comment = i18n(langName)(EN_UI_LABELS.Comments);
const keyword = i18n(langName)(EN_UI_LABELS.Keywords);
if (name) names.push(`Name[${langName}]=${name}`);
if (comment) comments.push(`Comment[${langName}]=${comment}`);
if (keyword) keywords.push(`Keywords[${langName}]=${keyword}`);
const langs = await Array.fromAsync(Deno.readDir("./po")).then((langs) =>
langs.map((lang) => lang.name.slice(0, -3))
);
// make sure the order is not random
langs.sort();
for (const lang of langs) {
if (lang === "en") continue;
await i18next.changeLanguage(lang);
const name = i18n(lang)(EN_UI_LABELS.AppName);
const comment = i18n(lang)(EN_UI_LABELS.Comments);
const keyword = i18n(lang)(EN_UI_LABELS.Keywords);
if (name) names.push(`Name[${lang}]=${name}`);
if (comment) comments.push(`Comment[${lang}]=${comment}`);
if (keyword) keywords.push(`Keywords[${lang}]=${keyword}`);
}

const desktopFile = `\
Expand Down

0 comments on commit a48d6b3

Please sign in to comment.