Raxol.Core.I18n.I18nServer (Raxol Core v2.4.0)

Copy Markdown View Source

ETS-backed internationalization server.

Uses ETS for fast concurrent reads (translations, locale lookups) with a minimal GenServer only for initialization and table ownership.

Summary

Functions

Add translations for a locale.

Get available locales.

Returns a specification to start this module under a supervisor.

Get the current locale.

Initialize the i18n system with configuration.

Check if current locale is right-to-left.

Set the current locale.

Translate a key with optional bindings.

Functions

add_translations(server, locale, translations)

Add translations for a locale.

available_locales(server)

Get available locales.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

format_currency(server, amount, currency_code)

Format currency amount.

format_datetime(server, datetime)

Format datetime.

get_locale(server)

Get the current locale.

init_i18n(server, config)

Initialize the i18n system with configuration.

rtl?(server)

Check if current locale is right-to-left.

set_locale(server, locale)

Set the current locale.

start_link(opts)

t(server, key, bindings \\ %{})

Translate a key with optional bindings.