Skip to content

Commit bb5e2f0

Browse files
authored
Restructured code and added i18n support (#36)
1 parent 1dedd21 commit bb5e2f0

File tree

110 files changed

+4730
-5106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+4730
-5106
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ copier copy gh:quickplates/react .
4848
- routing with [`React Router`](https://reactrouter.com)
4949
- state management with [`Zustand`](https://docs.pmnd.rs/zustand)
5050
- clean UI with [`Mantine`](https://mantine.dev)
51+
- i18n with [`Lingui`](https://lingui.dev)
5152

5253
## 💻 Development
5354

src/.eslintrc.cjs

+15
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ module.exports = {
1717
// Use recommended typescript-eslint rules
1818
"plugin:@typescript-eslint/recommended",
1919

20+
// Use stylistic typescript-eslint rules
21+
"plugin:@typescript-eslint/stylistic",
22+
2023
// Use recommended React rules
2124
"plugin:react/recommended",
2225

26+
// Use recommended Lingui rules
27+
"plugin:lingui/recommended",
28+
2329
// Turn off rules that might conflict with Prettier
2430
"prettier",
2531
],
@@ -41,6 +47,15 @@ module.exports = {
4147
root: true,
4248

4349
rules: {
50+
// Use objects instead of records for empty types
51+
"@typescript-eslint/consistent-indexed-object-style": [
52+
"error",
53+
"index-signature",
54+
],
55+
56+
// Use types instead of interfaces
57+
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
58+
4459
// Allow anonymous default exports
4560
"import/no-anonymous-default-export": "off",
4661

src/.gitignore.jinja

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
# Build
1717
/build/
18+
/.tmp/
1819

1920
# Debug
2021
npm-debug.log*

src/Taskfile.dist.yaml.jinja

+10
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ tasks:
204204
- flake.lock
205205
- "*.nix"
206206
- index.html
207+
- lingui.config.ts
207208
- package-lock.json
208209
- package.json
209210
- postcss.config.mjs
@@ -225,6 +226,15 @@ tasks:
225226
cmds:
226227
- task: install-internal
227228
- task: build-internal
229+
locales:
230+
desc: Extract locales
231+
cmds:
232+
- >
233+
npm
234+
run
235+
--
236+
locales
237+
{{ '{{ .CLI_ARGS }}' }}
228238
dev:
229239
desc: Run in development mode
230240
interactive: true

src/lingui.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { LinguiConfig } from "@lingui/conf";
2+
import { formatter } from "@lingui/format-po";
3+
4+
// https://lingui.dev/ref/conf
5+
export default {
6+
catalogs: [
7+
{
8+
include: ["<rootDir>/src"],
9+
path: "<rootDir>/src/locales/{locale}",
10+
},
11+
],
12+
fallbackLocales: {
13+
default: "en",
14+
},
15+
format: formatter(),
16+
locales: ["en"],
17+
sourceLocale: "en",
18+
} satisfies LinguiConfig as LinguiConfig;

0 commit comments

Comments
 (0)