Skip to content

Instantly share code, notes, and snippets.

@rakeshpatra
Last active September 15, 2020 06:00
Show Gist options
  • Save rakeshpatra/6db8f1a8a0812347c937b728024e10fd to your computer and use it in GitHub Desktop.
Save rakeshpatra/6db8f1a8a0812347c937b728024e10fd to your computer and use it in GitHub Desktop.
i18n-tasks normalize in pre-commit
# using ruby gem "i18n-tasks"
locale_changed=$(git diff --name-only --staged | grep "locales/en.yml")
if [ -n "$locale_changed" ]; then
echo "Locale changed, running i18n-task normalize"
i18n-tasks normalize
git add config/locales/
echo "Done"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment