Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Use JSON5 for en.json #1949

Merged
merged 20 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/setup-node-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ runs:
shell: bash
run: "pnpm install"

- name: Generate English locale file
shell: bash
run: "pnpm i18n:get-translations --en-only"

- name: Copy locale files
shell: bash
run: "cp -r test/locales/* src/locales"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ vercel.json
.eslintcache
.nuxt
src/locales/*.json
!src/locales/en.json
.nuxt-storybook
storybook-static
.vercel
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ Run the following commands in order to have the code up and running on your mach
# Builds and serves assets with hot-reload
# Automatically invokes pnpm install and pnpm i18n
pnpm dev
```

If you intend to change any text in the app, you will need to edit `src/locales/scripts/en.json5`. To ensure your changes are reflected immediately, run the following command.

```bash
# Watches the en.json5 file and updates the en.json file for every change.
pnpm i18n:watch-en
```

### Using HTTPS Locally
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@
"pc:install": "python3 pre-commit.pyz install -t pre-push -t pre-commit",
"pc:lint": "python3 pre-commit.pyz run --all-files",
"i18n": "pnpm i18n:create-locales-list && pnpm i18n:get-translations && pnpm i18n:update-locales",
"i18n:copy-test-locales": "cp -r test/locales/* src/locales/",
"i18n:no-get": "pnpm i18n:create-locales-list && pnpm i18n:update-locales",
"i18n:watch-en": "pnpm i18n:get-translations --en-only --watch",
dhruvkb marked this conversation as resolved.
Show resolved Hide resolved
"i18n:copy-test-locales": "cp -r test/locales/* src/locales/ && pnpm i18n:get-translations --en-only",
"i18n:no-get": "pnpm i18n:create-locales-list && pnpm i18n:update-locales && pnpm i18n:get-translations --en-only",
"i18n:create-locales-list": "node src/locales/scripts/create-wp-locale-list",
"i18n:get-translations": "node src/locales/scripts/get-translations",
"i18n:update-locales": "node src/locales/scripts/get-validated-locales",
Expand Down Expand Up @@ -137,6 +138,7 @@
"autoprefixer": "^10.4.0",
"babel-jest": "^26.6.3",
"babel-loader": "8.2.5",
"chokidar": "^3.5.3",
"css-loader": "^5.2.7",
"eslint": "^8.13.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
Loading