Skip to content

Releases: robrechtme/loco-cli

v2.0.0-rc2

26 Jun 15:16
Compare
Choose a tag to compare
v2.0.0-rc2 Pre-release
Pre-release

2.0.0-rc2 (2022-06-26)

v2 is almost there 🎉 You can install the release candidate like this:

npm install loco-cli@next

What's new

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,
+  },

v1.5.1

15 Mar 08:03
Compare
Choose a tag to compare

1.5.1 (2022-03-15)

Bug Fixes

  • add support for node 12 and 14 (b75f3d3)

v1.5.0

28 Feb 08:53
Compare
Choose a tag to compare

1.5.0 (2022-02-28)

Features

  • Add direction flag to loco-cli status.
    The --direction [remote|local|both] flag adds granularity to the direction to diff the assets IDs to:
    • remote: Only check for local assets that are missing remotely
    • local: Only check for remote assets that are missing locally
    • both: Check both directions

v1.4.0

18 Jan 15:01
cee4740
Compare
Choose a tag to compare

1.4.0 (2022-01-18)

Features

  • status: exit with non-zero exit code when loco-cli status is not up to date (dcdde42)

v1.3.0

16 Dec 13:46
Compare
Choose a tag to compare

1.3.0 (2021-12-16)

Features

v1.2.1

15 Dec 13:18
Compare
Choose a tag to compare

1.2.1 (2021-12-15)

Bug Fixes

  • fixed a bug where default CLI options were overriding options from .locorc file (d21b2b4)

v1.2.0

06 Dec 18:15
Compare
Choose a tag to compare

1.2.0 (2021-12-06)

Features

v1.1.1

30 Nov 16:28
Compare
Choose a tag to compare
v1.1.1 Pre-release
Pre-release

1.1.1 (2021-11-30)

Bug Fixes

v1.1.0

29 Nov 18:09
Compare
Choose a tag to compare
v1.1.0 Pre-release
Pre-release

1.1.0 (2021-11-29)

Features

v1.0.2

29 Nov 16:40
Compare
Choose a tag to compare
v1.0.2 Pre-release
Pre-release

1.0.2 (2021-11-29)

Bug Fixes

  • ci: not all files included (54c3696)