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

Improve i18n support #2418

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

PeterDaveHello
Copy link
Contributor

Just a small improvement, close #2417

@amir20
Copy link
Owner

amir20 commented Oct 15, 2023

Hey @PeterDaveHello so I was testing this. It seems like the below would just work. Vue-i18n would try en-US then en then fallback to fallbackLocale.

--- a/assets/modules/i18n.ts
+++ b/assets/modules/i18n.ts
@@ -9,7 +9,7 @@ const messages = Object.fromEntries(
 );
 const i18n = createI18n({
   legacy: false,
-  locale: navigator.language.slice(0, 2),
+  locale: navigator.language,
   fallbackLocale: "en",
   messages,
 });

Does that work for you too? Which then I think it would be a lot easier.

@amir20
Copy link
Owner

amir20 commented Oct 15, 2023

My solution prints a lot of warnings. So I think this solution is better.

@amir20
Copy link
Owner

amir20 commented Oct 15, 2023

@PeterDaveHello going to merge this. I assume you will send another PR with specific country locales?

@amir20 amir20 merged commit 55775f6 into amir20:master Oct 15, 2023
5 checks passed
@PeterDaveHello
Copy link
Contributor Author

@PeterDaveHello going to merge this. I assume you will send another PR with specific country locales?

Sure

@PeterDaveHello PeterDaveHello deleted the ImproveLocaleSupport branch October 16, 2023 05:33
@PeterDaveHello
Copy link
Contributor Author

@amir20 sent here: #2425

@PeterDaveHello
Copy link
Contributor Author

BTW, this change doesn't seem to be reflected on https://github.com/amir20/dozzle/releases/tag/v5.0.6 changelog?

@amir20
Copy link
Owner

amir20 commented Oct 16, 2023

BTW, this change doesn't seem to be reflected on https://github.com/amir20/dozzle/releases/tag/v5.0.6 changelog?

Your commit didn't have semantic git messages so it didn't get included.

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.

Support for More Specific Locale Codes (e.g., en-US, zh-TW)
2 participants