Skip to content

Commit

Permalink
tmp: test action
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMind committed Jan 19, 2024
1 parent bdc17e7 commit d7de2de
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/localization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install node_modules
run: yarn install --frozen-lockfile --prefer-offline
- name: Extract locales
run: yarn extract-locales
- name: Inspect file
run: cat ./locale/templates/LC_MESSAGES/amo.pot
- id: diff
name: Diff changes
run: ./bin/locales-changed



17 changes: 17 additions & 0 deletions bin/locales-changed
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

regex="([0-9]+).*([0-9]+)"
output=$(git diff --numstat -- ./locale/templates/LC_MESSAGES/amo.pot)

insertions=0
deletions=0

if [[ $output =~ $regex ]]; then
insertions=$((BASH_REMATCH[1]))
deletions=$((BASH_REMATCH[2]))
fi

if [[ $insertions -lt 2 && $deletions -lt 2 ]]; then
echo "No locale changes, nothing to update, ending process."
exit 0
fi
2 changes: 1 addition & 1 deletion src/amo/components/AddAddonToCollection/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class AddAddonToCollectionBase extends React.Component<InternalProps> {
let progressMessage;

if (loadingUserCollections) {
progressMessage = i18n.gettext('Loading…');
progressMessage = i18n.gettext('Test');
} else if (loadingAddonsInCollections) {
progressMessage = i18n.gettext('Adding…');
}
Expand Down

0 comments on commit d7de2de

Please sign in to comment.