I have a site pletely in English!
What I want is to facilitate it with a drop down menu or some link for the Middle East Users to be able to view it in Arabic.
In short I want my website pages to be changed to Arabic when Arabic drop down or some link is clicked.
I have a site pletely in English!
What I want is to facilitate it with a drop down menu or some link for the Middle East Users to be able to view it in Arabic.
In short I want my website pages to be changed to Arabic when Arabic drop down or some link is clicked.
Share Improve this question edited Dec 20, 2012 at 21:13 hakre 199k55 gold badges450 silver badges856 bronze badges asked Apr 28, 2011 at 6:47 cheedacheeda 211 silver badge5 bronze badges 1- Are you trying to incorporate Google's translate tool? – Jan Hančič Commented Apr 28, 2011 at 6:49
4 Answers
Reset to default 2The most important thing that you should be noted is that Arabic is right-to-left and English is left-to-right. So this makes translation difficult.
First of all you should add direction="rtl"
to body
or specific element when you're switching to Arabic. After that you should redefine your CSS with thin new direction. if you had margin-left:20px
it should be now margin-right:20px;
so it can be tricky. I have experience in translation into rtl languages and I can say if you want same user experience it's gonna be painful job!
For translation you should have a database of terms in both languages and use JavaScript to injects terms of new language that user selects in that drop-down list into your DOM. most of the time you should have spans with specefic classes or ids to address every term. It should work like this:
<div id="something" direction="ltr">
<span class="this-is-a-multilingual-term hello">Hello</span>
</div>
javaScript should do this for you:
<div id="something" direction="rtl">
<span class="this-is-a-multilingual-term hello">مرحبا</span>
</div>
Google and Microsoft both offer widgets you can stick on your website. (as others have said it's an automatic translations, so you could get some bad results).
- http://translate.google./translate_tools
- http://www.microsofttranslator./widget/
If you want to pay for real translators; an interesting option: http://amanuens./. You give them access to your source control, and they e in and create all the translation resources for you.
If you want it to be automatic (machine translation), you might look at the Google Translate API. It gives you access to Google's machine translation (the software that handles the http://translate.google. page).
Note that machine translation isn't brilliant. Although a lot of progress has been made the last few years through the shift to statistical translation methods, you can still get some non-sensical results.
Here's an example from that page of using their interface from JavaScript:
<html>
<head>
<title>Translate API Example</title>
</head>
<body>
<div id="sourceText">Hello world</div>
<div id="translation"></div>
<script>
function translateText(response) {
document.getElementById("translation").innerHTML += "<br>" + response.data.translations[0].translatedText;
}
</script>
<script>
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
var sourceText = escape(document.getElementById("sourceText").innerHTML);
var source = 'https://www.googleapis./language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&callback=translateText&q=' + sourceText;
newScript.src = source;
// When we add this script to the head, the request is sent off.
document.getElementsByTagName('head')[0].appendChild(newScript);
</script>
</body>
</html>
That example translates one specific part of the page; you'd have to take it from there to translate the entire page.
- Get a decent translation
- This means getting a native speaker who understands the source language (English) and HTML to translate it
- If you are thinking about using automated translation software, stop, it is rubbish and will leave people with a bad impression of your site. If someone wants to use automated translation software, then they can find Google Translate or another software package for themselves. (As a rule of thumb, avoid trying to solve Internet wide problems for users, tools they apply everywhere are better then learning a specialist interface for every site)
- Mirror the site and link to the translated version
- Your CMS might help with this
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745640207a4637645.html
评论列表(0条)