Skip to content

Optional javaabu/translatable support #12

Closed

Description

@n4ff4h

Optional support using javaabu/translatable's contract for other packages: in suggest, feature-detected, documented on its own page, and tested with and without it.

Activity

  1. added
    next-genNext-gen Javaabu packages
    featurePackage feature from the spec
    blockedWaiting on another package or a decision
    on Nov 4, 2026
  2. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Blocked until javaabu/translatable v3's contract for other packages exists (wave 2; tracked in n4ff4h/translatable#10).

    The likely shape here: role descriptions translatable through that contract, feature-detected with interface_exists(). Today role descriptions are free text, and permission descriptions and labels are translation keys, so nothing depends on it.

  3. n4ff4h commented on Nov 4, 2026

    @n4ff4h
    CollaboratorAuthor

    Done on next-gen with translatable v3's contract (n4ff4h/translatable#10); CI green, including a job with translatable removed.

    • Suggest and dev only: javaabu/translatable is in suggest and require-dev. Support\Translations wraps every check (class_exists first).
    • Translated field: the role description. Names are identifiers, and permission descriptions are already JSON translation keys.
    • Model: the package ships Models\Translatable\Role (JSON storage, keeps the base morph class). Apps opt in by setting permission.models.role to it. Decision: no automatic swap, because spatie's registrar reads the role class once, at boot.
    • Migration: add_translations_to_roles_table adds nullable translations and lang columns, and runs with or without translatable.
    • Forms and API: RoleRequest expands its rules with Translatable::rules(). The Blade form uses <x-translatable::text>; the React form renders one Text per input from the translations prop, with dir, lang and thaana. RoleResource adds translations.
    • Tests: tests/Translatable is its own PHPUnit suite. CI runs the Package suite with translatable removed.
    • Docs: docs/advanced-usage/translatable-roles.md.
  4. removed
    blockedWaiting on another package or a decision
    on Nov 4, 2026
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