-
Notifications
You must be signed in to change notification settings - Fork 83
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
I want to internationalize this project so that it supports Other language #140
Comments
May I ask what you think of that? |
Hi @CaryTrivett - thanks for reaching out! Can you please outline how you plan to do it? Will you be creating a list of strings and replace all embedded strings to reference them? |
before
after1. use
|
Perfect! Looks like a good approach! Thanks for thorough comment. A few thoughts: 1- I see you're using a default value inline - which is exactly what we define in EN: <div>{localize('caprover.login', 'CapRover Login')} </div> What's the point of this duplication? Can we just not use the English variant if the selected variant isn't available? 2- Generally speaking, I don't see the value of function localize(key:string) {
const lang = localStorage.language || navigator.language || navigator.userLanguage || 'en';
return resources[lang][key] || resources['en'][key]
} |
This has many advantages
|
It's fine to not use third party libraries, that's what I did before This is a parsing script I developed |
Oh I see! I misunderstood how this works. Just to make sure my understanding is correct: |
yes |
Sounds good! Feel free to start with a small PR (perhaps just the login page). So that we can see how this is implemented and how it works. |
Just curious how the other language will work with One-Click-Apps? Do you plan to only translate the frontend or all Caprover's project? |
If you agree, I will submit pr
The text was updated successfully, but these errors were encountered: