Archived

This topic is now archived and is closed to further replies.

Lord Alderaan

Multi-Language support for WebUI

Recommended Posts

This Community Effort is now redundant. The new test version has multi-language support that is more extensive and easier to maintain because it uses the µtorrent language pack translations.

bumblebee made a localized version of the webui but it is hidden amongst the many posts of the WebUI v0.310 Public beta 2 topic. This webui allows users (including yourself) who visit your webui to display it in their own language (if available). I thought it might be easier if we made a separate topic.

Installation:

Download the most current version of the modified webui.zip from any of the following links:

Rectangular Flags:

No longer available.

Circular Flags:

http://www.utorrent-deutsch.de/downloads/webui_round.zip - (you have to rename this file back to webui.zip after downloading)

And overwrite your current webui.zip with it.

Then simply login. It should auto-detect your language. If it doesn't click the (English) flag and select the flag that represents your languag.

Code Developement:

It all started here when bumblebee decided to make a localized version for Russian and English combined. He modified the original webui files to incorporate this. Ceres soon jumped in to help with the Italian language, suggestions and tweaks. A fix for an old minor (not language related) issue was added to the code by LordAlderaan. More an more languages are being added by various people (see below). A while later spide added a few extra lines to the language files. In May 2008 Novik expanded the webui with a speed tab and some fixes of the code including support for some browsers (Fx3b, Opera, Safari, IE6) and moving the Request Timeout popup to the logger.

Languages:

Russian and Ukrainian by bumblebee

Italian by Ceres

Chinese Simplified by skevin

Czech by emc

Slovak by AndzinSan (posted by emc)

Polish by penknife

Dutch by Lord Alderaan

Spanish by spide

Hungarian by smici

German by schnurlos

Finnish by Spike_B

Portuguese (Brazil) by oszy007

French by Platoon21, Zempashi and Pgase.

Latvian by vebero.

Danish by Denhart.

Swedish by Itanium

Croatian by zvonac99


Adding support for your language:

Please note that a new version of the webui is released and it has its own Multi-Language support making this work obsolete.

Please only add a language if you are completely fluent in it. So preferably your native tongue. Don't try to show us your elite babelfish skills we won't appreciate it!

Simple:

