Fix whitespace alignment in CLI command summary, improve export command
description to clarify it operates from an app context, and update the
corresponding docs section.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix Windows path separators in import by splitting on path.sep
- Make extractTranslations test less brittle by not pinning exact
message strings or total count
- Remove unnecessary `as any` cast for devDependencies
- Validate pattern in export command to fail fast on invalid patterns
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Moves the messages/ path segment from being hardcoded into the export
and import commands to being part of the pattern itself. The default
pattern is now messages/{id}.{lang}.json, giving full control over the
directory structure under the translations output directory.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Uses PackageRoles.getRoleInfo from cli-node to determine frontend packages
by platform instead of a hardcoded role list. Removes the --pattern option
from the import command since the pattern is always read from the manifest.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a changeset for the new translations export/import CLI commands.
Updates the internationalization docs with the CLI-based workflow as
the recommended approach for managing translations, and adds the
commands to the CLI reference. Also adds the internationalization
page to the mkdocs navigation.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds a --pattern option to both translations export and import commands
that controls the file path layout of message files within the messages/
directory. The default pattern is {id}.{lang}.json (unchanged behavior),
but users can pass e.g. --pattern '{lang}/{id}.json' for language-based
directory grouping. The pattern is stored in the manifest so that import
picks it up automatically.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The package discovery for the translations export command previously only
looked at direct dependencies and only workspace packages. This changes
it to recursively walk the full transitive dependency tree and resolve
packages from node_modules when they aren't found in the workspace.
Entry point resolution now also prefers .d.ts type declarations for
npm-installed packages.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds tooling for exporting and importing translation strings to enable
integration with external TMS tools like Smartling. The export command
uses the TypeScript compiler API (ts-morph) to discover TranslationRef
exports from all frontend plugin dependencies of the current package,
extracting message keys and default values from the type system. The
import command generates TranslationResource wiring from translated
JSON files downloaded from a TMS.
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>