Commit Graph

20 Commits

Author SHA1 Message Date
Lincoln Nogueira
557278fac0
feat: improve i18n support as a whole (#1526)
* feat: improve i18n support as a whole

- Remove dayjs in favor of /helpers/datetime.ts, which uses
Intl.DateTimeFormat and Date. Dayjs is not exactly i18n friendly
and has several locale related opened issues.

- Move/refactor date/time code from /helpers/utils.ts to
/helpers/datetime.ts.

- Fix Daily Review weekday not changing according to selected date.

- Localize Daily review weekday and month.

- Load i18n listed strings from /locales/{locale}.json in a dynamic way.
This makes much easier to add new locales, by just adding a properly
named json file and listing it only in /web/src/i18n.ts and
/api/user_setting.go.

- Fallback languages are now set in /web/src/i18n.ts.

- Full language codes are now preffered, but they fallback to 2-letter
codes when not available.

- The locale dropdown is now populated dynamically from the available
locales. Locale names are populated by the browser via
Intl.DisplayNames(locale).

- /web/src/i18n.ts now exports a type TLocale from availableLocales
array. This is used only by findNearestLanguageMatch(). As I was unable
to use this type in ".d.ts" files, I switched the Locale type from
/web/src/types/i18n.d.ts to string.

- Move pretty much all hardcoded text strings to i18n strings.

- Add pt-BR translation.

- Remove site.ts and move its content to a i18n string.

- Rename zh.json to zh-Hans.json to get the correct language name on
selector dropdown.

- Remove pt_BR.json and replace with pt-BR.json.

- Some minor layout spacing fixes to accommodate larger texts.

- Improve some error messages.

* Delete .yarnrc.yml

* Delete package-lock.json

* fix: 158:28  error  Insert `⏎`  prettier/prettier
2023-04-15 08:56:03 +08:00
boojack
89ab57d738
refactor: update import prefix with alias (#1433) 2023-04-01 16:03:14 +08:00
Dmitry Shemin
b03778fa73
feat: update RU i18n locale (#1422)
* feat: Fix i18n and RU locale

* fix: eslint issues

* change the position of deps

---------

Co-authored-by: CorrectRoadH <a778917369@gmail.com>
2023-04-01 15:35:25 +08:00
boojack
5b0a54bfb7
chore: clean package.json (#993)
* chore: clean `package.json`

* chore: update
2023-01-26 00:35:50 +08:00
Stephen Zhou
b7ab6f8e7e
fix: code highlight in dark mode (#702) 2022-12-08 18:30:46 +08:00
boojack
07f0c3f052
chore: update global css (#657) 2022-12-02 21:34:43 +08:00
boojack
c5200ca31b
feat: dark mode for dialogs (#643) 2022-11-30 20:34:16 +08:00
boojack
9036bd478b
fix: image scrollbar (#494) 2022-11-19 17:36:25 +08:00
boojack
eefd0444c8
feat: add highlight for code block (#291)
* feat: add highlight for code block

* chore: update test
2022-10-14 22:29:28 +08:00
Steven
366afdd1e4 feat: use i18next 2022-09-19 22:27:50 +08:00
Steven
307483e499 feat: use react-router 2022-09-19 21:53:27 +08:00
Steven
660908e436 chore: add react-router 2022-09-16 22:48:41 +08:00
boojack
646a41e931 chore: add i18n based with useContext 2022-08-07 22:48:22 +08:00
boojack
58e68f8f80 chore: update signin button in visitor mode 2022-07-25 21:50:25 +08:00
boojack
346d219cd5
chore: reorder imports manually (#106)
* chore: reorder imports manually

* chore: remove unused less
2022-07-07 22:02:40 +08:00
Steven
40680a5e0f
chore: update memo action buttons style (#80)
chore: update memo action btn style
2022-06-21 08:35:46 +08:00
boojack
c2e5a1a524 refactor: use redux 2022-05-21 12:21:06 +08:00
email
9b0cf8af49 feat: upgrade react 18 2022-04-01 14:38:30 +08:00
boojack
3d8997a43a feat: use tailwindcss and show export btn 2022-01-31 19:16:01 +08:00
LeeShuang
06bffd0ba5 migrate frontend 2021-12-08 23:43:52 +08:00