Skip to content

A collection of tools for handling locales in a rails project

Notifications You must be signed in to change notification settings

chief/tools_for_locales

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A collection of tools for handling locales in a rails project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages