GithubHelp home page GithubHelp logo

python-glcli's Introduction

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).

python-glcli's People

Contributors

getlocalization avatar jarijohan avatar pmuilu avatar sullman avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.