Module that allows changing the language of an application dynamically during run-time.
|
#define | gt(str) gtransString(str) |
| A wrapper macro to make writing and reading translatable applications easier. More...
|
|
◆ gtransIndex()
const char* gtransIndex |
( |
unsigned |
index | ) |
|
Get the string at the specified index position of the current language.
Getting translation strings is a lot faster using the index as an accessor rather than the string in the base language.
- Parameters
-
[in] | index | The index of the string in the current language translation table. |
- Returns
- The string at the given index of the current language or 0 if it doesn't exist.
◆ gtransSetBaseLanguage()
void gtransSetBaseLanguage |
( |
const transTable *const |
translation | ) |
|
Set the base language.
A translatable application needs to have a base language. All translations will be relative to this base language.
- Parameters
-
[in] | translation | The translation table |
◆ gtransSetLanguage()
void gtransSetLanguage |
( |
const transTable *const |
translation | ) |
|
Set the current language.
All translations will refer to the current language set by calling this function.
- Parameters
-
[in] | translation | The translation table |
◆ gtransString()
const char* gtransString |
( |
const char * |
string | ) |
|
Get the string of the current language specified by the string of the base language.
This function will return the string of the current language that corresponds to the specified string in the base language.
This function uses strcmp() internally to compare strings.
- Parameters
-
[in] | string | The string to translate. |
- Returns
- The corresponding string of the current language or the string passed as a parameter if it doesn't exist.
◆ gt
A wrapper macro to make writing and reading translatable applications easier.
Definition at line 37 of file gtrans.h.