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

Commit

Permalink
Use JSON5 for en.json (#1949)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvkb authored Nov 15, 2022
1 parent 8221e6d commit ef8e656
Show file tree
Hide file tree
Showing 12 changed files with 1,112 additions and 874 deletions.
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
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"author": "sebworks",
"private": true,
"scripts": {
"prepare": "./bin/install-pre-commit.sh",
"prepare": "./bin/install-pre-commit.sh && pnpm i18n:get-translations --en-only",
"predev": "pnpm install && pnpm i18n:no-get",
"dev": "pnpm dev:only",
"dev:only": "nuxt --hostname 0.0.0.0",
Expand Down Expand Up @@ -55,6 +55,7 @@
"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:watch-en": "pnpm i18n:get-translations --en-only --watch",
"i18n:copy-test-locales": "cp -r test/locales/* src/locales/",
"i18n:no-get": "pnpm i18n:create-locales-list && pnpm i18n:update-locales",
"i18n:create-locales-list": "node src/locales/scripts/create-wp-locale-list",
Expand Down Expand Up @@ -110,6 +111,7 @@
"devDependencies": {
"@babel/core": "^7.17.10",
"@babel/eslint-parser": "^7.17.0",
"@babel/parser": "^7.20.3",
"@babel/preset-env": "^7.1.6",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime-corejs3": "^7.17.9",
Expand Down Expand Up @@ -139,6 +141,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

0 comments on commit ef8e656

Please sign in to comment.