iOS Polyglot CLI

Polyglot client for iOS development

Installation

If you use old polyglot-cli or native polyglot please uninstall them first:

sudo gem uninstall polyglot-cli
brew uninstall --force infinum/formulae/polyglot

Then to install polyglot simply run:

gem install ios_polyglot_cli

If you have any issues with above command, please consult this thread.

You can check if everything is OK running:

polyglot --help

You should see output with all commands and their description.

Usage

Login

You will have to login with your Infinum ID if you want to use polyglot:

polyglot 

If your login action is successful, polyglot will ask you to store your Polyglot token to local environment variables, so you don’t have to enter your credentials every time when you use polyglot command.

Setup

To setup polyglot in your Xcode project use:

polyglot init

It will prompt you with project list to select one you are setting up. You can provide source language (Swift/ObjC), translations path and resources path. It will create polyglot.yml file which you can edit later and add additional Polyglot projects.

Also, you can pass optional parameter --query or -q. It will prompt you with a list of all projects that match specified query.

Projects

If you want to see all polyglot projects and their IDs enter:

polyglot projects

Also, you can pass optional parameter --query or -q. It will prompt you with a list of all projects that match specified query.

Legacy projects

New style translations will create files names en_US.strings for example, and some old projects still use old naming in the style of en.strings. To get around this issue, you either need to migrate your project to use the new naming (be mindful of existing app's settings), or add this line under your path value:

useOldNaming: true

Pull

Finally, to fetch translations use:

$ polyglot pull

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

In order to release a new version to rubygems, you will need to be added as an owner of polyglot project on rubygems. Owners that can add other users are listed on project's rubygems page.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/infinum/ios_polyglot_cli.

License

The gem is available as open source under the terms of the MIT License.