-
Notifications
You must be signed in to change notification settings - Fork 8
✨ Add support for I18n #695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0x46616c6b
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! I highly appreciate it. Could you please check to ensure the translations are working with the test setup? I could add the German translations afterwards.
|
@0x46616c6b yes sure, I'm working with React for the first time so let me know if creating a new |
|
Also, locally I have an error running I made all the tests working by adding this snippet on // Mock localStorage for tests
Object.defineProperty(window, 'localStorage', {
value: {
getItem: vi.fn(() => null),
setItem: vi.fn(() => {}),
removeItem: vi.fn(() => {}),
clear: vi.fn(() => {}),
},
writable: true,
})but I don't have a local Ticker instance running and it seems to don't be linked to the coded I added, so that I didn't commited it yet. |
You can use our Ticker API, we provide a Ticker for local development: |
|
Is it okay if I make some simplifications based on your code changes? |
Yeah sure! |
|
Hmm, I can't push to your fork. But here what I would do:
import { initReactI18next } from 'react-i18next'
import i18n from 'i18next'
import en from './src/i18n/locales/en.json'
i18n.use(initReactI18next).init({
resources: { en: { translation: en } },
lng: 'en',
fallbackLng: 'en',
interpolation: { escapeValue: false },
}) |
I still have the same error Do you have an idea to make it working accordingly? |
|
I wanted to update |
|
Which node version are you using? The CI and also on my machine with Node LTS/JOD (22) the tests are passing. |
So I'll rollback to v22 |
I gave you an access to my fork if you want to push code directly there |
|
I use |
|
The PR looks really good to me. You only want to make dayjs i18n aware as well, correct? |
thanks for the tip, it's working now |
I managed to make dayjs locale working! e931d1c This PR is ready to be merged now |
|
Really nice 😍 Maybe a small comment in the readme on how to update the localization JSON files (e.g. after introducing a new translation string) would be helpful. |
i18nused to localize all the frontend strings