Project

find_t

0.0
No commit activity in last 3 years
No release in over 3 years
Find locale files where translation for key is defined
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

find_t

Find locale files where translation for key is defined.

  • Lookup all defined translations through languages
  • Detect conflicts for the same translation key across files

Installation

$ gem install find_t

Or add the gem to your Gemfile.

gem 'find_t'

Synopsis

find_t [--rails] {key}
Option Description
--rails Include full locale files in Rails' load path
{key} A translation key to search for

Sample

$ find_t 'exception.projectshow'
Starting find_t at /Users/ykiwng/Develop/wantedly/wantedly
Scanning...

==> en

- config/locales/99_naka/en.yml:23
  "Sorry, you have to sign up to view this page!"

==> ja

- config/locales/01_model/ja.yml:3
  "この募集は、現在非公開です"
- config/locales/99_naka/ja.yml:23 [CONFLICTED]
  "この募集は、現在非公開です"

Using Ruby API

require 'find_t'

scanner = FindT::Scanner.new(
  root_path: '/Users/ykiwng/Develop/wantedly/wantedly',
  rails:     false,
)

scanner.scan 'exception.projectshow'
#=> [
#     {
#       locale: 'en',
#       file:   '/User/ykiwng/Develop/wantedly/wantedly/config/locales/99_naka/en.yml',
#       line:   23,
#       text:   '"Sorry, you have to sign up to view this page!"',
#     },
#     ...
#   ]

License

This project is copyright by Creasty, released under the MIT lisence.
See LICENSE file for details.