Skip to content

Commit

Permalink
Test auto-update of strings file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr0grog committed Feb 21, 2025
1 parent 817d766 commit 640d23c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ jobs:
defaults:
run:
working-directory: client
permissions:
contents: write
steps:
- uses: actions/checkout@v4

Expand All @@ -117,6 +119,30 @@ jobs:
- name: Install
run: npm ci

- name: Extract English from source code
id: extract
if: github.event_name == 'pull_request'
run: |
ENGLISH_FILE='src/intl/en.json'
npm run intl:extract
if (git diff --exit-code "${ENGLISH_FILE}" > /dev/null); then
echo 'english-changed=' >> "${GITHUB_OUTPUT}"
else
echo 'english-changed=true' >> "${GITHUB_OUTPUT}"
git add "${ENGLISH_FILE}"
git commit -m 'Auto-update en.json from component source code'
git push
fi
- if: github.event_name == 'pull_request' && steps.extract.outputs.english-changed == 'true'
uses: thollander/actions-comment-pull-request@v3
with:
message: |
:wave: FYI, your PR has been automatically updated with changes to
`client/src/intl/en.json`, which contains all the translatable text
from the application (probably because you made changes to
the text of a component without updating this file).
- name: Check Spanish translations
# TODO: Make this error fatal when we have a strategy for translations!
#
Expand Down
2 changes: 1 addition & 1 deletion client/src/data/copy/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const UPDATE_BANNER_CONTENT_LARGE = <FormattedMessage

export const UPDATE_BANNER_CONTENT_SMALL = <FormattedMessage
id={'common.pages.alerts.banner.update.content.small'}
defaultMessage={`<bold>This is an unofficial copy of the CEJST Tool.</bold> We are working on an overhaul, but in the meantime some links and text may incorrectly suggest that this site is affiliated with the US Government.`}
defaultMessage={`<bold>This is an unofficial copy of the CEJST Tool!!!!</bold> We are working on an overhaul, but in the meantime some links and text may incorrectly suggest that this site is affiliated with the US Government.`}
description={`Alert body that appears at the top of pages.`}
values={{
bold: boldFn,
Expand Down

0 comments on commit 640d23c

Please sign in to comment.