Skip to content
Snippets Groups Projects
Commit 800067a4 authored by Raphaël Doursenaud's avatar Raphaël Doursenaud
Browse files

Added a dev script to help identify duplicate translation keys in language files

parent 09b6ccbe
Branches
Tags
No related merge requests found
#!/bin/sh
# Helps find duplicate translation keys in language files
#
# Copyright (C) 2014 Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
for file in `find . -type f`
do
dupes=$(
sed "s/^\s*//" "$file" | # Remove any leading whitespace
sed "s/\s*\=/=/" | # Remove any whitespace before =
grep -Po "(^.*?)=" | # Non greedeely match everything before =
sed "s/\=//" | # Remove trailing = so we get the key
sort | uniq -d # Find duplicates
)
if [ -n "$dupes" ]
then
echo "Duplicates found in $file"
echo "$dupes"
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment