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

implement i18next and add some example translations including german #588

Merged
merged 17 commits into from
Jul 14, 2023

Conversation

flx-sta
Copy link
Contributor

@flx-sta flx-sta commented Jul 11, 2023

PR Creator Checklist

Ensure you've checked the following before submitting your PR:

  • You've discussed making your changes with a member of the dev team per contributing rules in the README
  • Your changes are free of any lint errors
  • Your changes are free of any typescript errors
  • You've tested your changes

Summary

It adds a general internationalisation (i18n) implementation that can be extended to the whole application. For now I've only translated a bit (english and german) for presentational purposes

Screenshots

Test Plan

If you want to check the application in german you either have to set your device to german or open the branch in your IDE and in i18n.ts add the lng property with "de" as value:

i18n
  .use(languageDetector)
  .use(initReactI18next)
  .init({
    resources: {
      en: {
        translation: english,
      },
      de: {
        translation: german,
      },
    },
    fallbackLng: "en",
    lng: "de",                      // <--------------------
    interpolation: {
      escapeValue: false, // react already safes from xss => https://www.i18next.com/translation-function/interpolation#unescape
    },
    compatibilityJSON: "v3",
  });

fixes #586

@ann0see
Copy link

ann0see commented Jul 11, 2023

Great! I also thought about requesting that. Thanks!

In our project (jamulus.io) we use a web app for easier translation by the community. We use Hosted Weblate but I think there are others too.

@flx-sta
Copy link
Contributor Author

flx-sta commented Jul 11, 2023

@ann0see yeah I could see that in the future as i18next has support for that but 1 thing after another 😁

https://react.i18next.com/guides/multiple-translation-files#manage-your-translations-with-a-management-gui

@gkasdorf
Copy link
Collaborator

This is great. Holding off on merging as you requested.

@gkasdorf
Copy link
Collaborator

@Felix-Staud Let me know whenever you think this is good to go. I tested it and it seems great!

gkasdorf and others added 4 commits July 13, 2023 00:57
…86-i18n

# Conflicts:
#	src/components/common/Comments/CommentBody.tsx
#	src/components/screens/Onboarding/OnboardingIndexScreen.tsx
# Conflicts:
#	src/components/screens/Settings/Account/EditAccountScreen.tsx
#	src/components/screens/Settings/Account/ViewAccountsScreen.tsx
@flx-sta
Copy link
Contributor Author

flx-sta commented Jul 13, 2023

@gkasdorf It's now ready to be merged.
Unfortunately a full fledged review will take forever but isn't that what a beta testing is for ? 👀

@gkasdorf gkasdorf merged commit 18584f2 into Memmy-App:main Jul 14, 2023
2 checks passed
@flx-sta flx-sta deleted the feature/586-i18n branch July 14, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internationalisation (i18n)
3 participants