github-langs
github-langs copied to clipboard
Support dual-language
Current behavior:
Only support English
with no localization
Expected behavior: Support English and Indonesian
Steps to reproduce: Go to the homepage
Can we do multi-language though using our template engine (handlebars)?
Which files need to be translated into Indonesian? Maybe I can help?
I'm planning to translate this into Indonesian because that's my native language :sweat_smile: I can provide the translation but I need your help to find a way to do the localization using handlebars. Maybe these links would help?
- https://stackoverflow.com/questions/7760332/how-to-make-i18n-with-handlebars-js-mustache-templates
- https://coderwall.com/p/77flzq/localized-templates-with-handlebars-mustache
Pretty much everything needs to be translated (Footer label, the random statements, buttons). But I think we can start by providing a simple button at the top-left of the page in which we can easily switch from English to Indonesian content.
What do you think @dhapin ?
Adding this to the milestone: https://github.com/wildan3105/github-langs/milestone/3 for better trackability
Do you think this is correct? #173 Sorry if there are some errors :(
I think you misunderstand :sweat_smile: What I mean is to support, not just translate. If just translating, then it will change the whole content to Indonesian. Please update your implementation to support both Bahasa Indonesia & English
Do you think this is correct? #173 Sorry if there are some errors :(
Never mind the warning, it doesn't matter as long as it's passing the unit test.
I believe you can utilize this library: https://github.com/mashpie/i18n-node
Let's make a simple change first, starting from the footer content so it will have both EN
and ID
content.
You can find the footer content here: https://github.com/wildan3105/github-langs/blob/87665d6f0bf3de1235f2c25bda3733e58bc75d9d/views/partials/body.handlebars#L100
How?
I dont really understand what you mean
Your pr is only translating the content, not supporting dual-language. Are you aware of it firstly?
If you're aware, then you can update your implementation if you still work on this issue (take a look at this example: https://gist.github.com/mashpie/5246334). Else, I'd do it by myself.
If this is too complicated for you, contribution to other issues are also welcome :slightly_smiling_face:
I'm planning to translate this into Indonesian because that's my native language sweat_smile I can provide the translation but I need your help to find a way to do the localization using handlebars. Maybe these links would help?
* https://stackoverflow.com/questions/7760332/how-to-make-i18n-with-handlebars-js-mustache-templates * https://coderwall.com/p/77flzq/localized-templates-with-handlebars-mustache
Pretty much everything needs to be translated (Footer label, the random statements, buttons). But I think we can start by providing a simple button at the top-left of the page in which we can easily switch from English to Indonesian content.
What do you think @dhapin ?
Sorry if I'm being not clear here. My apologies but I think you already got my point right? It's for supporting dual-language, not just translating it.
Can you explain it in Indonesian? :)
Oke tidak apa-apa karena sesama orang Indonesia ya haha. Jadi kebutuhannya adalah untuk men-support dua bahasa, Indonesia dan Inggris. Bukan menerjemahkan, tapi menyediakan opsi agar pengguna bisa memilih antara bahasa Indonesia dan Inggris.
bikin tombol baru di kiri atas?
Cara biar 1 html bisa berisi 2 bahasa gimana?
Ok sepertinya saya sudah ada ide
Silahkan dicek @wildan3105 untuk PR #176 🙏
Perubahan ini akan mengikuti bahasa yang digunakan browser, jadi tidak ada element html yang ditambahkan.
Sorry @dhapin, I had to close this as this is no longer valid for the future of this project. Thanks for taking the time to work on this!