No commit activity in last 3 years
No release in over 3 years
Find string literals using Japanese chanracters in them
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 5.0
>= 0
~> 10.0
>= 0

Runtime

 Project Readme

jp_strings_finder

jp_strings_finder is an i18n util for your Japanese project which expected to get translated to other languages.

It searchs for Japanese strings in a directory or a file and reports the results like:

$ jp_strings_finder app/

+--------------------------------------------+------+------------------------------------------------+
| File                                       | Type | Strings                                        |
+--------------------------------------------+------+------------------------------------------------+
| controllers/books_controller.rb            | RUBY | 本を書いました                                 |
+--------------------------------------------+------+------------------------------------------------+
| views/books/index.slim                     | SLIM | 本の一覧ですほげ                               |
|                                            |      | 次のページを見る                               |
+--------------------------------------------+------+------------------------------------------------+
There are 3 Japanese strings in 2 files

jp_strings_finder currently supports the below file types:

  • Ruby (.rb)
  • ERB (.erb)
  • Slim (.slim)

It fails with status code -1 when at least 1 Japanese string is found, so it can also be used in your test.

Usage

Specifying a single file

Specifying a single file searchs for Japanese strings in the file:

$ jp_strings_finder app/views/books/index.slim

Specifying a directory

Specifying a directory recursively searchs for Japanese strings in the directory:

$ jp_strings_finder app/views/

In both cases, files with not supported filetype are ignore with the below message:

Unsupported filetype [app/views/books/books.csv]

Configuration

You can set a few configuration options by passing YAML file with -f option (only excluding files for the moment though):

$ jp_strings_finder -f config.yml app/views/

A config file should be like the below, see config/config.yml.example for details:

exclude:
  - "**/*.ja.html.slim"
  - "**/version.rb"

Installation

Add this line to your application's Gemfile:

gem 'jp_strings_finder'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jp_strings_finder

License

The gem is available as open source under the terms of the MIT License.