prompt end user to select language [prove of concept]
#1
I have written a script so when the user startup xbmc for the first time, the user will be prompted for a menu to select the desired language to use.

The current situation with XBMC (internationalize) is that an end user without knowledge of English will not able to use XBMC (with default settings) without any help. In my view, this is not good enough.

My script does not attempt to solve it, instead I would like to deliver a message that it can and should be done to improve experiences for non-English speaking users.

Screen shot:
Image

I have tested on Ubuntu 8.10 with XBMC svn @19419. (found some bugs as a co-product of the script, which I will file tickets)

To have a demo Ubuntu 8.10 system you should:
  • Set up a proper font
    You need a font that can display words/characters in user's desired language.

    For Chinese (simpled or traditional), you can try
    Code:
    sudo apt-get install ttf-wqy-zenhei
    sudo cp -a /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf /usr/share/xbmc/media/Fonts/arial.ttf
    This will install wqy fonts and overwrite the arial.ttf installed by xbmc.


  • install autoexec script
    copy from http://code.google.com/p/xbox-remote/sou...utoexec.py and save it to
    Code:
    /usr/share/xbmc/autoexec.py

  • install select-language script
    copy from http://code.google.com/p/xbox-remote/sou...startup.py and save it to
    Code:
    /usr/share/xbmc/scripts/select-language.py

  • install welcome.xml
    save the following code to /usr/share/xbmc/language/English/welcome.xml
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--$Revision: 19319 $-->
    <strings>
      <!-- strings 30000 thru 30999 reserved for plugins and plugin settings -->
    <string id="30000">English</string>
      <!-- strings 31000 thru 31999 reserved for skins -->
      <!-- strings 32000 thru 32999 reserved for scripts -->
    </strings>

    save the following code to /usr/share/xbmc/language/Chinese (Simple)/welcome.xml
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--$Revision: 19319 $-->
    <strings>
      <!-- strings 30000 thru 30999 reserved for plugins and plugin settings -->
    <string id="30000">简体中文</string>
      <!-- strings 31000 thru 31999 reserved for skins -->
      <!-- strings 32000 thru 32999 reserved for scripts -->
    </strings>


  • Remove user setttings
    Code:
    rm -rf ~/.xbmc

  • Startup XBMC in respawn mode
    copy from http://code.google.com/p/xbox-remote/sou...rt-xbmc.py and save it to start-xbmc.py. Run it with
    Code:
    python start-xbmc.py
Reply
#2
Really nice!

Could you open a ticket for this?, I see a great usage for this in XBMC Live but all ports for sure, but they could instead read the OS settings.

Cheers,
Tobias
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
Topfs2 Wrote:Really nice!

Could you open a ticket for this?, I see a great usage for this in XBMC Live but all ports for sure, but they could instead read the OS settings.

Cheers,
Tobias

@tobias

Ticket was created: http://trac.xbmc.org/ticket/6348

I am bit worried about the font rendering engine in XBMC, I have not heard it's possible to use multiple fonts (i.e. one font for certain language(s) and another for another set of language(s) etc.). But even the font engine is not ready, we still can do some magic things like dynamic create symbolic (or just copy) of "arial.ttf" and point it to the right font according to what the end user choose.

There is one possible bug related with setting language through httpapi, could you have a look and possibly assign it someone?
http://trac.xbmc.org/ticket/6341

Many thanks
Reply
#4
Updated my code, now you can specify font file to be used for each language (set in welcome.xml file)

For anyone interested please get it form svn
Code:
svn checkout http://xbox-remote.googlecode.com/svn/trunk/select-language select-language
  • copy the whole folder to your user's script folder
    Code:
    cp -a select-language ~/.xbmc/scripts/

  • create user fonts folder
    Code:
    mkdir ~/.xbmc/fonts/
    and copy any fonts you want to use to the above folder



  • Modify desired language welcome.xml inside ~/.xbmc/scripts/select-language/resources/language

    example welcome.xml for English
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <!--$Revision: 19319 $-->
    <strings>
      <!-- strings 30000 thru 30999 reserved for plugins and plugin settings -->
    <string id="30000">English</string>
    <string id="30001">wqy-zenhei.ttf</string>
      <!-- strings 31000 thru 31999 reserved for skins -->
      <!-- strings 32000 thru 32999 reserved for scripts -->
    </strings>
    The string id="30001" sets the name of the font to be used for that language.



  • Create a symbolic link arial.ttf in xbmc default font folder
    Code:
    sudo rm /usr/share/xbmc/media/Fonts/arial.ttf
    sudo ln -s /usr/share/xbmc/media/Fonts/arial.ttf ~/.xbmc/fonts/arial.ttf

  • Run the script and select the desired language


The only challenge we are facing is to find a good unicode font that supports various language. "unifont" maybe a good start. Screenshot:



Image
Image
Reply
#5
A lot progress has been made.

It's now very easy to test it out. If interested please go to following discussion on the form

http://forum.xbmc.org/showthread.php?tid=48971

screen shots:

Image

Image

Image

Image

Image

Image
Reply

Logout Mark Read Team Forum Stats Members Help
prompt end user to select language [prove of concept]0