LinuxMCE Forums
May 25, 2013, 03:27:49 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Translation of UpdateEntArea captions  (Read 1616 times)
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« on: September 07, 2009, 11:10:18 am »

Hi,

I'm trying to make a Russian translation of LinuxMCE GUI. So, all English caption from the table Text_LS were translated and inserted into that table with new language. The item of top level menu such Light, Media, Security etc are showed on Russian. But items of menu Media - Video, Audio, Pictures etc, for example, are still in English. But I'm sure that translations of that items are exists in the Text_LS.

The same problem with Italian or German languages. Any suggestions how to solve that?

TIA
« Last Edit: October 04, 2009, 12:25:43 pm by nite_man » Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #1 on: September 07, 2009, 08:35:29 pm »

Someone needs to look into UpdateEntArea to see if it's possible to use <%=Txxxx%> variable substitutions instead of the "Audio" "Videos" "Pictures" etc that currently exist in there.

If you look on the Orbiter Variables page in the wiki, you'll see that <%=Txxxx%> where xxxx is the PK_Text # of a text object in designer.

-Thom
Logged
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #2 on: September 08, 2009, 07:38:39 am »

Thanks a lot, Tom. Will check it and try to fix.
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #3 on: October 03, 2009, 12:29:28 pm »

I dig a bit UpdateEntArea to see how to use description from the Text_LS instead of hardcoded ones. So, approach with <%=TXXXX%> actually needs function to get description for caption according to its ID. Something like that (got it from OrbiterGen/OGText.cpp):
Code:
Row_Text_LS *CGText::GetText_LS(int PK_Text,OrbiterGenerator *pOrbiterGen)
{
    Database_pluto_main *mds = pOrbiterGen->m_spDatabase_pluto_main.get();
    Row_Text_LS *pRow_Text_LS = mds->Text_LS_get()->GetRow(PK_Text,pOrbiterGen->m_pRow_Language->PK_Language_get());
    if( pRow_Text_LS==NULL )
        pRow_Text_LS=mds->Text_LS_get()->GetRow(PK_Text,0);
    if( pRow_Text_LS==NULL )
        pRow_Text_LS=mds->Text_LS_get()->GetRow(PK_Text,1);
    if( pRow_Text_LS==NULL )
    {
        LoggerWrapper::GetInstance()->Write(LV_CRITICAL,"Warning!  Text Object: %d no text",PK_Text);
        pRow_Text_LS=mds->Text_LS_get()->GetRow(TEXT_USR_ENTRY_CONST,1);  // Generic text object
    }

    return pRow_Text_LS;
}

As you may see it takes PK_Text and OrbiterGenerator as parameters. OrbiterGenerator is needed to get database handler and language ID used for the specific Orbiter. So, database handler exists in the UpdateEntArea. But I cannot find a way to get used language. Tom, maybe you can have some idea how to do that?
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #4 on: October 04, 2009, 12:35:33 pm »

After digging a code I found that UpdateEntArea menu items are not related with Orbiter.  Because one Orbiter can display menu for each room/EntArea. So, as a solution to have translated menu for EntArea we can do following. UpdateEntArea will build CommandGroup arrays for each language which is available in the system. And then the Orbiter will take appropriate CommandGroup according to set language. Not sure that this is effective way. But at least it should work.
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #5 on: October 04, 2009, 03:19:02 pm »

sounds okay to me.

-Thom
Logged
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #6 on: October 04, 2009, 06:54:48 pm »

sounds okay to me.

-Thom

Or maybe it can be done by another way. Correct me if I'm wrong. All group of commands generated by UpdateEntArea are stored in the table CommandGroup. And then OrbiterGen takes them and produces the buttons. If so instead of actual description such Video or Audio we can store in that table PK_Text and retrieve appropriate description according to set language. Because inside OrbiterGen we now the what Orbiter is generated and what its language is.
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
tschak909
LinuxMCE God
****
Posts: 5101

DOES work for LinuxMCE.


View Profile
« Reply #7 on: October 04, 2009, 07:16:15 pm »

i think you're right.

-Thom
Logged
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #8 on: October 12, 2009, 02:26:23 pm »

I played a bit with UpdateEntArea and OrbiterGen and found the way to translate the captions. See result below:



Will open a new ticket to describe what should be change and then commit my changes if they'll be accepted.
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #9 on: October 12, 2009, 02:57:30 pm »

Added a new ticket regarding the subject - http://svn.linuxmce.org/trac.cgi/ticket/366

Fill free to add your ideas and suggestions Smiley
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
nite_man
NEEDS to work for LinuxMCE
***
Posts: 1019


Want to work with LinuxMCE


View Profile WWW
« Reply #10 on: October 26, 2009, 05:21:22 pm »

Well, IMHO it's up to you how to translate that text. For example, in Russian we have similar words for feeds, news, peers etc. In any case, if you think that users will understand it leave those phrases in English or type them on German but without translation if it's ok.
Logged

Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!