0.0
No commit activity in last 3 years
No release in over 3 years
Extract gettext strings from a Rails application
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

< 1, >= 0.2.1
< 6, >= 5.0
 Project Readme

Gem Version Build Status Code Climate Test Coverage

puttext-rails

Rails integrations for the puttext gem (https://github/mntnorv/puttext).

What this provides for Rails applications, compared to the plain Ruby gem:

  • Simplified usage.
  • Extracts validation error messages from Rails validator and all used gems.

Installation

Add it to your Gemfile:

group :development do
  # Other development gems
  # ...

  gem 'puttext-rails'
end

Usage

Just run the puttext:extract rake task in your Rails root directory:

$ rake puttext:extract

The translations will be saved in config/locale/template.pot. For example:

#: ./app/views/hello_world/index.slim:8
msgid "Hello world!"
msgstr ""

Contributing

Before submitting an Issue or Pull Request always check if your issue is already being discussed or if someone has already submitted a pull request with the feature you want to add. Also, before doing bigger changes, it's always good to discuss the changes you're going to make in an Issue.

Code style

PutText::Rails uses RuboCop (https://github.com/bbatsov/rubocop) to check and enforce code style. Before submitting a pull request, make sure that RuboCop does not find any offenses.

Running RuboCop

$ bundle exec rubocop

Testing

PutText::Rails uses RSpec (http://rspec.info/) for testing. Pull requests with Ruby code changes must include RSpec tests that check the new functionality or changed code. Also, make sure that your changes do not break any existing tests.

Running RSpec

$ bundle exec rspec