Tizen Native API  6.0
Locale display names

The locale display names module returns display names of Locales and components of Locales.

Required Header

#include <utils_i18n.h>

Overview

The locale display names module returns display names of Locales and components of Locales.

Functions

int i18n_loc_disp_names_create (const char *locale, i18n_loc_disp_names_h *loc_disp_names)
 Creates a default locale display names object.
int i18n_loc_disp_names_create_from_dialect (const char *locale, i18n_udialect_handling_e dialect, i18n_loc_disp_names_h *loc_disp_names)
 Creates a locale display names object for the given dialect handling.
int i18n_loc_disp_names_create_from_context (const char *locale, i18n_udisplay_context_e *contexts, int32_t length, i18n_loc_disp_names_h *loc_disp_names)
 Creates a locale display names object for given display contexts.
int i18n_loc_disp_names_destroy (i18n_loc_disp_names_h loc_disp_names)
 Destroys the locale display names object.
int i18n_loc_disp_names_get_locale (i18n_loc_disp_names_h loc_disp_names, char **locale)
 Gets the locale used by the given locale display names object to determinate the display names.
int i18n_loc_disp_names_get_dialect_handling (i18n_loc_disp_names_h loc_disp_names, i18n_udialect_handling_e *handling)
 Gets the dialect handling used by the given locale display names object.
int i18n_loc_disp_names_get_context (i18n_loc_disp_names_h loc_disp_names, i18n_udisplay_context_type_e type, i18n_udisplay_context_e *context)
 Gets the context from the given locale display names object.
int i18n_loc_disp_names_get_loc_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *locale, char **name)
 Gets the display name of the provided locale.
int i18n_loc_disp_names_get_language_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *language, char **name)
 Gets the display name of the provided language code.
int i18n_loc_disp_names_get_script_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *script, char **name)
 Gets the display name of the script code provided as string.
int i18n_loc_disp_names_get_script_disp_name_with_script_code (i18n_loc_disp_names_h loc_disp_names, i18n_uscript_code_e code, char **name)
 Gets the display name of the script code provided as enumeration.
int i18n_loc_disp_names_get_region_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *region, char **name)
 Gets the display name of the provided region code.
int i18n_loc_disp_names_get_variant_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *variant, char **name)
 Gets the display name of the provided variant.
int i18n_loc_disp_names_get_key_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *key, char **name)
 Gets the display name of the provided locale key.
int i18n_loc_disp_names_get_key_value_disp_name (i18n_loc_disp_names_h loc_disp_names, const char *key, const char *value, char **name)
 Gets the display name of the provided locale key-value.

Typedefs

typedef void * i18n_loc_disp_names_h
 An i18n_loc_disp_names_h handle.

Typedef Documentation

typedef void* i18n_loc_disp_names_h

An i18n_loc_disp_names_h handle.

Use i18n_loc_disp_names_* functions to operate on i18n_loc_disp_names_h objects.

Since :
5.0

Enumeration Type Documentation

Types of dialect handling.

Since :
5.0
Enumerator:
I18N_ULDN_STANDARD_NAMES 

Use standard names when generating a locale name, e.g. en_GB displays as 'English (United Kingdom)'

I18N_ULDN_DIALECT_NAMES 

Use dialect names, when generating a locale name, e.g. en_GB displays as 'British English'


Function Documentation

int i18n_loc_disp_names_create ( const char *  locale,
i18n_loc_disp_names_h loc_disp_names 
)

Creates a default locale display names object.

Since :
5.0
Remarks:
The created object should be released by the caller with the i18n_loc_disp_name_destroy() function.
Parameters:
[in]localeThe display locale
[out]loc_disp_namesThe created locale display names object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_create_from_context ( const char *  locale,
i18n_udisplay_context_e contexts,
int32_t  length,
i18n_loc_disp_names_h loc_disp_names 
)

Creates a locale display names object for given display contexts.

Since :
5.0
Remarks:
The created object should be released by the caller with the i18n_loc_disp_name_destroy() function.
Parameters:
[in]localeThe display locale
[in]contextsDisplay contexts
[in]lengthNumber of items in the context list
[out]loc_disp_namesThe created locale display names object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_create_from_dialect ( const char *  locale,
i18n_udialect_handling_e  dialect,
i18n_loc_disp_names_h loc_disp_names 
)

Creates a locale display names object for the given dialect handling.

Since :
5.0
Remarks:
The created object should be released by the caller with the i18n_loc_disp_name_destroy() function.
Parameters:
[in]localeThe display locale
[in]dialectThe dialect handling
[out]loc_disp_namesThe created locale display names object
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory

Destroys the locale display names object.

Since :
5.0
Parameters:
[in]loc_disp_namesThe locale display names object to be destroyed
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter

Gets the context from the given locale display names object.

Since :
5.0
Parameters:
[in]loc_disp_namesThe locale display names object
[in]typeThe display context type
[out]contextThe display context for the specific type
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter

Gets the dialect handling used by the given locale display names object.

Since :
5.0
Parameters:
[in]loc_disp_namesThe locale display names object
[out]handlingThe dialect handling
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_loc_disp_names_get_key_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  key,
char **  name 
)

Gets the display name of the provided locale key.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]keyThe locale key name
[out]nameThe display name of the provided locale key
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_key_value_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  key,
const char *  value,
char **  name 
)

Gets the display name of the provided locale key-value.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]keyThe locale key name
[in]valueThe locale key value
[out]nameThe display name of the provided locale key
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_language_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  language,
char **  name 
)

Gets the display name of the provided language code.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]languageThe language code
[out]nameThe display name of the provided language code
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_loc_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  locale,
char **  name 
)

Gets the display name of the provided locale.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]localeThe locale whose display name is to be returned
[out]nameThe display name of the provided locale
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_locale ( i18n_loc_disp_names_h  loc_disp_names,
char **  locale 
)

Gets the locale used by the given locale display names object to determinate the display names.

Since :
5.0
Remarks:
The returned locale should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[out]localeThe display locale
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_loc_disp_names_get_region_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  region,
char **  name 
)

Gets the display name of the provided region code.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]regionThe region code
[out]nameThe display name of the provided region code
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_script_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  script,
char **  name 
)

Gets the display name of the script code provided as string.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]scriptThe script code string
[out]nameThe display name of the provided script code
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory

Gets the display name of the script code provided as enumeration.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]codeThe script code number
[out]nameThe display name of the provided region code
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory
int i18n_loc_disp_names_get_variant_disp_name ( i18n_loc_disp_names_h  loc_disp_names,
const char *  variant,
char **  name 
)

Gets the display name of the provided variant.

Since :
5.0
Remarks:
The returned name should be freed by the caller with free() function.
Parameters:
[in]loc_disp_namesThe locale display names object
[in]variantThe variant
[out]nameThe display name of the provided variant
Returns:
0 on success, otherwise a negative error value
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
I18N_ERROR_OUT_OF_MEMORYOut of memory