There is several way to do so, I can define all the text element, and load the localization string json from javascript, and using some javascript to replace text to do so... Also, I check out there is some other way to do so too. For example, some is using platform depends way to do that. For example, the J2EE have it own way to implement it. Also, I can create separate page for each language.
But is there any way to do localization is flexible or suggested? Thank you.
Website localization is the process of adapting an existing website to local language and culture in the target market. It is the process of adapting a website into a different linguistic and cultural context— involving much more than the simple translation of text.
Localization is the process of adapting a piece of content's full meaning for a new region, including translation, associated imagery, and cultural elements that influence how your content will be perceived. Localization is all about making your website feel like it was written with that audience in mind.
It seems to me that what you are really asking for is: How to implement Localizability correctly? Or how to program in order to make it easy to localize an application.
That is actually Internationalization-related question. There are several things you need to keep in mind in order to make your application easy to localize:
<p style="font-weight: bold;color: green;">Success!</p>
). This will prevent localization guys from modifying them (i.e. removing bolded text from CJKV translations)String message = "Function " + function + " does " + whatItDoes;
or this: #{['something']}<a href="whatever">#{['some_link']}</a>#{['something_else']}
), use formatting instead (i.e. MessageFormat.format("Hello, {0}. You have {1} new messages.", name, mailCount);
). This won't allow the Translator to re-order the sentence and it might be required due to target's language grammar rules.Also, there are things to do:
There is much more things not related to localizability, like language detection workflow, formatting and validating numbers, currencies, dates (including setting proper timezones) that you would need to care about in properly globalized application, but that's actually different story.
Almost all decent web development frameworks out there have a notion of localized "resource bundles". You just make sure that you have a resource bundle for each supported language by your application, wherein each one of them uses the same "key" to refer to a localized string. Just use the facility provided by the framework/language to load the text from the bundle based on the "key" and you should be good to go.
As far as locale detection goes, there are again two ways of doing it; auto-detection, which is a fairly common mechanism used by web applications and selection based mechanism which uses a combination of auto-detection along with a locale drop-down provided to the user.
Specific steps would be language/framework specific so you might want to mention the framework which you are using for specific answers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With