|
| I18n (const I18n &)=delete |
| delete Copy constructor
|
|
I18n & | operator= (const I18n &)=delete |
| delete Move constructor
|
|
template<typename... T_Child> |
std::enable_if< all_derived< T, T_Child... >::value, void >::type | setSupportedLocales () |
| Register a list of supported locales using template parameter pack.
|
|
template<typename T_Tuple > |
std::enable_if< is_tuple< T_Tuple >::value, void >::type | setSupportedLocales () |
| Register supported locales using a std::tuple of types. Each type must derive from T and be default-constructible. Sets the default locale if no locale was previously selected.
|
|
void | setDefault () |
| Sets the default locale to use if no other locale is selected.
|
|
bool | setLocale (const std::string &code) |
| Select a specific locale by code.
|
|
T * | getLocale () const |
| Get the currently selected locale instance.
|
|
| I18n (const I18n &)=delete |
| delete Copy constructor
|
|
I18n & | operator= (const I18n &)=delete |
| delete Move constructor
|
|
template<DerivedFrom< T >... T_Child> |
void | setSupportedLocales () |
| Register a list of supported locales using template parameter pack.
|
|
template<IsTuple T_Tuple> |
void | setSupportedLocales () |
| Register supported locales using a std::tuple of types.
|
|
void | setDefault () |
| Sets the default locale to use if no other locale is selected.
|
|
bool | setLocale (const std::string &code) |
| Select a specific locale by code.
|
|
T * | getLocale () const |
| Get the currently selected locale instance.
|
|
template<typename T, typename = typename std::enable_if<is_derived_from<T, ILocale>::value>::type>
class I18n< T, typename >
Internationalization manager for a specific locale type.
Handles the registration of supported locales, selection of the current locale, and retrieval of localized data at runtime. Implements a singleton pattern so there is only one instance per template type.
- Template Parameters
-
T | is the base locale interface derived from ILocale, all supported locales must derive from |
Handles the registration of supported locales, selection of the current locale, and retrieval of localized data at runtime. Implements a singleton pattern so there is only one instance per template type.
- Template Parameters
-
T | The base locale interface type that all supported locales must derive from. |
template<typename T , typename = typename std::enable_if<is_derived_from<T, ILocale>::value>::type>
template<typename T_Tuple >
std::enable_if< is_tuple< T_Tuple >::value, void >::type I18n< T, typename >::setSupportedLocales |
( |
| ) |
|
|
inline |
Register supported locales using a std::tuple of types. Each type must derive from T
and be default-constructible. Sets the default locale if no locale was previously selected.
- Template Parameters
-
T_Tuple | Variadic list of locale types to register. |
- See also
- setSupportedLocales(T_Tuple)
-
setSupportedLocale<T_Child>()
template<typename T , typename = typename std::enable_if<is_derived_from<T, ILocale>::value>::type>
void I18n< T, typename >::setSupportedLocales |
( |
| ) |
|
|
inline |
Register supported locales using a std::tuple of types.
Each type must derive from T
and be default-constructible. Sets the default locale if no locale was previously selected.
- Template Parameters
-
T_Child | Variadic list of locale types to register. |
- See also
- setSupportedLocales(T_Tuple)
-
setSupportedLocale<T_Child>()