Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
800067a4
Commit
800067a4
authored
Mar 26, 2014
by
Raphaël Doursenaud
Browse files
Options
Downloads
Patches
Plain Diff
Added a dev script to help identify duplicate translation keys in language files
parent
09b6ccbe
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dev/detectduplicatelangkey.sh
+21
-0
21 additions, 0 deletions
dev/detectduplicatelangkey.sh
with
21 additions
and
0 deletions
dev/detectduplicatelangkey.sh
0 → 100755
+
21
−
0
View file @
800067a4
#!/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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment