-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feat/i18next language provider #96
Feat/i18next language provider #96
Conversation
WalkthroughThe changes reflect a comprehensive overhaul of the application's internationalization framework, moving from Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant I18nextProvider
participant LanguageProvider
User->>App: Launch Application
App->>I18nextProvider: Initialize Internationalization
I18nextProvider-->>App: Provide Translation Context
App->>LanguageProvider: Render Language Context
LanguageProvider-->>App: Pass Children with Translations
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (5)
app/components/molecules/CharacterWithQuote/tests/__snapshots__/index.test.js.snap
is excluded by!**/*.snap
app/components/organisms/SimpsonsLoveWednesday/tests/__snapshots__/index.test.js.snap
is excluded by!**/*.snap
app/scenes/ExampleScreen/tests/__snapshots__/index.test.js.snap
is excluded by!**/*.snap
ios/Podfile.lock
is excluded by!**/*.lock
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (22)
- app/app.js (1 hunks)
- app/components/atoms/Container/tests/index.test.js (1 hunks)
- app/components/atoms/LanguageProvider/index.js (1 hunks)
- app/components/atoms/LanguageProvider/tests/index.test.js (1 hunks)
- app/components/atoms/T/index.js (2 hunks)
- app/components/atoms/T/tests/index.test.js (1 hunks)
- app/components/molecules/CharacterWithQuote/tests/index.test.js (2 hunks)
- app/components/molecules/LogoWithInstructions/tests/index.test.js (1 hunks)
- app/components/organisms/SimpsonsLoveWednesday/tests/index.test.js (3 hunks)
- app/i18n.js (2 hunks)
- app/i18n.test.js (1 hunks)
- app/scenes/ExampleScreen/index.js (1 hunks)
- app/scenes/RootScreen/index.js (2 hunks)
- app/scenes/RootScreen/tests/index.test.js (1 hunks)
- app/scenes/SplashScreen/tests/index.test.js (1 hunks)
- app/translations/en.json (1 hunks)
- app/utils/i18nextTestUtils.js (1 hunks)
- app/utils/testUtils.js (1 hunks)
- ios/reactnativetemplatews.xcodeproj/project.pbxproj (7 hunks)
- package.json (3 hunks)
- setupTests.js (1 hunks)
- webpack.config.js (1 hunks)
Files skipped from review due to trivial changes (3)
- app/components/atoms/Container/tests/index.test.js
- app/components/atoms/LanguageProvider/tests/index.test.js
- app/scenes/RootScreen/index.js
Additional context used
Biome
app/scenes/RootScreen/tests/index.test.js
[error] 9-10: Do not export from a test file.
(lint/suspicious/noExportsInTest)
Additional comments not posted (57)
app/translations/en.json (2)
2-2
: LGTM!The change to double curly braces for the
username
placeholder is correct and compatible with i18next.The code changes are approved.
6-6
: LGTM!The change to double curly braces for the
username
placeholder is correct and compatible with i18next.The code changes are approved.
webpack.config.js (3)
1-5
: LGTM!The import of
createExpoWebpackConfigAsync
and the definition of themodule.exports
function are correct.The code changes are approved.
6-8
: LGTM!The modification to
config.resolve.fallback
to include a fallback forcrypto
usingexpo-crypto
is correct.The code changes are approved.
9-10
: LGTM!The return statement correctly returns the modified webpack configuration.
The code changes are approved.
app/app.js (2)
2-5
: LGTM!The imports of
I18nextProvider
,LanguageProvider
, andi18n
are correct and necessary for the integration of i18next.The code changes are approved.
9-13
: LGTM!The wrapping of the
App
component withI18nextProvider
andLanguageProvider
is correct and necessary for providing internationalization support.The code changes are approved.
app/components/atoms/T/tests/index.test.js (2)
7-7
: LGTM!The import statement has been correctly updated to use
renderWithI18next
.The code changes are approved.
12-12
: LGTM!The rendering methods in the test cases have been correctly updated to use
renderWithI18next
.The code changes are approved.
Also applies to: 17-17
app/scenes/SplashScreen/tests/index.test.js (2)
7-7
: LGTM!The import statement has been correctly updated to use
renderWithI18next
.The code changes are approved.
12-12
: LGTM!The rendering methods in the test cases have been correctly updated to use
renderWithI18next
.The code changes are approved.
Also applies to: 17-17
app/components/atoms/T/index.js (4)
11-11
: LGTM!The import statement has been correctly updated to use
useTranslation
fromreact-i18next
.The code changes are approved.
13-14
: LGTM!The
T
component has been correctly refactored to use thet
function fromuseTranslation
.The code changes are approved.
16-18
: LGTM!The
T
component's return statement has been correctly updated to use thet
function for translations.The code changes are approved.
33-33
: LGTM!The export statement has been correctly simplified to directly export
T
.The code changes are approved.
app/components/molecules/LogoWithInstructions/tests/index.test.js (2)
15-16
: LGTM!The function is correctly implemented and the change to use
renderWithI18next
is consistent with the PR objectives.The code changes are approved.
20-22
: LGTM!The function is correctly implemented and the change to use
renderWithI18next
is consistent with the PR objectives.The code changes are approved.
app/components/atoms/LanguageProvider/index.js (1)
3-23
: LGTM!The function is correctly implemented and the changes are consistent with the PR objectives. The removal of Redux-related code simplifies the component and enhances readability and maintainability.
The code changes are approved.
app/utils/testUtils.js (3)
14-15
: LGTM!The function is correctly implemented and the changes are consistent with the PR objectives.
The code changes are approved.
21-23
: LGTM!The function is correctly implemented and the changes are consistent with the PR objectives.
The code changes are approved.
Line range hint
27-27
: LGTM!The function is correctly implemented.
The code changes are approved.
app/scenes/RootScreen/tests/index.test.js (3)
8-8
: LGTM!The import statement has been correctly updated to use
renderWithI18next
.The code changes are approved.
14-16
: LGTM!The test case has been correctly updated to use
renderWithI18next
.The code changes are approved.
22-22
: LGTM!The test cases have been correctly updated to use
renderWithI18next
.The code changes are approved.
Also applies to: 28-30
app/components/molecules/CharacterWithQuote/tests/index.test.js (3)
11-11
: LGTM!The import statement has been correctly updated to use
renderWithI18next
.The code changes are approved.
16-16
: LGTM!The test case has been correctly updated to use
renderWithI18next
.The code changes are approved.
29-32
: LGTM!The test case has been correctly updated to use
renderWithI18next
, and the expected text has been updated to 'wednesday_lover'.The code changes are approved.
app/utils/i18nextTestUtils.js (4)
1-2
: LGTM!The import statements are necessary for setting up i18next.
The code changes are approved.
3-12
: LGTM!The comment block is informative and provides necessary context for the file.
The code changes are approved.
19-25
: LGTM!The language detector object is correctly implemented.
The code changes are approved.
27-41
: LGTM!The i18next initialization is correctly implemented with the language detector and
initReactI18next
.The code changes are approved.
app/components/organisms/SimpsonsLoveWednesday/tests/index.test.js (3)
14-15
: LGTM!The test case is correctly updated to use
renderWithI18next
.The code changes are approved.
29-31
: LGTM!The test case is correctly updated to use
renderWithI18next
.The code changes are approved.
45-49
: Verify the change in expectation.The test case is correctly updated to use
renderWithI18next
. However, the expectation has been modified to check for a different string,wednesday_lover
, instead of the previous dynamic text based on theprops.user.character
. Please verify if this change is intentional and aligns with the component's expected behavior.app/i18n.js (4)
1-2
: LGTM!The import statements are correctly added.
The code changes are approved.
26-32
: LGTM!The
languageDetector
object is correctly implemented.The code changes are approved.
50-50
: LGTM!The export statement is correctly added.
The code changes are approved.
Line range hint
52-60
: LGTM!The
formatTranslationMessages
function is correctly implemented.The code changes are approved.
app/scenes/ExampleScreen/index.js (1)
92-92
: Verify the impact of removinginjectIntl
.The removal of
injectIntl
HOC from the export statement indicates a shift in how internationalization is handled within the component. Ensure that all functionalities relying on internationalization are still working as expected.app/i18n.test.js (2)
1-28
: Verify the impact of commenting out the previous mock implementation.Commenting out the previous mock implementation for translation messages indicates a shift away from testing the
formatTranslationMessages
function directly. Ensure that the test coverage for translation message formatting is still adequate.
30-88
: LGTM!The new tests ensure that i18next is correctly configured and operational within the application context. The tests check for the presence of a language detector, initialization parameters, and language detection functionality.
package.json (4)
58-58
: Verify the secure usage ofexpo-crypto
.The addition of
expo-crypto
suggests an intent to incorporate cryptographic functionalities within the Expo framework. Ensure that the usage of this library is secure and follows best practices.
63-63
: Verify the integration ofi18next
.The addition of
i18next
indicates a focus on internationalization, allowing the application to support multiple languages more effectively. Ensure that the integration of this library is correctly configured and tested.
72-72
: Verify the integration ofreact-i18next
.The addition of
react-i18next
complementsi18next
by integrating it with React, streamlining the process of managing translations in React components. Ensure that the integration of this library is correctly configured and tested.
83-83
: Verify the integration ofrecoil
.The addition of
recoil
introduces a state management solution, which could improve the handling of application state in a more efficient and scalable manner. Ensure that the integration of this library is correctly configured and tested.ios/reactnativetemplatews.xcodeproj/project.pbxproj (12)
13-13
: LGTM!The reference to
noop-file.swift
has been correctly updated.The code changes are approved.
27-27
: LGTM!The addition of the bridging header file
reactnativetemplatews-Bridging-Header.h
is correctly implemented.The code changes are approved.
31-31
: LGTM!The reference to
noop-file.swift
has been correctly updated.The code changes are approved.
60-60
: LGTM!The reference to
noop-file.swift
has been correctly updated.The code changes are approved.
61-61
: LGTM!The addition of the bridging header file
reactnativetemplatews-Bridging-Header.h
is correctly implemented.The code changes are approved.
246-246
: LGTM!The build phase
[Expo] Configure project
has been correctly renamed to[CP] Copy Pods Resources
.The code changes are approved.
252-257
: LGTM!The input paths for the
[CP] Copy Pods Resources
build phase have been correctly updated.The code changes are approved.
259-259
: LGTM!The name of the build phase has been correctly updated.
The code changes are approved.
261-265
: LGTM!The output paths for the
[CP] Copy Pods Resources
build phase have been correctly updated.The code changes are approved.
269-270
: LGTM!The shell script for the
[CP] Copy Pods Resources
build phase has been correctly updated.The code changes are approved.
272-272
: LGTM!The build phase
[CP] Embed Pods Frameworks
has been correctly renamed.The code changes are approved.
319-319
: LGTM!The reference to
noop-file.swift
has been correctly updated.The code changes are approved.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- app/app.js (1 hunks)
Additional comments not posted (3)
app/app.js (3)
2-10
: LGTM!The imports are correctly added and necessary for the new structure.
The code changes are approved.
12-20
: Verify the continued use of Redux.The presence of Redux-related code indicates that Redux is still being used for state management, contrary to the AI-generated summary suggesting its removal. Please confirm if Redux is still intended to be used.
15-19
: LGTM!The
App
component is correctly structured to integrate theI18nextProvider
for internationalization.The code changes are approved.
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.
Actionable comments posted: 0
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
ios/Podfile.lock
is excluded by!**/*.lock
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
Files selected for processing (3)
- .eslintignore (1 hunks)
- ios/reactnativetemplatews.xcodeproj/project.pbxproj (6 hunks)
- package.json (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- ios/reactnativetemplatews.xcodeproj/project.pbxproj
- package.json
Additional comments not posted (8)
.eslintignore (8)
6-6
: LGTM!Adding
.eslintrc.js
to the ignore list is a good practice to avoid linting the ESLint configuration file itself.
7-7
: LGTM!Adding the
e2e
directory to the ignore list is appropriate if end-to-end tests are not relevant to the linting process.
8-8
: LGTM!Adding the
metrics
directory to the ignore list is appropriate if metrics files are not relevant to the linting process.
9-9
: LGTM!Adding
jest.setup.js
to the ignore list is appropriate if the Jest setup file is not relevant to the linting process.
10-10
: LGTM!Adding
babel.config.js
to the ignore list is appropriate if the Babel configuration file is not relevant to the linting process.
11-11
: LGTM!Adding the
reports
directory to the ignore list is appropriate if report files are not relevant to the linting process.
12-12
: LGTM!Adding
report.json
to the ignore list is appropriate if the report file is not relevant to the linting process.
13-13
: LGTM!Adding
**/tests/*.test.js
to the ignore list is appropriate if test files are not relevant to the linting process.
|
||
import { Provider } from 'react-redux'; | ||
import { PersistGate } from 'redux-persist/lib/integration/react'; |
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.
can we please fix the import order
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.
placed as a placeholder for the other components that still are dependent on redux will be removed altogether
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/components/atoms/T/index.js (2 hunks)
- app/utils/common.js (1 hunks)
Files skipped from review due to trivial changes (1)
- app/utils/common.js
Files skipped from review as they are similar to previous changes (1)
- app/components/atoms/T/index.js
Ticket Link
Related Links
Description
Steps to Reproduce / Test
GIF's
Summary by CodeRabbit
New Features
react-i18next
.Bug Fixes
Documentation
Chores