Home » U++ Library support » U++ Libraries and TheIDE: i18n, Unicode and Internationalization » how to Internationalize my app?
Re: how to Internationalize my app? [message #3346 is a reply to message #3343] |
Sun, 21 May 2006 09:13   |
 |
forlano
Messages: 1215 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
luzr wrote on Sun, 21 May 2006 07:53 |
Sorry, my fault....
First, .t should be in your package dir like all other source files. It gets compiled into the .exe.
Second, I forgot to mention that you have to include .t file somewhere in sources (not headers) like
#define TFILE <CtrlLib/CtrlLib.t>
#include <Core/t.h>
If you have any non-main package, place this into .icpp file so that it is forced to be linked always. Anyway, if you are doing so for the main package, it is enough to place it to the .cpp with GUI_APP_MAIN (that one gets linked always).
Mirek
|
It continues to not work . Here is the HelloWorld example modified in view of the use of the file message.t. This example, once it works, could be an example about the topic we are discussing.
#include <CtrlLib/CtrlLib.h>
#define TFILE <HelloWorld/message.t> //<mypackage directory/my_t_file_with_translation
#include <Core/t.h>
class HelloWorld : public TopWindow {
MenuBar menu;
StatusBar status;
void FileMenu(Bar& bar);
void MainMenu(Bar& bar);
void About();
void CloseCB();
public:
typedef HelloWorld CLASSNAME;
HelloWorld();
};
void HelloWorld::About()
{
PromptOK(t_("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}"));
}
void HelloWorld::CloseCB()
{
if(PromptYesNo(t_("Are you sure?"))) Close();
}
void HelloWorld::FileMenu(Bar& bar)
{
bar.Add(t_("About.."), THISBACK(About));
bar.Separator();
bar.Add(t_("Exit"), THISBACK(CloseCB));
}
void HelloWorld::MainMenu(Bar& bar)
{
menu.Add(t_("File"), THISBACK(FileMenu));
}
HelloWorld::HelloWorld()
{
AddFrame(menu);
AddFrame(status);
menu.Set(THISBACK(MainMenu));
status = t_("Welcome to the Ultimate++ !");
}
GUI_APP_MAIN
{
// SetLanguage(LNG_ENGLISH);
SetLanguage(LNG_('I','T','I','T') );
HelloWorld().Run();
}
So I've marked the string with t_(...), I've included what you signaled the last time, then I set the Italian language. Moreover I've generated the file message.t by using Sincronize... This is the file:
// hello.cpp
T_("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Hello world sample}}")
itIT("{{1@5 [@9= Questa e' l'esempio]::@2 [A5@0 di Ultimate`+`+ Hello world}}")
T_("Are you sure?")
itIT("Sei sicuro?")
T_("About..")
itIT("A proposito...")
T_("Exit")
itIT("Esci")
T_("File")
itIT("FILE")
T_("Welcome to the Ultimate++ !")
itIT("Benvenuto in Ultimate++ !")
It stays in the package directory. However no sign of Italian strings in the application. BTW, I've even tried some other combination of includes without success. What am I missing?
Luigi
edit: this file has been updated with the correction of the next reply from Mirek. Now it works
[Updated on: Sun, 21 May 2006 11:38] Report message to a moderator
|
|
|
 |
|
how to Internationalize my app?
By: forlano on Sat, 20 May 2006 17:37
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sat, 20 May 2006 20:54
|
 |
|
Re: how to Internationalize my app?
By: forlano on Sat, 20 May 2006 23:17
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sat, 20 May 2006 23:23
|
 |
|
Re: how to Internationalize my app?
By: forlano on Sun, 21 May 2006 00:19
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sun, 21 May 2006 07:53
|
 |
|
Re: how to Internationalize my app?
By: forlano on Sun, 21 May 2006 09:13
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sun, 21 May 2006 10:00
|
 |
|
Re: how to Internationalize my app?
By: forlano on Sun, 21 May 2006 11:35
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sun, 21 May 2006 12:22
|
 |
|
Re: how to Internationalize my app?
By: forlano on Sun, 21 May 2006 13:48
|
 |
|
Re: how to Internationalize my app?
By: mirek on Sun, 21 May 2006 14:17
|
 |
|
Re: how to Internationalize my app?
|
 |
|
Re: how to Internationalize my app?
By: mirek on Wed, 17 October 2007 19:27
|
 |
|
Re: how to Internationalize my app?
|
 |
|
Re: how to Internationalize my app?
By: mirek on Fri, 19 October 2007 18:09
|
Goto Forum:
Current Time: Wed Aug 27 01:02:56 CEST 2025
Total time taken to generate the page: 0.04994 seconds
|