Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » Can I do RUN-TIME localization files?...
Can I do RUN-TIME localization files?... [message #20882] Wed, 15 April 2009 18:50 Go to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Can I do RUN-TIME language files? (as in Qt products or other linux products have .po files) to be users can append localization?

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Can I do RUN-TIME localization files?... [message #20886 is a reply to message #20882] Thu, 16 April 2009 01:09 Go to previous messageGo to next message
gxl117 is currently offline  gxl117
Messages: 71
Registered: March 2009
Location: China
Member
You can use .tr file for that.to reference http://www.ultimatepp.org/srcdoc$Core$i18n$en-us.html
Re: Can I do RUN-TIME localization files?... [message #20888 is a reply to message #20886] Thu, 16 April 2009 04:40 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Thankx!!

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Can I do RUN-TIME localization files?... [message #20889 is a reply to message #20888] Thu, 16 April 2009 04:52 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Is there any standard way to identify what .tr files are present?

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Thu, 16 April 2009 04:53]

Report message to a moderator

Re: Can I do RUN-TIME localization files?... [message #20904 is a reply to message #20889] Fri, 17 April 2009 10:29 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
sergeynikitin wrote on Wed, 15 April 2009 22:52

Is there any standard way to identify what .tr files are present?


Not at the moment.

Mirek
Re: Can I do RUN-TIME localization files?... [message #21177 is a reply to message #20904] Wed, 06 May 2009 21:05 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

No Message Body

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Wed, 06 May 2009 21:08]

Report message to a moderator

Re: Can I do RUN-TIME localization files?... [message #23602 is a reply to message #20886] Wed, 04 November 2009 06:34 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
is there a example?
i've been using .t file and now trying this.
zhcn.tr has been generated. now how to use it?
i removed code below, which i think should be used only for .t files.
and then my program ran in english, i.e, not localized,
#define TFILE <ezcomm/ezcomm.t>
#include <Core/t.h>
...
::SetLanguage(::GetSystemLNG());
...
Re: Can I do RUN-TIME localization files?... [message #23616 is a reply to message #23602] Thu, 05 November 2009 11:29 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

What operating system do you use?

in windows: simple copy tr-file to program folder,
in linux : copy to home folder;
and read http://www.ultimatepp.org/srcdoc$Core$i18n$en-us.html

Write in detail what you have done and what does not work (and what are your goals).

Most likely I can help, as well as deal with a similar problem recently.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Can I do RUN-TIME localization files?... [message #23621 is a reply to message #23616] Fri, 06 November 2009 04:09 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i'm running on winxp (chinese).
in the same folder, are my exe and tr files. the tr file is exported using "file.exe --export-tr zhcn_" and i've checked that it contains chinese translations.
in my code, i've removed the three lines i specified.
source code is like t_("english"). and it runs showing english, too.
(P.S., i wonder how can exe file determine which tr file to use, if i have multiple tr files, without specifying the last line of the 3 lines' code.)

if i readd the three lines, t file is built in the exe and it shows in chinese.

it would be greatly helpful if some examples could be given. thank you very much.
Re: Can I do RUN-TIME localization files?... [message #23623 is a reply to message #23621] Fri, 06 November 2009 17:27 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

I use the reception, switching language as in the example HomeBudget. (there just in the properties window switch language with dropdown list)

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Can I do RUN-TIME localization files?... [message #23637 is a reply to message #23623] Mon, 09 November 2009 10:28 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
thank you. i got it. the 3 lines of code is still necessary. my program searches for tr files when running. and which languages is used depends on the last line of the 3.
Re: Can I do RUN-TIME localization files?... [message #23654 is a reply to message #23637] Wed, 11 November 2009 02:47 Go to previous messageGo to next message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i thought i got it but did not. when i included the 3 lines, my program was using static translation.
i've looked into .tr's loading procedure. it seems this mechanism is for replacing existing translations in .t, instead of adding new words' translations.

[Updated on: Wed, 11 November 2009 03:42]

Report message to a moderator

Re: Can I do RUN-TIME localization files?... [message #23660 is a reply to message #23654] Wed, 11 November 2009 13:17 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi bonami,
I've just remembered, that I have an old HelloWorld program that I've created when trying U++ for the first time to explore it's possibilities. It can switch languages in the runtime - if I understand correctly, that is exactly what you are looking for.
All the trick is just calling InitLayout after SetLanguage. I hope this example will help you. The package is in the attachment.
Bye
Honza
  • Attachment: hello.zip
    (Size: 3.00KB, Downloaded 356 times)
Re: Can I do RUN-TIME localization files?... [message #23670 is a reply to message #23660] Thu, 12 November 2009 04:09 Go to previous message
bonami is currently offline  bonami
Messages: 186
Registered: June 2007
Location: Beijing
Experienced Member
i'm afraid that was not what i meant.
i want to use .tr files, instead of .t files, so that i do not need to provide translations when compiling and user can add their own languages to .tr files when running.
Previous Topic: GetLanguageInfo() works wrong on unknown languages
Next Topic: more complete lang.cpp
Goto Forum:
  


Current Time: Thu Mar 28 18:24:55 CET 2024

Total time taken to generate the page: 0.00973 seconds