localer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -9
- data/lib/localer/rake_task.rb +24 -0
- data/lib/localer/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a5f69f56228031b0f043199f8dfc2d87a4068fb07b99d1be4e3b541172fa944
|
4
|
+
data.tar.gz: 0aa61fd219e832a2b594b7c2b05ac4e9694970b7a3ea521fd4376157c1e7e061
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b9a7c4247292d4bc6e8ffed6071a7121d01a390f7fe054e0ade1837220a9f25e5ff7f2669849364da9ec09d570d1eb9ba881d84471d66a720ad4fd7c5c1cc5
|
7
|
+
data.tar.gz: 5768221a0dd1a4c49df22e2af9ea4fb9acca47f23eefc19d117f679fb4dafef5202d952003a6a050c72acd5c2da83d4e1d0b4b95d8e388bc513ebebb4b93a3e2
|
data/README.md
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/aderyabin/localer.svg?branch=master)](https://travis-ci.org/aderyabin/localer) [![Gem Version](https://badge.fury.io/rb/localer.svg)](https://rubygems.org/gems/localer)
|
2
2
|
|
3
3
|
# Localer
|
4
|
-
Localer is
|
4
|
+
Localer is a tool that automatically detects missing I18n translations.
|
5
5
|
|
6
|
-
The
|
7
|
-
Localer parses and merges keys for all locales in an application. At the next step, it searches missed translations for calculated keys.
|
6
|
+
The goal is to preserve the integrity of translations. Localer parses and merges all application locales’ keys. At the next step, it searches for missing translations among the calculated keys.
|
8
7
|
|
9
8
|
<p align="center">
|
10
9
|
<img align="center" height="500" src="https://gist.githubusercontent.com/aderyabin/cb0512cbcd6cb4c79a4d84a4831109a5/raw/localer2.png">
|
@@ -36,13 +35,13 @@ Or install it yourself as:
|
|
36
35
|
## Usage
|
37
36
|
|
38
37
|
At the root directory of a Rails app, run:
|
39
|
-
|
40
|
-
localer check .
|
41
|
-
|
38
|
+
|
39
|
+
$ localer check .
|
40
|
+
|
42
41
|
or for specific Rails path:
|
43
|
-
|
44
|
-
localer check /path/to/rails/application
|
45
|
-
|
42
|
+
|
43
|
+
$ localer check /path/to/rails/application
|
44
|
+
|
46
45
|
## Support
|
47
46
|
|
48
47
|
Localer supports Ruby 2.3+, Rails. 4.1+
|
@@ -79,6 +78,30 @@ Locale:
|
|
79
78
|
- .countries.france
|
80
79
|
```
|
81
80
|
|
81
|
+
## Using Rake
|
82
|
+
|
83
|
+
Localer ships with a rake task. To use Localers's rake task you simply need to require the task file and define a task with it. Below is a rake task that will run `localer`:
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
require 'rubygems'
|
87
|
+
require 'localer'
|
88
|
+
require 'localer/rake_task'
|
89
|
+
|
90
|
+
Localer::RakeTask.new(:localer)
|
91
|
+
```
|
92
|
+
|
93
|
+
When you now run:
|
94
|
+
|
95
|
+
$ rake -T
|
96
|
+
|
97
|
+
you should see
|
98
|
+
|
99
|
+
```
|
100
|
+
rake localer # Run Localer
|
101
|
+
```
|
102
|
+
|
103
|
+
####
|
104
|
+
|
82
105
|
## Development
|
83
106
|
|
84
107
|
After checking out the repo, run `bundle exec appraisal install` to install dependencies for each appraisal. Then, run `bundle exec appraisal rake` to run the tests.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rake'
|
4
|
+
require 'rake/tasklib'
|
5
|
+
require 'localer'
|
6
|
+
|
7
|
+
module Localer
|
8
|
+
# Defines a Rake task for running Localer.
|
9
|
+
# The simplest use of it goes something like:
|
10
|
+
#
|
11
|
+
# Localer::Rakeask.new
|
12
|
+
# This will define a task named <tt>localer</tt> described as 'Run Localer'.
|
13
|
+
class RakeTask < Rake::TaskLib
|
14
|
+
def initialize(name = :localer, *args)
|
15
|
+
@name = name
|
16
|
+
desc 'Run Localer'
|
17
|
+
task(name, *args) do |_, _task_args|
|
18
|
+
sh('localer check') do |ok, res|
|
19
|
+
exit res.exitstatus unless ok
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/localer/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Deryabin
|
@@ -167,6 +167,7 @@ files:
|
|
167
167
|
- lib/localer/ext/hash.rb
|
168
168
|
- lib/localer/ext/string.rb
|
169
169
|
- lib/localer/rails.rb
|
170
|
+
- lib/localer/rake_task.rb
|
170
171
|
- lib/localer/version.rb
|
171
172
|
- localer.gemspec
|
172
173
|
homepage: https://github.com/aderyabin/localer
|