
Installing a translator on your webpage or blog will do just that. Google translator is the best one.
In this tutorial I will show you how to add a Google translator widget with the corresponding nation’s flag icons.
Here we go...
- Login to your to your Blogger account.
- Go to Design > Page Elements.
- Click Add A Gadget.
- In Add A Gadget window, select HTML/Javascript.
- Enter the title of your widget e.g. Translate This Page. This is optional.
- Copy the code below and paste it inside the window.
- Click Save.
Where :
- SourceLangCode is the code web page original language, TargetLangCode is the code for language you want the page translated into, and InterfaceLangCode is code for Google translator bar language.Where:
- TargetLangName is the name of targeted language.
- Replace all those variables with their respective Google language codes and language name. Refer to the table below.
Language name Code Language name Code Language name Code Albanian sq Hungarian hu Turkish tr Arabic ar Indonesian id Ukrainian uk Bulgarian bg Italian it Vietnamese vi Catalan ca Japanese ja Afrikaans af Chinese (Simplified) zh-CN Korean ko Belarusian be Chinese (Traditional) zh-TW Latvian lv Icelandic is Croatian hr Lithuanian lt Irish ga Czech cs Maltese mt Macedonian mk Danish da Norwegian no Malay ms Dutch nl Persian fa Swahili sw English en Polish pl Welsh cy Estonian et Portuguese pt Yiddish yi Filipino tl Romanian ro Afrikaans af Finnish fi Russian ru Belarusian be French fr Serbian sr Icelandic is Galician gl Slovak sk Zulu zu German de Slovenian sl Greek el Spanish es Hebrew iw Swedish sv Hindi hi Thai th FlagIconURL is the link to the nation flag representing the target language. You can download free flag icons from
Custom Icon Design, FamFamFam or MarkFennel.com. Then upload the ones you need to an image host such as Photobucket, Flickr or Picasa. Once uploaded, get the link to each image an use it to replace FlagIconURL.
I’ve put a class name to the code, so you can easily style the flag if you want. Add the codes below before or after the translator code.
Here is a working sample of actual translator flags and their codes. The first one translates from English to Indonesian, with English interface. The second one translates from English to Spanish with Spanish interface.
Enjoy!
0 comments:
Post a Comment