You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replace the package's own translation hook with @javaabu/i18n (useTranslation() from @javaabu/i18n/react). Ship en and dv lines, and document how apps override them through their Laravel lang files.
Done on next-gen (a848bef). useFormsTranslation() wraps useTranslation() from @javaabu/i18n/react, so components re-render on a locale change.
Decisions:
Keys match Blade:forms::strings.<snake_case>. The keys shared with the javaabu/forms v2 branch (clear, close, create_new, select_all, pagination_previous, pagination_next, export_options, …) are aligned, Dhivehi text included.
Lookup order: the app's line for the current locale, then the bundled line for that locale, then the app's fallback-locale line, then bundled English. This keeps an app's English override from replacing the bundled Dhivehi line.
No addLines() at import time: the package never writes into the app's translator, so load order doesn't matter.
Labels: generated labels go through __(), like Blade's trans(). FormsProvider translate still overrides this.
Docs: docs/basic-usage/translations.md covers overriding lines through lang/vendor/forms/{locale}/strings.php and the full key table.
Activity
Use @javaabu/i18n for every string
n4ff4h commentedon Nov 4, 2026
Done on
next-gen(a848bef).useFormsTranslation()wrapsuseTranslation()from@javaabu/i18n/react, so components re-render on a locale change.Decisions:
forms::strings.<snake_case>. The keys shared with the javaabu/forms v2 branch (clear,close,create_new,select_all,pagination_previous,pagination_next,export_options, …) are aligned, Dhivehi text included.addLines()at import time: the package never writes into the app's translator, so load order doesn't matter.__(), like Blade'strans().FormsProvider translatestill overrides this.Docs:
docs/basic-usage/translations.mdcovers overriding lines throughlang/vendor/forms/{locale}/strings.phpand the full key table.