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

Language fallback #943

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

flx-sta
Copy link
Contributor

@flx-sta flx-sta commented Aug 3, 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 implements a logic for fallback languages. Ultimately all languages will fall back to en-US instead of showing the raw translation key. That way its still visible if a translation is missing but you can still "understand" it (as long as you know english).

It will also now use the full translations code (e.g. en-US, de-DE) if possible but fall back to existing ones (e.g. de-AU will fall back to de-DE)

Screenshots

Nothing changed in the UI..

Test Plan

  1. Start the Simulator
  2. Go to Settings
  3. Read the "Check Lemmy Status" label
  4. switch to czech or romanian (those don't have that translation
  5. It will still read the english label instead of some cryptic stuff

- add language fallback method
- rename translation files to match <locale>-<Country-Code> pattern
- add writing to log if a language is missing
- fix profile translation in Navbar
- add some de_DE translations
- adjust stack type
- remove split form languageDetector.ts
- update import names in DayJs.ts
# Conflicts:
#	Stack.tsx
#	src/plugins/DayJs.ts
#	src/plugins/i18n/i18n.ts
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.

None yet

1 participant