LinuxMCE Forums

General => Developers => Topic started by: nite_man on September 07, 2009, 12:10:18 pm

Title: Translation of UpdateEntArea captions
Post by: nite_man 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
Title: Re: Translated captions are not displayed somewhere in UI2
Post by: tschak909 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
Title: Re: Translated captions are not displayed somewhere in UI2
Post by: nite_man on September 08, 2009, 08:38:39 am
Thanks a lot, Tom. Will check it and try to fix.
Title: Re: Translated captions are not displayed somewhere in UI2
Post by: nite_man 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?
Title: Re: Translation of UpdateEntArea captions
Post by: nite_man 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.
Title: Re: Translation of UpdateEntArea captions
Post by: tschak909 on October 04, 2009, 04:19:02 pm
sounds okay to me.

-Thom
Title: Re: Translation of UpdateEntArea captions
Post by: nite_man 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.
Title: Re: Translation of UpdateEntArea captions
Post by: tschak909 on October 04, 2009, 08:16:15 pm
i think you're right.

-Thom
Title: Re: Translation of UpdateEntArea captions
Post by: nite_man 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:

(http://img-fotki.yandex.ru/get/3710/frezza.6/0_50bf0_101cac42_L.jpg) (http://fotki.yandex.ru/users/frezza/view/330736/)

Will open a new ticket to describe what should be change and then commit my changes if they'll be accepted.
Title: Re: Translation of UpdateEntArea captions
Post by: nite_man 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 :)
Title: Re: Translation of UpdateEntArea captions
Post by: nite_man 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.