Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

ektaghag-eaton
Copy link
Contributor

@ektaghag-eaton ektaghag-eaton commented Sep 8, 2023

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 text

Changes 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

  • Custom screen translations should work in registration or auth workflow after passing the app i18n instance to context provider
    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?

@github-actions github-actions bot added the brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering label Sep 8, 2023
@ektaghag-eaton ektaghag-eaton marked this pull request as draft September 8, 2023 12:03
@github-actions
Copy link

github-actions bot commented Sep 8, 2023

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;
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@ektaghag-eaton ektaghag-eaton marked this pull request as ready for review September 8, 2023 17:49
@JeffGreiner-eaton
Copy link
Collaborator

JeffGreiner-eaton commented Sep 12, 2023

Referring back to original issue, upgrading react-i18next to => 12.1.0 is still causing issues. We also have react-i18next package referenced in 3 areas.

workflow package has react-i18next": "^11.10.0", as a dev dependency and peer dependency.
example has version react-i18next": "^13.0.3"

upgrading the workflow package to => 12.1.0 or 13 throws errors

image

@ektaghag-eaton
Copy link
Contributor Author

Referring back to original issue, upgrading react-i18next to => 12.1.0 is still causing issues. We also have react-i18next package referenced in 3 areas.

workflow package has react-i18next": "^11.10.0", as a dev dependency and peer dependency. example has version react-i18next": "^13.0.3"

upgrading the workflow package to => 12.1.0 or 13 throws errors

image

@JeffGreiner-eaton , checking it.

@ektaghag-eaton
Copy link
Contributor Author

Referring back to original issue, upgrading react-i18next to => 12.1.0 is still causing issues. We also have react-i18next package referenced in 3 areas.

workflow package has react-i18next": "^11.10.0", as a dev dependency and peer dependency. example has version react-i18next": "^13.0.3"

upgrading the workflow package to => 12.1.0 or 13 throws errors

image

@JeffGreiner-eaton , can you take the latest pull and check? I have updated the latest version in workflow and example.

@ektaghag-eaton ektaghag-eaton marked this pull request as draft September 13, 2023 10:04
@JeffGreiner-eaton
Copy link
Collaborator

JeffGreiner-eaton commented Sep 13, 2023

@ektaghag-eaton
Copy link
Contributor Author

With fresh clone getting same error

@JeffGreiner-eaton
Copy link
Collaborator

@ektaghag-eaton
Copy link
Contributor Author

#486 fixed here.

@JeffGreiner-eaton JeffGreiner-eaton deleted the fix/4684-i18n-overwrite branch November 27, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brightlayer-ui Used to identify Brightlayer UI platform issues for easy filtering
Development

Successfully merging this pull request may close these issues.

None yet

3 participants