Skip to content

Commit

Permalink
fix: processing of downloaded translations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-polk committed Nov 14, 2024
1 parent bf34f51 commit 2180bae
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ jobs:
run: yarn

- name: Sync with crowdin
if: github.ref == 'refs/heads/master'
run: yarn strings:sync
run: |
if [ "${{ github.ref }}" = "refs/heads/master" ]; then
yarn strings:sync
else
yarn strings:download
fi
- name: Build package
run: yarn build
Expand Down
6 changes: 3 additions & 3 deletions src/l10n/all-messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"description": "tooltip for the audio play button for talking books"
},
"Audio.Pause": {
"message": "Pausa",
"message": "Pausar",
"description": "tooltip for the audio (or motion) pause button"
},
"Button.Back": {
Expand All @@ -250,11 +250,11 @@
"description": "tooltip for the button to go show detail view of book"
},
"Button.FullScreen": {
"message": "Ecrã inteiro",
"message": "Tela cheia",
"description": "tooltip for the display on full screen button"
},
"Button.ExitFullScreen": {
"message": "Sair do modo de ecrã inteiro",
"message": "Sair da tela cheia",
"description": "tooltip for the exit full screen button"
},
"Button.ChooseLanguage": {
Expand Down
7 changes: 4 additions & 3 deletions src/l10n/compileL10Strings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import glob from "glob";
import { glob } from "glob";
import fs from "fs";

// This is used at build-time only, called from package.json
Expand All @@ -8,11 +8,12 @@ import fs from "fs";
function CombineTranslatedMessagesFiles() {
// for painful reasons, the stuff we download comes in under "bloom-player/"
const pattern = /src\/l10n\/(bloom-player\/)(.*)\/messages.json/;
glob("src/l10n/**/messages.json", (error, files) => {
glob("src/l10n/**/messages.json").then((files) => {
files.sort(); // Sort files in ascending order
let output = "";
let langs: string[] = [];
files.forEach((filename) => {
const match = pattern.exec(filename);
const match = pattern.exec(filename.replace(/\\/g, "/"));
if (match) {
const lang = match[2];
if (lang) {
Expand Down

0 comments on commit 2180bae

Please sign in to comment.