Author Topic: Translation of UpdateEntArea captions  (Read 6886 times)

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Translation of UpdateEntArea captions
« on: September 07, 2009, 12:10:18 pm »
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, 01:25:43 pm by nite_man »
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: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Translated captions are not displayed somewhere in UI2
« Reply #1 on: September 07, 2009, 09: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

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Translated captions are not displayed somewhere in UI2
« Reply #2 on: September 08, 2009, 08:38:39 am »
Thanks a lot, Tom. Will check it and try to fix.
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
    • Smart Home Blog
Re: Translated captions are not displayed somewhere in UI2
« Reply #3 on: October 03, 2009, 01: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: [Select]
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?
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
    • Smart Home Blog
Re: Translation of UpdateEntArea captions
« Reply #4 on: October 04, 2009, 01: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.
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: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Translation of UpdateEntArea captions
« Reply #5 on: October 04, 2009, 04:19:02 pm »
sounds okay to me.

-Thom

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Translation of UpdateEntArea captions
« Reply #6 on: October 04, 2009, 07: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.
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: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: Translation of UpdateEntArea captions
« Reply #7 on: October 04, 2009, 08:16:15 pm »
i think you're right.

-Thom

nite_man

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1019
  • Want to work with LinuxMCE
    • View Profile
    • Smart Home Blog
Re: Translation of UpdateEntArea captions
« Reply #8 on: October 12, 2009, 03: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.
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
    • Smart Home Blog
Re: Translation of UpdateEntArea captions
« Reply #9 on: October 12, 2009, 03: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 :)
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
    • Smart Home Blog
Re: Translation of UpdateEntArea captions
« 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.
Michael Stepanov,
My setup: http://wiki.linuxmce.org/index.php/User:Nite_man#New_setup
Russian LinuxMCE community: http://linuxmce.ru