Socket
Book a DemoInstallSign in
Socket

motion-i18n

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

motion-i18n

0.0.6
bundlerRubygems
Version published
Maintainers
1
Created
Source

MotionI18n

Rails-style translations for RubyMotion apps.

This gem allows you to specify your RubyMotion translations as .yml files. The translations are automatically converted to Cocoa's native format for translations.

Installation

gem install motion-i18n

and in your Rakefile:

require 'motion-i18n'

or using bundler:

gem "motion-i18n"

Usage

Put your translations in YAML files in config/locales/. For each locale there should be a file named as the locale with the extension .yml, e.g. en.yml, de.yml etc.

Translations

For a guide on how the translation files should look like, see http://guides.rubyonrails.org/i18n.html#adding-translations

To translate a string, use I18n.translate or the shortcut I18n.t like this:

I18n.t("main_screen.title")

To substitute variables in the string, specify the substitutions in second a hash argument

I18n.t("maps.directions", :from => origin, :to => destination)

Locale

You can get the current locale by calling

I18n.locale

Workflow

This gem works perfectly together with the i18n_tools gem:

gem install i18n_tools

or in Gemfile;

gem "i18n_tools", :require => "i18n_tools/tasks"

The gem will give you the tasks rake translations:missing which shows untranslated strings as well as rake translations:unused which shows strings which are translated but not used in the code. For more information, see i18n_tools.

Warning

For each locale loc, this gem overwrites the file resources/loc.lproj/Localizable.strings before building. Make sure you don't edit this file. Also, you should add these files to .gitignore:

Localizable.strings

Forking

Feel free to fork and submit pull requests!

FAQs

Package last updated on 23 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.