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

View Source

GenServer-based internationalization server.

Provides state management for i18n functionality without using the Process dictionary, making it more robust and testable.

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.

Starts the I18n server.

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)

Starts the I18n server.

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

Translate a key with optional bindings.