Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/5t111111/jp_strings_finder
https://github.com/5t111111/jp_strings_finder
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/5t111111/jp_strings_finder
- Owner: 5t111111
- License: mit
- Created: 2017-08-18T04:51:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T01:11:59.000Z (about 7 years ago)
- Last Synced: 2024-10-13T13:19:26.458Z (about 1 month ago)
- Language: Ruby
- Size: 22.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this 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:
```yaml
exclude:
- "**/*.ja.html.slim"
- "**/version.rb"
```## Installation
Add this line to your application's Gemfile:
```ruby
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](http://opensource.org/licenses/MIT).