Skip to content

javaabu/translatable v3.0 (next-gen) - #4

Open
n4ff4h wants to merge 10 commits into
Javaabu:mainfrom
n4ff4h:next-gen
Open

n4ff4h wants to merge 10 commits into
Javaabu:mainfrom
n4ff4h:next-gen

Conversation

@n4ff4h

@n4ff4h n4ff4h commented Nov 4, 2026

Copy link
Copy Markdown

javaabu/translatable v3.0 (from v2.12), built on n4ff4h/translatable next-gen as part of the Javaabu next-gen packages effort. Tracking epic: n4ff4h#10.

What's in it

  • Foundations: PHP 8.4, Laravel 12/13, Javaabu Pint rules, CI on PHP 8.4/8.5 × Laravel 12/13 × lowest/stable plus a JS job, coverage to Codecov. Branch alias dev-next-gen → 3.x-dev.
  • Storage unchanged: JSON (translations + lang) and DB (row per locale) strategies, the languages table, contracts, traits, macros, facades, helpers and the language middleware all stay.
  • Contract for other packages: static Translatable::enabled(), supports(), locales(), inputs(), rules(), values(), status(), shared(), with Locale/LocaleInput value objects and InteractsWithLanguages for tests (docs/advanced-usage/for-package-authors.md). Stencil's ->translatable() hook: Translatable fields: ->translatable() hook for javaabu/translatable v3 stencil#15.
  • Models: protected array $translatable; per-locale inputs (title_en, title_dv) work with fill()/create()/update() on both storage types and are written on save(); rows without lang read as the default locale; languages cache fixed; Octane-safe current locale; translatable:add-languages command; languages.local_name.
  • Blade components on javaabu/forms v2 (Onu and Bootstrap 6): per-locale fields in tabs, language switcher, translation status, table titles/cells, add-translation notice.
  • Inertia React components (@javaabu/translatable through javaabu/manifest) on @javaabu/forms, with the same names, data and strings.
  • Dhivehi and RTL: every string in lang/en and lang/dv (and the React locales, kept in sync by a test), per-language dir/lang, Thaana keyboard on Dhivehi inputs, logical utilities only.
  • Docs for people and agents: docs/ (Docusaurus), llms.txt, Laravel Boost guideline and skill, AGENTS.md.

Upgrading from v2

Full guide: docs/upgrading.md. In short:

  1. Requires PHP 8.4 and Laravel 12/13.
  2. Publish the migrations and run add_local_name_to_languages_table.
  3. Remove styles from a published config/translatable.php (new keys: enabled, thaana_locales, views, inertia).
  4. $post->title_dv = … is now written on save(), not immediately. addTranslation()/addTranslations() still save immediately.
  5. titles / table-cells need javaabu/forms v2; re-publish customized views (they moved to common/).
  6. Rows without a lang read as translatable.default_locale; writing in a locale that isn't an active language writes the model's columns instead of throwing; fill() on DB models accepts suffixed names; addTranslation() takes mixed; fixed the default_redirect_route key.

