Locale Support

Locale Support

Functions

gboolean go_locale_24h ()
char const * go_locale_boolean_name ()
char go_locale_get_arg_sep ()
char go_locale_get_col_sep ()
GString const * go_locale_get_currency ()
GString const * go_locale_get_date_format ()
GString const * go_locale_get_decimal ()
char go_locale_get_row_sep ()
GString const * go_locale_get_thousand ()
GString const * go_locale_get_time_format ()
int go_locale_month_before_day ()
void go_locale_untranslated_booleans ()
char const * go_setlocale ()

Description

Functions

go_locale_24h ()

gboolean
go_locale_24h (void);

Checks if the current locale uses a 24h clock.

Returns

TRUE if the locale uses a 24h clock, FALSE otherwise.


go_locale_boolean_name ()

char const *
go_locale_boolean_name (gboolean b);

Current locale's rendering of b .

Parameters

b

a boolean value

 

Returns

the rendering of b .

[transfer none]


go_locale_get_arg_sep ()

char
go_locale_get_arg_sep (void);

Returns

the argument separator for the current locale.


go_locale_get_col_sep ()

char
go_locale_get_col_sep (void);

Returns

the column separator for the current locale.


go_locale_get_currency ()

GString const *
go_locale_get_currency (gboolean *precedes,
                        gboolean *space_sep);

Current locale's currency symbol.

Parameters

precedes

(allow-none): TRUE if the currency symbol precedes the value.

[out]

space_sep

(allow-none): TRUE if the currency symbol is separated by a space.

[out]

Returns

the currency symbol.

[transfer none]


go_locale_get_date_format ()

GString const *
go_locale_get_date_format (void);

Current locale's date format as a string.

Returns

the date format.

[transfer none]


go_locale_get_decimal ()

GString const *
go_locale_get_decimal (void);

Current locale's decimal separator.

Returns

the decimal separator.

[transfer none]


go_locale_get_row_sep ()

char
go_locale_get_row_sep (void);

Returns

the row separator for the current locale.


go_locale_get_thousand ()

GString const *
go_locale_get_thousand (void);

Current locale's thousands separator. This may be an empty string.

Returns

the thousands separator.

[transfer none]


go_locale_get_time_format ()

GString const *
go_locale_get_time_format (void);

Current locale's time format as a string.

Returns

the time format.

[transfer none]


go_locale_month_before_day ()

int
go_locale_month_before_day (void);

A quick utility routine to guess whether the default date format uses day/month or month/day.

Returns

0 if locale uses day before month, 1 if locale uses month before day, or 2 if locale uses year before month.


go_locale_untranslated_booleans ()

void
go_locale_untranslated_booleans (void);

Short circuit the current locale so that we can import files and still produce error messages in the current LC_MESSAGE.


go_setlocale ()

char const *
go_setlocale (int category,
              char const *val);

This is a wrapper around setlocale that also invalidates any cached locale information.

Parameters

category

locale category (like LC_ALL)

 

val

locale name.

[nullable]

Returns

a string representation of the locale set. This may or may not be identical to val .

[transfer none][nullable]