Skip to content

Instantly share code, notes, and snippets.

find app/views/ -name '*.html.haml' | while read p; do haml-i18n-extractor $p -n -y config/locales/views/$(echo $p | sed 's/app\/views\///g' | sed 's/.html.haml/.yml/g') && echo $p; done
remember to put this to application.rb:
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]
after that might need to run
grep -Rl "'\"" config/locales/ | while read p; do sed -i "s/'\"/'/g" $p && sed -i "s/\"'/'/g" $p; done