Pushing & pulling strings
Pushing and pulling strings from Tolgee is the most basic way to interact with strings. Similarly as with a Git project, it allows you to download strings from Tolgee to your computer (pull), or to upload them after you changed them (push).
Pulling strings
This is a useful command that exports strings from the platform, and saves them in a folder of your choice. You can use this to download strings from Tolgee before bundling your app for production.
tolgee pull [options]
Example usage:
tolgee pull --path ./i18n
Options:
--path <path>(short:-p) - Destination of a folder where translation files will be stored in--languages <languages...>(short:-l) – List of languages to pull. Leave unspecified to export all languages.--states <states...>(short:-s) – List of translation states to include. (choices: "UNTRANSLATED", "TRANSLATED", "REVIEWED"). Defaults to all except untranslated.--delimiter [delimiter](short:-d) – Structure delimiter to use. By default, Tolgee treats.as a nested structure delimiter, and formats its export accordingly. Set the option without a value to disable this behavior. Can be configured per-project.--namespaces <namespaces...>(short:-n) - List of namespaces to pull. Defaults to all namespaces.--tags <tags...>(short:-t) - List of tags which to include. Keys tagged by at least one of these tags will be included.--exclude-tags <tags...>- List of tags which to exclude. Keys tagged by at least one of these tags will be excluded.--support-arrays- Export keys with array syntax (e.g. item[0]) as arrays. (default: false)--empty-dir- Empty target directory before inserting pulled files.--file-structure-template <template>- Defines exported file structure.
Pushing strings
This command allows you to upload existing strings from your local folder to the platform.
tolgee push [options]
Example usage:
tolgee push --force-mode OVERRIDE
Options:
--files-template <templates...>(short:-ft) - A template that describes the structure of the local files and their location with file structure template format. Example:./public/{namespace}/{languageTag}.json--force-mode <mode>(short:-f) – What should we do with possible conflicts? Available modes:OVERRIDE,KEEP,NO_FORCE(abort on conflicts). Defaults to asking the user interactively (orNO_FORCEif it is not possible).--override-key-descriptions- Override existing key descriptions from local files (only relevant for some formats).--convert-placeholders-to-icu- Convert placeholders in local files to ICU format. (Default: true)--languages <languages...>(short-l) - Specifies which languages should be pushed (seepush.filesin config).--namespaces <namespaces...>(short-n) - Specifies which namespaces should be pushed (seepush.filesin config).--tag-new-keys <tags...>- Specify tags that will be added to newly created keys.--remove-other-keys- Remove keys which are not present in the import.
File structure template format
This is a template that defines the structure of static files and mapping them to languages/namespaces.
The template is a string that can contain the following placeholders: {namespace}, {languageTag}, {androidLanguageTag}, {snakeLanguageTag}, {extension}.
For example, when exporting to JSON with the template {namespace}/{languageTag}.{extension}, the English translations of the home namespace will be stored in home/en.json.
The {snakeLanguageTag} placeholder is the same as {languageTag} but in snake case. (e.g., en_US).
The Android specific {androidLanguageTag} placeholder is the same as {languageTag} but in Android format. (e.g., en-rUS)
--files-templateoption also allows usage of glob wildcards as (*,**or{json,yaml})