Before merging / releasing (for you)

  • Point the README badges at Javaabu/translatable (they point at the fork's next-gen for now).
  • CODECOV_TOKEN must be available to this repo (org secret) for coverage uploads.
  • The javaabu/forms / javaabu/manifest dev dependencies come from VCS repositories in composer.json until they're on Packagist; drop the repositories entries then. Same for github: npm dev dependencies.
  • Have a Dhivehi speaker check the lines listed in docs/advanced-usage/translations-and-rtl.md.
  • Register the docs with docs.javaabu.com (Register with Javaabu Docs (docs.javaabu.com) n4ff4h/translatable#9).
  • Tag v3.0.0.

🤖 Generated with Claude Code

n4ff4h and others added 5 commits November 4, 2026 14:13
Closes #1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Translatable::enabled()/supports()/locales()/inputs()/rules()/values()/status()/shared(),
Locale and LocaleInput value objects, InteractsWithLanguages for tests, and the
translatable:add-languages command. Suffixed attributes are staged until save on both
storage types, models can list fields in $translatable, rows without a lang read as the
default locale, and the languages cache no longer re-queries when empty.

Refs #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per-locale fields (text, textarea, field: tabs or stacked, bound values, errors open
their tab, dir/lang and Thaana), the language switcher, translation status badges,
the add-translation notice for DB models, and the table titles/cells rebuilt for
Onu and Bootstrap 6. Tests render every component in both frameworks.

Refs #3

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TranslatableField/Text/Textarea, LanguageSwitcher, TranslationStatus, the table
headings/cells and TranslationNotice on @javaabu/forms, with en/dv strings through
@javaabu/i18n; registered as @javaabu/translatable when manifest is installed, and
Translatable::shared() as an Inertia prop with views = inertia. JS toolchain (pnpm,
Vitest, ESLint, Prettier) and a CI job with coverage.

Refs #4, #8

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docusaurus pages for every feature (Blade and React side by side), the package-author
contract, configuration, testing, API reference and the upgrade guide from v2; llms.txt
indexing every page (checked by a test, with every docs link); AGENTS.md and CLAUDE.md;
the Boost guideline and javaabu-translatable skill. Dhivehi lines listed for review,
and a test keeping lang/{en,dv} and the React locales in sync.

Refs #5, #6, #7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…settings v2

helpers requires javaabu/settings ^1.7, so requiring it kept translatable v3 off
any app or package on settings v2 (#11).

- Language no longer implements helpers' AdminModel. It keeps admin_url and
  gains admin_link_name and a search() scope; Models\AdminLanguage adds the
  AdminModel for apps that install helpers.
- Language sets its table, so subclasses use `languages`.
- TableCells builds the lang_parent query itself; the language middleware uses
  is_api_request() only when it exists, and skips requests without a session.
- helpers moves to require-dev and suggest. CI checks that neither helpers nor
  settings is in the production tree, and runs the tests without helpers.

Closes #11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
generateMigrationName() type-hinted Carbon\Carbon but was given now(), so apps
on Laravel's starter kits, which use CarbonImmutable, failed whenever
translatable booted in the console (#12). It takes a DateTimeInterface now.

The audit found one more date bug: a new DB translation row copied the parent's
created_at and updated_at with its other columns. It now gets its own.

Tests: ImmutableDatesTest covers booting, publishing the migrations, JSON and
DB translations, soft-deleting languages and the add-languages command, all
with CarbonImmutable. TRANSLATABLE_IMMUTABLE_DATES=1 runs the whole suite that
way, and a CI job does.

Closes #12

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h and others added 2 commits November 6, 2026 05:48
translatable registers no Blade assets. Its React components are only imported
through the @javaabu/translatable alias, so @javaabu/forms, @javaabu/i18n and
the React peers move to npm(..., for: 'pages') (Javaabu/manifest#17).
`manifest:check` no longer asks Blade-only apps to install them.

ManifestCheckTest runs manifest:check in a Blade app, which passes with no
React packages, and in an Inertia app, which is asked for them and passes once
they're installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/activitylog that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/auth that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/block-editor that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/bulk-actions that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/cms that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/dynamic-menubuilder that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/exports that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/filters that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/form-builder that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/forms that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/generators that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/imports that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/js-localization that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/locations that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/mediapicker that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/meta that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/mobile-verification that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/notifications that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/permissions that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/post-types that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/settings that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to n4ff4h/stats that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/stencil that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/widgets that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
n4ff4h added a commit to Javaabu/workflows that referenced this pull request Nov 10, 2026
Composer read composer.json from every branch and tag of each VCS
repository through the GitHub API: about 350 calls per CI job, around
3,800 per run. A second run within the hour exhausted the workflow
token's limit, and Composer failed with "Could not authenticate against
github.com" (Javaabu/exports#2, Javaabu/translatable#4). "no-api": true
makes Composer clone these repositories instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every job downloaded each package's zipball from api.github.com, around
140 calls a job, which counts against the workflow token's hourly limit.
Each job now restores Composer's files cache, keyed by job, matrix entry
and composer.json/composer.lock, and falls back to the job's last cache
when those change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant