0.0
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Verification of translation of Ruby source and Haml template
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 1.1.0
>= 0
 Project Readme

i18n-checker

Build Status Coverage Status

Screen shot

This gem provides a Rake task to check translation file mistakes and translated text references from template files etc.

Current version supports Ruby source code, Haml template file.

  • Ruby source
  • Haml template

Basic usage

Detected out of reference text, Delete unused translation text at once.
Add the following tasks to your Rakefile.

require 'i18n_checker/rake_task'

I18nChecker::RakeTask::ReferenceCheck.new do |task|
  task.source_paths = FileList['app/models/*', 'app/views/*'] # haml templates, ruby sources
  task.locale_file_paths = FileList['config/locales/*'] # locale file paths
end

I18nChecker::RakeTask::UnusedCheck do |task|
  task.source_paths = FileList['app/models/*', 'app/views/*'] # haml templates, ruby sources
  task.locale_file_paths = FileList['config/locales/*'] # locale file paths
end

After that we just execute the task.

bundle exec rake locale_reference_check
bundle exec rake locale_unused_check

Check translation of translated text

Detect translated text references that are broken.
It is useful for detecting text that is not in the translation file of a particular language.

require 'i18n_checker/rake_task'

I18nChecker::RakeTask::ReferenceCheck.new do |task|
  task.source_paths = FileList['app/models/*', 'app/views/*'] # haml templates, ruby sources
  task.locale_file_paths = FileList['config/locales/*'] # locale file paths
end

After that we just execute the task.

bundle exec rake locale_reference_check

Delete unused translated text

Using the locale_clean task you can delete unused translated text from the file.
Since you can delete translated text that you do not use safely, you can reduce the maintenance cost by running it periodically.

require 'i18n_checker/rake_task'

I18nChecker::RakeTask::UnusedClean do |task|
  task.source_paths = FileList['app/models/*', 'app/views/*'] # haml templates, ruby sources
  task.locale_file_paths = FileList['config/locales/*'] # locale file paths
end

After that we just execute the task.

bundle exec rake locale_unused_clean

Run the test

bundle install
bundle exec rake spec