• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

getlocalization/python-glcli: Get Localization Command-Line Interface

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

getlocalization/python-glcli

开源软件地址(OpenSource Url):

https://github.com/getlocalization/python-glcli

开源编程语言(OpenSource Language):

Python 100.0%

开源软件介绍(OpenSource Introduction):

Get Localization CLI

Getting started

sudo pip install gl

Prerequisite is that you have Python 2.x (and pip) installed on your computer. This is typically already available on Mac OS X and Linux machines, however for Windows you may have to install it from Python website. For Windows you should also drop the "sudo" command as it's not needed, simply install it with command 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.
 map-master    Map existing master file on server to new a location on your local repository. This also changes the filename on server-side to match your local directory structure.
 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 a remote project. This will remove the master file (and related translations). Local file is not removed.
 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.

Mapping existing master files with local files

Note: if the file does not reside in the server-side and is only on your local machine, simply use gl add instead of this.

If you have an existing master file on the server-side and you wish to map it with a local file, you can do it with map-master command. This will also rename the file on server-side according to your local file system. Typical use case for this is if you have for example changed the location of your master files on your local file system. Location in this context means relative location to the gl repository root (i.e. the directory where .gl folder resides).

Note that all the translation mappings will be lost so they need to be remapped with map-locale command.

gl map-master [master-filename-in-server] [filename-in-local-filesystem]

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

Working with git, mercurial (hg) and other version management systems

It's recommended to add gl configuration files to your version management system. You can simply add the .gl directory that is created under the directory where you executed the gl init command. Configuration files do not contain any usernames or passwords, only the information about the repository (e.g. mapped translation files and master files)




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
MiguelAlgaba/KinectSLAM6D: Simultaneous Localization and Mapping with 6DoF using ...发布时间:2022-08-16
下一篇:
ewine-project/UWB-localization发布时间:2022-08-16
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap