-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix overwrite context keys from example i18n setup #467
Conversation
Visit the preview URL for this PR (updated for commit f27f71b): https://blui-react-login--pr467-fix-4684-i18n-overwr-d1ukp9al.web.app (expires Sun, 10 Sep 2023 17:49:16 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 1e9064d2e35ed37fe01e053587ea5f209719a043 |
@@ -22,24 +22,24 @@ export const AuthContextProvider: React.FC< | |||
const { language, i18n = i18nInstance, errorConfig } = props; |
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.
This is a little bizarre...not sure if it's causing your issue, but you're doing what looks like a double destructuring of the i18n prop. You set i18nInstance
to the passed prop or the default auth instance...and then you destructure the i18n
prop again on line 22. I don't think causes any errors, it's just very strange.
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.
App translations were breaking because app routes were part of auth routes( earlier change password was part of auth context this might be the reason for moving app routes inside auth). Fixed it now.
@JeffGreiner-eaton , checking it. |
@JeffGreiner-eaton , can you take the latest pull and check? I have updated the latest version in workflow and example. |
still see errors from react-i18next |
With fresh clone getting same error |
#486 fixed here. |
Fixes
#233
add line
i18nAppInstance.addResourceBundle('en', 'bluiCommon', { ACTIONS:{ CREATE_ACCOUNT: 'Register now!' } }, true, true);
in app.tsx of example file and check it should update textChanges proposed in this Pull Request:
The app should run properly with all translations if we are not passing the i18n app instance to the i18n prop to auth context or registration context
AuthContextProvider actions={ProjectAuthUIActions(app)} language={app.language} navigate={navigate} routeConfig={routes} i18n={i18nAppInstance} rememberMeDetails={{ email: rememberMe ? email : '', rememberMe: rememberMe }} > <Outlet /> </AuthContextProvider>
Screenshots / Screen Recording (if applicable)
To Test:
Any specific feedback you are looking for?