Download the en.js file here, open it with a text editor and translate all the values (the ones between the "s) in it. Also change the File Name and description (Use the English name of your language) almost at the top of the file and place your nick and email as File Author.

Then get that file to us. For example:

* If you have webspace you can upload it there and post a link here.

* or else paste it to http://pastebin.com/ and post the link here.

Advanced:

You can edit the webui.zip yourself. Download the newest version linked above. Extract it to a folder.

First we need your two-letter language code.

Open the langs.js file in the lang folder in an text editor find the * languages: line (it is probably line 27). In that line search for the two-letter code that represents your language. For example there is a bit that says ,ca:'Catalan',. This means ca is the two-letter language code for Catalan. You can copy the whole bit between the two comma's cos we need it in the next part.

Now look for the 'var AvailableLanguages =' line (41). Below it is a list of currently installed languages. Add your language at the appropriate place (it should be sorted alphabetically by English name of your language. Exceptfor English which is always the top item.). Make a new line and paste the bit you copied from the language line (27). Make sure that (unless your item is the last in the list) you close with a comma (,).

Save and close the langs.js file.

Now make a copy of the en.js file in the lang folder and rename it to your-language-code.js and translate all the values (the ones between the "s) within to your language and change the the filename and description (use the English name of your language) almost at the top and place your nick and email as File Author.

Last but not least create a 24x24 pixel png image file of your language's flag. Try to make one that looks the same as the others (easiest way: make a 22x14 flag, add grey top-left border, add black bottom-right border, add 4 transparent pixels at top and bottom). Save it as your-language-code.gif in the images folder.

Now re-create the webui.zip. Use normal .zip compression and make sure you do not place the files in a sub-folder in the .zip. Then upload it to your webspace and paste the link to it and the language you added here.


Update 2008-01-28:

Included Chinese language by Skevin.

Update 2008-02-06:

Included Spanish language by spide.

Update 2008-02-15:

Update to new version which includes an update to all languages made by spide.

Update 2008-02-26

Updated Czech and Slovak version.

Update 2008-03-03

Included Hungarian language by smici.

Update 2008-03-04

Included German language by schnurlos.

Update 2008-03-10

Included Finnish language by Spike_B

Update 2008-03-23

Included Portuguese (Brazil) by oszy007

Update 2008-04-14

Various updates and fixes (see posts below)

Update 2008-05-19

Expansion by Novik (see posts below).

Update 2008-05-26

French by Pgase (see posts below).

Update 2008-06-23

Latvian by vebero (see posts below).

Danish by Denhart (see posts below).

Some flags changed.

Update 2008-07-03

Swedish by Itanium.

Update 2008-07-07

Few small changes and fixes and added a webui.zip which has circular flags that are more in line with other webui buttons (see posts below).

Update 2008-07-31

Croatian by zvonac99 (see posts below).

Update 2008-08-28

This Community Effort became redundant :(

Note 2009-05-27

The newest version of the webui now also has the speed tab.

Share this post


Link to post
Share on other sites

I isnstall it 1 week ago, and have no problem.

I just update because mi Lenguage is Spanish, and you updated. and now is not

working.

after the login page I get just 2 lines in the middle of the screen (as it was starting, ) but it stay there.

I am using Firefox 2.0.0.12 in Spanish.

Share this post


Link to post
Share on other sites

I delete the old file and go back to the same file from spide.... Now to try what you ask , i download the new one agan and thisone work fine.

The lenguage I get is, in the login form is spanish all the time

and inside the WebUI i get the same I used the last time.

If i change to polish, when i login again i get in polish

if i change to spanish , i get spanish as well.

I am using Firefox 2.0.0.12 in Spanish.

I try to run in in IE7 (not that i like it), and either version do not work,

i got the error

Char: 2

"WUILang" is undefined.

code 0

Hope it was helfull, any thing else, l'll be arrownd

Share this post


Link to post
Share on other sites

Well I'm asking about the first time. Right now you have a cookie deciding the language. You can try deleting the cookie in question if you know how. Then close and open fx (to be sure) and open the webui and tell me if u get English or Spanish.

Share this post


Link to post
Share on other sites

i put the webui in english first, and then i delete the cokies. (to make sure the selection)

After restarting the Firefox i got login and i got it in Spanish form start as you were specting.

---

I have 2 Computers right now at home. and after testing from my Laptot (all OK) i try loging form remote ( the desktop).

I dont get to open the Webui , i just got the 2 lines in the middle of the screen like before.

Then i switch to the old version (with latino in spanish picture) and it work fine, then i Select lenguaje to english. and i Log In. OK.

then i update the laptop again, and form the desktop i log in again and now it work fine.

So It meant that If you havent use the Webui before, something is mising and dont let you use it.

once you use the old version and change language, then you can upgrade and will work ok.

anything else, just ask.

Share this post


Link to post
Share on other sites

it works on a actualization, the very last version. the Lord Alderaan version on the Firefox. but on a new firefox it does not.

on a fresh Firefox (never used Before on webui) it does not work, until you install spide version of WEBUI and login and change the lenguage. then you upgrade to lord alderaan and it works.

Once it work, I errase cokies and have no more problems, it work fine.

Share this post


Link to post
Share on other sites

I downloaded the latest Spanish Fx2 to test it myself and it returned es as language abbreviation.

Try for yourself here:

http://cdlist.mine.nu/dump/language.html

I get

navigator.userLanguage = undefined

navigator.language = es-ES

webui's GetActiveLanguage() function = es

With the Spanish version.

If you get sp please let us know. Also tell us which version of which browser you are using?

Share this post


Link to post
Share on other sites

I have Firefox 2.0.0.12

I get the same as you here.

navigator.userLanguage = undefined

navigator.language = es-ES

webui's GetActiveLanguage() function = es

With the Spanish version.

Once it work, will work always, .... but it does not work your version if is the firstime and havent set the lenguage before.

I just told what i see in my last 2 posts.

I will try again at work with another computer.

Share this post


Link to post
Share on other sites

It seems that fx does not get machine's language as navigator.userLanguage =" ", I tried with IE and It posts navigator.userLanguage=es-cr. I think fx instead uses its own language code and sets to "es-Es" (es=español and ES=España).

A question, can the script recognize the the hole string of the var navigator.language?, If so, then we can trim it from es-ES to just "es" and pass it as value to the WEBUI.

comments...

Share this post


Link to post
Share on other sites

Everything (including autodetecting spanish browsers) and is working correctly in the webui linked in the Opening Post.

FYI:

IE uses navigator.userLanguage

Fx and some other browsers use navigator.language

The script checks both and only take the first two letters of it.

Try http://cdlist.mine.nu/dump/language.html

GetActiveLanguage() is the webui function that checks the browse language and sees if the webui has a localized version. If GetActiveLanguage() returns en then you either have an English browser or your language is not (yet) supported by the webui. If it returns anything else (like es) then your browser language was properly detected and the webui should display in your language by default.

Share this post


Link to post
Share on other sites

Czech and Slovak updated.

Download WebUI (2008-02-25)

http://www.utorrent.cz/dwn/webui.zip

____________________________________________________________________

Lord Alderaan,

when you are updating WebUI.zip write me an announce to my email.

I wish to keep WebUI link at utorrent.cz up to date.

thx

emc

Share this post


Link to post
Share on other sites

I've updated the cdlist webui.zip file and I've also included your link again.

I'll keep you posted about new versions. If you want to follow all activity closely you can also subscribe to this thread (I did too) and you'll get an email every time someone replies.

[update 2008-03-03]

I've updated the fist post with the Hungarian language including the fixed flag.

Share this post


Link to post
Share on other sites

Ok updated first post. I'll notify schnurlos of future updates through mail and added his links to the mirrors.

I've updated my version of the webui.zip to fix the alphabetic sorting... again :P I hope you guys copy it over.

Most commonly lists of languages are sorted by the English name for the language. Sometimes it is sorted in the localized version of each language (wikipedia for example) but almost never according to the 2 letter iso code.

I think its best to stick to the first (English name for the languages) so people will find their flag at a reasonably logical place.

Share this post


Link to post
Share on other sites

Lord Alderaan,

Check isn't the same as Czech :P

(at the first post, use CTRL+F)

What about to buy utorrent.nu? ;)

Share this post


Link to post
Share on other sites

Sorry about that. Fixed.

Heheh cdlist.mine.nu is a free domain I've owned for many years. Its a wastelands domain for me where I host all kinds of stuff. I have other proper domains but I don't want to use them for this.

.nu is almost similar to .com/.net/.org

I'm dutch and our top level domain would be .nl

Share this post


Link to post
Share on other sites

Made Finnish translation, and 'cause i'm a noob, couldn't make äö work (I think they're called scands in English). If some1 knows how to make them work, send me email, it's in the file author for finnish text file. And if some finn discovers misspellings, same thing. Here's the link: http://sooda.dy.fi/fpaste/index.php?f3w&imase

E: There were so much scands that questionmarks made reading next to impossible, so i changed them to a or o. Gona change them back when know how to make them show properly.

E2: Never mind those scands, know now how to fix them, gona make update soon.

E3: Now fixed those scands and few misspellings, don't worry, i won't do any more edits or versions of webui for a while.

Share this post


Link to post
Share on other sites