|
| uiString () |
|
| uiString (const uiString &) |
| no copy, ref counted More...
|
|
| ~uiString () |
|
uiString & | set (const char *) |
|
bool | isSet () const |
|
bool | isEmpty () const |
|
void | setEmpty () |
|
uiString & | toLower (bool yn=true) |
|
bool | operator! () const |
|
uiString & | operator= (const uiString &) |
| no copy, ref counted More...
|
|
bool | operator> (const uiString &b) const |
|
bool | operator< (const uiString &b) const |
|
int | size () const |
|
template<class T > |
uiString & | arg (const T &var) |
|
uiString & | arg (const uiString &) |
|
uiString & | append (const char *, bool withnewline=false) |
|
uiString & | append (const OD::String &, bool withnewline=false) |
|
uiString & | append (const uiString &, bool withnewline=false) |
|
const OD::String & | getFullString (BufferString *=0) const |
|
wchar_t * | createWCharString () const |
|
const char * | getOriginalString () const |
|
const ::QString & | getQString () const |
|
const ::QString & | fillQString (QString &) const |
|
void | getHexEncoded (BufferString &) const |
|
bool | setFromHexEncoded (const char *) |
|
| uiString (const char *) |
|
| uiString (const OD::String &) |
|
uiString & | operator= (const char *) |
|
uiString & | operator= (const OD::String &) |
|
bool | operator== (const uiString &b) const |
| Don't use, will force crash. Only here to keep TypeSet happy. More...
|
|
bool | operator!= (const uiString &b) const |
| Don't use, will force crash. Only here to keep TypeSet happy. More...
|
|
bool | isEqualTo (const uiString &oth) const |
| Do use, but only if unavoidable. More...
|
|
void | makeIndependent () |
| If data is shared, I'll get an own copy. More...
|
|
| uiString (const char *original, const char *context, const char *application, const char *disambiguation, int pluralnr) |
|
void | setFrom (const ::QString &) |
|
void | addLegacyVersion (const uiString &) |
|
bool | translate (const ::QTranslator &,::QString &) const |
| Returns true if the translation succeeded. More...
|
|
uiString & | addSpace (int nr=1) |
|
String that is able to hold wide character strings for the user interface. These strings can be in different encodings and should only be used to pass text to the ui.
The string may have an original string encoded in ASCI characters, but that should only be used for object names and similar.
If the string holds N arguments, these can be replaced by arguments:
Will result in the string "4 plus 5 is 9"
- Note
- As multiple uiStrings may use the same underlying data (if they are constructed with the copy constructor or the equal operator, they are not suited for other types of string operations than passing messages to the user.
The translation in OpendTect is done using Qt's subsystem for localization. A class that wishes to enable localization should:
- Declare the mTextTranslationClass(classname,application) in its class definition. The application is a string that identifies your application. OpendTect's internal classes use the "od" applicaiton string, and can for short use the mODTextTranslationClass macro.
- Use the tr() function for all translatable string. The tr() function returns a uiString() that can be passed to the ui.
- For functions not belonging to a class, use the od_static_tr function. Any function matching the *_static_tr will be interpreted by lupdate.
- Use Qt's lupdate to scan your code for localization strings. This will generate a .ts file which can be editded with Qt's Linguist program to translate the strings.
- The updated .ts file should be converted to a binary .qm file using Qt's lrelease application.
- The .qm file should be placed in data/localizations/<application>_<lang>_<country>.ts in the release. For example, a localization of OpendTect to traditional Chinese/Taiwan would be saved as od_zh_TW.qm.