Localization
View SourceCinder includes built-in translations for table UI elements (pagination, filtering, sorting controls).
How It Works
Cinder ships with its own Gettext backend (Cinder.Gettext). When your Phoenix app sets a locale, Cinder automatically uses it:
# In your app (e.g., in a plug or LiveView mount)
Gettext.put_locale("nl") # Dutch
# Cinder tables automatically show Dutch UI textNo additional configuration needed!
Available Translations
- English (en) - Default
- Dutch (nl)
- Swedish (sv)
Phoenix LiveView Example
defmodule MyAppWeb.UserLive.Index do
use MyAppWeb, :live_view
def mount(_params, %{"locale" => locale}, socket) do
Gettext.put_locale(locale) # Set locale from session
{:ok, socket}
end
endCustom Backend (Optional)
If needed, you can use your app's Gettext backend:
# config/config.exs
config :cinder, gettext_backend: MyAppWeb.GettextNote: Requires copying Cinder's translations to your app's priv/gettext.
Contributing Translations
- Fork Cinder
- Add
i18n/gettext/<locale>/LC_MESSAGES/cinder.po - Translate messages from
i18n/gettext/cinder.pot - Submit PR