No commit activity in last 3 years
No release in over 3 years
A collection of tools for handling locales in a rails project.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

ToolsForLocales

Description

A small collection of tools for locales wannabe project. Currently supports only sort_tokens.

Sort Tokens

When working with lot of tokens it's best practice to arrange the keys in alphabetical order. That is what this task does.

Give a yaml file like this:

  en:
    admin:
      menu:
        company: "Company"
        about_us: "About Us"
      flashes:
        success: "Success"
        failure: "Failure"

The result will be:

  en:
    admin:
      flashes:
        failure: Failure
        success: Success
      menu:
        about_us: About Us
        company: Company

This method uses the default to_yaml formatting options.

Install

  gem 'tools_for_locales'

Usage

  rake tools_for_locales:sort_tokens

WARNING:

All locale files will be overwritten

Tests

  rspec spec/

License

tools_for_locales is released under the MIT License