Commit Graph

8 Commits

Author SHA1 Message Date
Simon Backx
4f604af744 🐛 Fixed translations with spaces missing in signup-form
refs https://ghost.slack.com/archives/C02G9E68C/p1692784819620269
refs https://github.com/TryGhost/Product/issues/3504

- Somehow, when using i18n in TypeScript, the require will put some of the keys into 'default' and not into the root. Mainly all keys that have a space in them. Couldn't find any documentation about this
- The solution is to also add 'default' to the keys that are being used in the code

This change also fixes the translate script (wasn't updated for updated paths), includes the missing translations, and already adds comments to lookup translation strings
2023-08-23 15:11:41 +02:00
Daniel Lockyer
a8801be82a
Added test to check for mismatched brackets in translations
refs https://github.com/TryGhost/Toolbox/issues/603

- this will loop over all locales and translations files to check for
  a mismatched bracket count
2023-06-27 09:01:25 +02:00
Hannah Wolfe
6161f94910
Updated to use assert/strict everywhere (#17047)
refs: https://github.com/TryGhost/Toolbox/issues/595

We're rolling out new rules around the node assert library, the first of which is enforcing the use of assert/strict. This means we don't need to use the strict version of methods, as the standard version will work that way by default.

This caught some gotchas in our existing usage of assert where the lack of strict mode had unexpected results:
- Url matching needs to be done on `url.href` see aa58b354a4
- Null and undefined are not the same thing,  there were a few cases of this being confused
- Particularly questionable changes in [PostExporter tests](c1a468744b) tracked [here](https://github.com/TryGhost/Team/issues/3505).
- A typo see eaac9c293a

Moving forward, using assert strict should help us to catch unexpected behaviour, particularly around nulls and undefineds during implementation.
2023-06-21 09:56:59 +01:00
Ronald Langeveld
acb309679d Updated Afrikaans translations for Portal
no issue
2023-06-05 14:01:47 +02:00
Ronald Langeveld
4fcaabe563
Added initial i18n implementation for Signup-form (#16914)
closes https://github.com/TryGhost/Team/issues/3307

This commit includes several important updates to add internationalisation (i18n) support within the signup form package:

- Modified the translate script in `package.json` to include translations for the signup form.
- Added a new test for the signup form resources in `i18n.test.js`.
- Updated `tsconfig.json` to allow synthetic default imports.
- Made updates to `package.json`, including adding a prebuild command for `@tryghost/i18n` to ensure typescript declaration files get built.
- added `vite-plugin-commonjs` so we can bundle commonjs packages to be useable by the browser.
- In `App.tsx`, imported the `i18n` library and created an `i18n` instance for the `signup-form` namespace. This `i18n` instance's `t` function was added to the application context.
- Updated the `AppContextType` in `AppContext.ts` to include the `t` function from i18n​

Co-authored-by: Daniel Lockyer <hi@daniellockyer.com>
2023-06-02 11:02:52 +02:00
Daniel Lockyer
d58ff309d0
Removed test.json translations
- these weren't really doing much and would become a nuisance to
  newcomers
2023-03-30 18:20:39 +02:00
Daniel Lockyer
6d8ca23625
Added support for namespaces to i18n package
refs https://github.com/TryGhost/Ghost/issues/15502

- this adds support for namespaces to the i18n package so we can
  separate translations for different packages
2023-03-01 10:24:08 +01:00
Daniel Lockyer
0d9268ad86 Added i18n package
refs https://github.com/TryGhost/Ghost/issues/15502

- this is an early implementation of an i18n provider by
  exporting an instance of `i18next`
- there's a lot more to be done here but baby steps :)
2023-01-18 13:54:14 +01:00