I'm trying to add multiple language support in my website. It would support English and Chinese. How do i do it using a properties file.
Thanks.
Related
I´m developing a webpage and it has some entries in which it would be interesting to force my web server to show an html file not only autotranslated (mainly between english and spanish) but also to load the specific social media links which are created in those languages (as there is an English Instagram version and another Spanish one, an English Twitter account and another for Spanish, and so on), depending on the physical location of the webpage users.
Thanks in advance.
In principle you could detect the location. But I am guessing that what you really want is to detect the language of the user. For this there are multiple ways, see e.g.: JavaScript for detecting browser language preference
Is it possible to use macro's in a PowerPoint presentation that has been converted to a HTML5 package?
No. Macros = Visual Basic for Applications, a programming language that's not supported in HTML. Even if it were, the code would be designed to act on the shapes and other objects in a PowerPoint presentation; you'd be running it in a web page. A bit like trying to follow a recipe for spaghetti & meatballs using the ingredients you'd find in an automobile mechanic's toolchest. ;-)
Does anyone have any idea that HTML5 has multilingual support.
I mean to say if I design my website in English and html5 will convert that using some lang or translate or any other supportive tag will convert that web page into a respective language.
Any guidance or bit of code can help me a lot.
Thanks a tons!!!
HTML5 doesn't translate anything. It’s simply a markup language that displays the contents you have put inside it without applying any logic to it.
However, such translations are usually done by modern browsers like Chrome, FireFox etc. Advance browsers do detect that the website you are viewing is in some other language and offer you the choice to convert it to your preferred language.
Only thing that HTML5 has in connection with this whole translation thing is that it has a new attribute called translate. By using this attribute with a value of "no" you can now flag elements that you don't want to be translated by browsers:
<span translate="no">衝撞撞沒輸贏」應是「衝衝撞撞沒輸贏</span>
<!--Now no browser will dare to translate this.-->
The question is - do you want to auto-translate the content, or do you want to translate the user interface of your website.
By itself HTML5 doesn't really provide complete support for either, only some hints, and even they are not really implemented everywhere.
You can add a Google Translate button to your website, as described at http://www.labnol.org/internet/google-translation-widgets/10135/ , for example. Google Chrome has it built-in and it works for all websites. Other browser may get such functionality in the future, but that is a feature of the browser application and not of HTML.
For translating your site's interface you can use one of the many internationalization libraries. Many CMS's and web frameworks come with such an i18n library. You can also do it client-side, using a library such as jquery.i18n ( https://github.com/wikimedia/jquery.i18n/ ).
(Disclaimer: I am one of the developers of juery.i18n.)
Finally, just a tip about good practice: Do use the lang attribute on all the relevant HTML elements. Even if it's just "en". This is useful for spell checking, picking the correct fonts, translation, etc. Whenever you know the language, specify it. It may seem redundant, but it is needed.
There is no integrated translation in HTML5. HTML provides support for the lang attribute which indicates what language a given tag's content is written in, but this is merely an indicative attribute which does not modify the content in any way.
The more philosophical reasoning behind why there is no automatic translation is that HTML is a structural language... it defines the framework upon which your web page is built. Not only does it not modify content, but if it did you as the developer would lose control over the quality and accuracy of the translation. This could be a very bad thing...
As you must already know, however, Chrome will translate pages in foreign languages for you into your preferred language. The difference here is that Chrome is controlled by the user, who has the power to decide in what language to view the content as well as whether they wish to view the original content which is explicitly defined by you, the developer.
Translation is up to the browser. To translate, you need a translation engine which will actually do the translation for you. As you know, you can't simply convert words one by one and end up with a proper translation in the other language. Chrome leverages the power of Google Translate to translate its pages and this is how it offers this functionality. Your best bet for multilanguage support is to offer your pages in as many languages as you accurately can, and then hope that users who don't use Chrome will plug your URL into Google translate or a similar service to get an approximation of your content in their native tongue.
I want to make an application for J2ME phones.
In that application I want to use HTML5,
how I can do this?
I worked on LWUIT. Does LWUIT support HTML5?
Or give me any other browser info.
LWUIT/Codename One support HTML5 but not on J2ME.
There's no built-in HTML5 (or any HTML version, for that matter) parser or renderer in J2ME. There's some sort of HTML viewer support in the LWUIT library, but I suspect it is reasonably limited in general, and also in particular regarding specifically HTML5 support. In any case, research LWUIT and see if it is enough for your needs or not (hard to say without knowing your real/actual requirements).
It is also not very practical to write your own HTML parser and renderer (especially if you also need to be able to handle CSS and JavaScript). In essence, you'd have to write your own complete web browser in J2ME.
You can, of course, use platformRequest() to launch the default browser, but not that many mobile phones have HTML5 support yet.
If you also manage the server-side (where the HTML5 pages come from), and all you really need is the data, then write the server code to return/send the data to your J2ME MIDlet as either XML or JSON, which are much easier to handle.
How can I create a website using Tamil Font instead of English?
You should be able to use Tamil by creating a site that uses UTF-8 as an encoding. Here's a web site that explains how:
http://tlt.its.psu.edu/suggestions/international/bylanguage/tamilchart.html