https://github.com/chief/tools_for_locales
A collection of tools for handling locales in a rails project
https://github.com/chief/tools_for_locales
Last synced: about 1 year ago
JSON representation
A collection of tools for handling locales in a rails project
- Host: GitHub
- URL: https://github.com/chief/tools_for_locales
- Owner: chief
- Created: 2012-01-26T11:59:20.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-01-02T13:21:09.000Z (over 12 years ago)
- Last Synced: 2025-04-13T15:16:42.863Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 104 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this 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:
```ruby
en:
admin:
menu:
company: "Company"
about_us: "About Us"
flashes:
success: "Success"
failure: "Failure"
```
The result will be:
```ruby
en:
admin:
flashes:
failure: Failure
success: Success
menu:
about_us: About Us
company: Company
```
This method uses the default `to_yaml` formatting options.
## Install
```ruby
gem 'tools_for_locales'
```
## Usage
```ruby
rake tools_for_locales:sort_tokens
```
*WARNING*:
All locale files will be overwritten
## Tests
```ruby
rspec spec/
```
## License
tools_for_locales is released under the [MIT License](http://opensource.org/licenses/MIT)