Skip to content

mathiasAichinger/python-glcli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Localization CLI

Getting started

sudo pip install gl

Basics

With Get Localization CLI you can push and pull translation files.

usage: gl  [options]

commands:

 add           Add a new master file to project. It will be tracked and pushed when there are changes.
 init          Create a local repository in the working directory and link it to an existing Get Localization project.
 map-locale    Map translation of given master file to a local file. When the file is pulled from server, it's saved in the given target file.
 pull          Pull available translations from server
 push          Push changed master files to server
 push-tr       Push local mapped translations that don't exist on server
 remote        Return remote project name
 remove        Remove master file from project.
 status        Project status
 translations  List translations from current project

Init project

$ gl init [project-name]
Repository created...

project-name Project name should match with your project name on Get Localization server: https://www.getlocalization.com/[project-name]/

Creates a Get Localization repository to the current directory. Repository meta-data is saved in .gl folder. This can be added to your version control (git, hg, svn etc). If you need a different configuration for different branches, it's possible.

Adding files

$ gl add master/English.properties
File master/English.properties added successfully.

'add' command is for adding a master file to repository. I.e. a file that will translated.

Mapping locales

Instead of adding translated files, you can map a local file to the translation on the server. This is done with gl map-locale command:

gl map-locale [master-filename] [language-IANA-code] [translation-filename-in-local-filesystem]

Note that translation-filename-in-local-filesystem doesn't need to actually exist in the file system. If it does, see push-tr command as well.

Example:

$ gl map-locale master/English.properties fi locale/Finnish.properties
Mapped translation of master/English.properties for fi to be saved as locale/Finnish.properties

When you run gl pull, the file that contains Finnish translations (IANA code: fi) of master/English.properties file is saved to locale/Finnish.properties file.

Push

$ gl push

push command sends all altered master files to the Get Localization server for translation.

Pull

$ gl pull

pull command fetches all updated translation files from Get Localization server. Note that only mapped locales will be downloaded and stored. If you use --force the default location will be used.

Pushing translations (Use with caution)

gl push-tr

push-tr command is meant for pushing existing translations to the Get Localization server. Typically you only want to do this once (when you start your project and you have translations in local files that don't yet exist on server). After project start translations are managed by the Get Localization server so pushing translation from local machine is not necessary or even recommended. In order for this to work, you need to map locales (see 'Mapping Locales' and map-locale command).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%