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

Add i18n support with gitauto model #234

Merged

Conversation

gitauto-ai[bot]
Copy link
Contributor

@gitauto-ai gitauto-ai bot commented Jul 9, 2024

Original issue: #67

What is the feature

The feature is to add internationalization (i18n) support to the application.

Why we need the feature

Adding i18n support is essential for making the application accessible to a broader audience by allowing it to be easily translated into multiple languages. This will enhance user experience for non-English speakers and potentially increase the user base.

How to implement and why

  1. Choose an i18n Library:

    • Select a widely-used i18n library such as react-i18next for React applications. This library is well-documented and integrates seamlessly with React.
  2. Install the Library:

    • Add the i18n library to the project dependencies.
    • Example: npm install react-i18next i18next.
  3. Initialize i18n Configuration:

    • Create an i18n.js file in the src directory to configure the i18n settings.
    • Initialize the i18n instance with language resources and set the default language.
  4. Create Language Resource Files:

    • Create JSON files for each language in a locales directory within src.
    • Example: src/locales/en/translation.json and src/locales/es/translation.json.
  5. Wrap the Application with I18n Provider:

    • Modify src/index.js to wrap the application with the I18nextProvider and pass the i18n instance.
  6. Translate Components:

    • Use the useTranslation hook from react-i18next to translate text within components.
    • Replace hardcoded text with translation keys.
  7. Add Language Switcher:

    • Implement a language switcher component to allow users to change the language dynamically.
    • Update the i18n instance's language based on user selection.
  8. Testing:

    • Ensure that the application displays correctly in different languages.
    • Verify that the language switcher works as expected.

By following these steps, we can successfully integrate i18n support into the application, making it more accessible and user-friendly for a global audience.

Test these changes locally

git checkout -b gitauto/issue-#67-4413c6ab-ca11-4e0e-897b-999730e9e257
git pull origin gitauto/issue-#67-4413c6ab-ca11-4e0e-897b-999730e9e257

@gitauto-ai gitauto-ai bot mentioned this pull request Jul 9, 2024
Copy link

The files' contents are under analysis for test generation.

@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 9, 2024
@gstraccini gstraccini bot requested a review from guibranco July 9, 2024 02:44
@gstraccini gstraccini bot added 🚦awaiting triage Awaiting triage 🤖 bot Automated processes or integrations labels Jul 15, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@guibranco guibranco changed the title Fix [FEATURE] Add i18n support with gitauto model Add i18n support with gitauto model Aug 15, 2024
Copy link

github-actions bot commented Sep 1, 2024

Infisical secrets check: ✅ No secrets leaked!

Scan results:

12:27AM INF scanning for exposed secrets...
12:27AM INF 395 commits scanned.
12:27AM INF scan completed in 1.01s
12:27AM INF no leaks found

Copy link

sonarqubecloud bot commented Sep 1, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@guibranco guibranco merged commit 7ddb08f into main Sep 1, 2024
16 of 19 checks passed
@guibranco guibranco deleted the gitauto/issue-#67-4413c6ab-ca11-4e0e-897b-999730e9e257 branch September 1, 2024 00:28
@guibranco guibranco removed the 🚦awaiting triage Awaiting triage label Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 bot Automated processes or integrations size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant