29.02.2012, 12:36, "Pritam" <pritam_ghang...@infosys.com>:
> Hi
>
> I am trying to make my application localisation aware. I looked at qt 
> examples.
> They all write user visible text inline with the code.
> eg:
>
> label->setText(tr("some long text"));
>
> I dont want to embed user texts in source files because sometimes they are 
> very long.
> It will be better if I can read all user visible text from a file and store 
> them in variables. Rest of the source code uses these variables when it needs 
> text.
> eg:
>
> label->setText(tr(UserTexts::categoryLabelText));

Try

 label->setText(tr("UserTexts::categoryLabelText"));

instead. Of course, you are free in choice of string identifiers because they 
have nothing to do with C++.

-- 
Regards,
Konstantin
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to