Skip to content

Commit

Permalink
PR feedback: security
Browse files Browse the repository at this point in the history
  • Loading branch information
jfdoming committed Dec 18, 2024
1 parent 2e9a3df commit c68d90b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/i18n-string-extract-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ jobs:
- name: Configure i18n client
run: |
pip install wlc
mkdir -p ~/.config
cat <<EOF >~/.config/weblate
[weblate]
url = https://hosted.weblate.org/api/
key = ${{ secrets.WEBLATE_API_KEY_CI_STRINGS }}
translation = actualbudget/actual/en
EOF
chmod 600 ~/.config/weblate
- name: Generate i18n strings
run: yarn generate:i18n
- name: Upload i18n strings
Expand All @@ -32,4 +24,13 @@ jobs:
echo "File packages/desktop-client/locale/en.json not found. Ensure the file was generated correctly."
exit 1
fi
wlc upload --author-name "Actual Budget" --author-email "[email protected]" --method add --input packages/desktop-client/locale/en.json
wlc \
--url https://hosted.weblate.org/api/ \
--key "${{ secrets.WEBLATE_API_KEY_CI_STRINGS }}" \
upload \
--author-name "Actual Budget" \
--author-email "[email protected]" \
--method add \
--input packages/desktop-client/locale/en.json \
actualbudget/actual/en
echo "Translations uploaded"
2 changes: 1 addition & 1 deletion packages/desktop-client/src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const languages = import.meta.glob('/locale/*.json');

const loadLanguage = (language: string) => {
const path = `/locale/${language}.json`;
if (!languages.hasOwnProperty(path)) {
if (!Object.hasOwn(languages, path)) {
console.error(`Unknown locale ${language}`);
throw new Error(`Unknown locale ${language}`);
}
Expand Down

0 comments on commit c68d90b

Please sign in to comment.