Skip to content

Instantly share code, notes, and snippets.

@allaire
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save allaire/9439fd2bd0919b944faa to your computer and use it in GitHub Desktop.
Save allaire/9439fd2bd0919b944faa to your computer and use it in GitHub Desktop.
# in application.rb
config.i18n.load_path += Dir["#{Rails.root.to_s}/config/locales/**/*.{rb,yml}"]
-------------------------------------------------------------------------------------
# i18n-tasks finds and manages missing and unused translations https://github.com/glebm/i18n-tasks
base_locale: fr
# locales: [en, fr ]
# Read and write locale data
data:
## by default, translation data are read from the file system, or you can provide a custom data adapter
# adapter: I18n::Tasks::Data::FileSystem
# Locale files to read from
read:
- config/locales/**/*.yml
# - config/locales/*.%{locale}.yml
# - config/locales/**/*.%{locale}.yml
# key => file routes, matched top to bottom
write:
- config/locales/**/*.yml
# `i18n-tasks normalize -p` will force move the keys according to these rules
# YAML / JSON serializer options, passed to load / dump / parse / serialize
yaml:
write:
# do not wrap lines at 80 characters
line_width: -1
json:
write:
# pretty print JSON
indent: ' '
space: ' '
object_nl: "\n"
array_nl: "\n"
# Find translate calls
search:
## Default scanner finds t() and I18n.t() calls
# scanner: I18n::Tasks::Scanners::PatternWithScopeScanner
## Paths to search in, passed to File.find
paths:
- app/
## Root for resolving relative keys (default)
# relative_roots:
# - app/views
## File.fnmatch patterns to exclude from search (default)
# exclude: ["*.jpg", "*.png", "*.gif", "*.svg", "*.ico", "*.eot", "*.ttf", "*.woff", "*.pdf"]
## Or, File.fnmatch patterns to include
# include: ["*.rb", "*.html.slim"]
## Consider these keys not missing
ignore_missing:
- 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
- '{devise,simple_form}.*'
- 'views.pagination.*'
## Consider these keys used
ignore_unused:
- 'activerecord.*'
- 'activemodel.*'
- 'errors.*'
- '{devise,kaminari,will_paginate}.*'
- 'simple_form.{yes,no}'
- 'simple_form.{placeholders,hints,labels}.*'
- 'simple_form.{error_notification,required}.:'
- 'time.*'
## Exclude these keys from `i18n-tasks eq-base' report
# ignore_eq_base:
# all:
# - common.ok
# fr,es:
# - common.brand
## Exclude these keys from all of the reports
ignore:
- kaminari.*
@glebm
Copy link

glebm commented Nov 13, 2014

Thanks, but I really don't have enough time to deal with this. If you put a demo project on Github where I can run the commands directly, I can resolve this quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment