Skip to content

Instantly share code, notes, and snippets.

@mike-bourgeous
Created August 24, 2015 18:33
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 mike-bourgeous/1049a76806aba4fef5f8 to your computer and use it in GitHub Desktop.
Save mike-bourgeous/1049a76806aba4fef5f8 to your computer and use it in GitHub Desktop.
Shell command to help find possibly unused translations in a Rails app
#!/bin/sh
for f in `grep -o '[^ ]\+:' config/locales/en.yml | sed -e 's/:$//' | sed -e 's/^/:/'`; do
printf "\033[1m$f\033[0m\n"
grep -R "\.t(.*$f" || printf "\033[1;33mNONE FOR $f\033[0m\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment