Skip to content

Use @javaabu/i18n for every string #11

Closed

Description

@n4ff4h

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.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    a848bef
  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurePackage feature from the specnext-genNext-gen Javaabu packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions