Skip to content

Instantly share code, notes, and snippets.

@salif
Last active January 24, 2024 20:39
Show Gist options
  • Save salif/15c7a29c01ffd3de2551bab92b5e4ccd to your computer and use it in GitHub Desktop.
Save salif/15c7a29c01ffd3de2551bab92b5e4ccd to your computer and use it in GitHub Desktop.
Linux grep locales
LANG=$(printf "$LC_MESSAGES" | cut -d '_' -f 1)
mkdir -p /tmp/${LANG}_locale
find /usr/share/locale/${LANG}/LC_MESSAGES/ -name '*.mo' | xargs -I "{}" sh -c "msgunfmt {} >> /tmp/${LANG}_locale/\$(basename {})"
grep -i -A 1 "" /tmp/${LANG}_locale/*.mo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment