v2.0.0 #16
robrechtme
announced in
Announcements
v2.0.0
#16
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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
(andstatus
) will look at all locales and all differences between the local files and the remote version. Depending on the newpush
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
underpush
andpull
. The possible options forpull
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, sinceloco-cli push
andloco-cli status
will look at all locales now. Forloco-cli pull
there used to be a fallback to the default language for untranslated assets. This is also removed in favor of the newpull
options. It can be added back though:status and tag
The
--status [status]
and--tag [tag]
options fromloco-cli push
are removed in favor of push options. An example migration:New Contributors
Full Changelog: v1.5.1...v2.0.0
This discussion was created from the release v2.0.0.
Beta Was this translation helpful? Give feedback.
All reactions