Releases: robrechtme/loco-cli
v3.2.0
What's Changed
- 🔊 print changes when yes flag is present by @VNDRN in #33
- Feature/eslint and prettier by @VNDRN in #35
- chore: remove Node.js version range by @gynekolog in #37
- Improve types by @giammyisjammy in #36
New Contributors
- @giammyisjammy made their first contribution in #36
Full Changelog: v3.1.1...v3.2.0
v3.1.1
What's Changed
- feat: split key into namespaces just by first separator by @gynekolog in #32
New Contributors
- @gynekolog made their first contribution in #32
Full Changelog: v3.1.0...v3.1.1
v3.1.0
v3.0.0
What's Changed
- chore: drop support for Node 12
- chore: upgrade dependencies
Full Changelog: v2.1.3...v3.0.0
v2.1.3
Full Changelog: v2.1.2...v2.1.3
v2.1.2
What's Changed
- fix: add language tag to translations if only one language is present at loco by @haveneersrobin in #25
New Contributors
- @haveneersrobin made their first contribution in #25
Full Changelog: v2.1.1...v2.1.2
v2.1.1
This release introduces a lot of new possibilities to configure loco:
- a
loco
property in package.json - a
.locorc
file in JSON or YAML format - a
.locorc.json
,.locorc.yaml
,.locorc.yml
,.locorc.js
, or.locorc.cjs
file - a
loco.config.js
orloco.config.cjs
CommonJS module exporting an object
What's Changed
- feat: migrate to cosmiconfig by @robrechtme in #21
Full Changelog: v2.0.2...v2.1.1
v2.0.2
What's Changed
- chore(deps): bump vite from 2.9.12 to 2.9.15 by @dependabot in #18
- fix: take into account ignore-new and ignore-existing options in diff by @VNDRN in #19
New Contributors
- @dependabot made their first contribution in #18
- @VNDRN made their first contribution in #19
Full Changelog: v2.0.1...v2.0.2
v2.0.1
What's Changed
- fix errors when pulling for the first time
- do not error when
push
options are not present (Closes #17)
Full Changelog: v2.0.0...v2.0.1
v2.0.0
What's Changed
BREAKING: Full diff
In v1.5.1, loco-cli push
would only add translations where the asset ID in the default language was not present remote. This is completely reworked. In v2, loco-cli push
(and status
) will look at all locales and all differences between the local files and the remote version. Depending on the new push
options, this will only add new translations, also modify existing translations or even delete translations from Loco that are not present in the local file.
Pull and push options
Get access to (almost) all Loco API options for pulling translations! Options are defined as an object in .locorc
under push
and pull
. The possible options for pull
are:
filter
: Filter assets by comma-separated tag names. Match any tag with*
and negate tags by prefixing with!
.fallback
: Fallback locale for untranslated assets, specified as short code. e.g. en or en_GB.order
: Export translations according to asset order.status
: Export translations with a specific status or flag. Negate values by prefixing with !. e.g. "translated", or "!fuzzy".charset
: Specify preferred character encoding. Alternative to Accept-Charset header but accepts a single value which must be valid.breaks
: Force platform-specific line-endings. Default is Unix (LF) breaks.
The possible options for push
are:
ignore-new
: Specify that new assets will NOT be added to the project.ignore-existing
: Specify that existing assets encountered in the file will NOT be updated.tag-new
: Tag any NEW assets added during the import with the given tags (comma separated).tag-all
: Tag ALL assets in the file with the given tags (comma separated).untag-all
: Remove existing tags from any assets matched in the imported file (comma separated).tag-updated
: Tag existing assets that are MODIFIED by this import.untag-updated
: Remove existing tags from assets that are MODIFIED during import.tag-absent
: Tag existing assets in the project that are NOT found in the imported file.untag-absent
: Remove existing tags from assets NOT found in the imported file.delete-absent
: Permanently DELETES project assets NOT found in the file (use with extreme caution).flag-new
: Set this flag on any NEW (non-empty) translations imported into the current locale.
Config types
Get enhanced IDE support by adding the type annotation above your config definition:
+ /** @type {import('loco-cli/types').Config} */
module.exports = {
accessKey: "<loco-full-access-key>",
localesDir: "src/app/i18n/locales",
Migration guide
defaultLanguage
The defaultLanguage
option is deprecated, since loco-cli push
and loco-cli status
will look at all locales now. For loco-cli pull
there used to be a fallback to the default language for untranslated assets. This is also removed in favor of the new pull
options. It can be added back though:
- defaultLanguage: 'en',
+ pull: {
+ fallback: 'en',
+ },
status and tag
The --status [status]
and --tag [tag]
options from loco-cli push
are removed in favor of push options. An example migration:
// package-json
- "translations:push": "loco-cli push --status provisional --tag $npm_package_version",
+ "translations:push": "loco-cli push",
// .locorc.js
+ push: {
+ "flag-new": "provisional",
+ "tag-new": process.env.npm_package_version,
+ },
New Contributors
Full Changelog: v1.5.1...v2.0.0