Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Jonas Leder
marlin-anet-a8
Commits
b44f06a2
Commit
b44f06a2
authored
Dec 3, 2016
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Extend findMissingTranslations, reformat output
parent
1dfe39f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildroot/share/scripts/findMissingTranslations.sh
+35
-7
35 additions, 7 deletions
buildroot/share/scripts/findMissingTranslations.sh
with
35 additions
and
7 deletions
buildroot/share/scripts/findMissingTranslations.sh
+
35
−
7
View file @
b44f06a2
#!/bin/bash
#!/usr/bin/env bash
#
# findMissingTranslations.sh
#
# Locate all language strings needing an update based on English
#
# Usage: findMissingTranslations.sh [language codes]
#
# If no language codes are specified then all languages will be checked
#
IGNORE_DEFINES
=
"LANGUAGE_EN_H MAPPER_NON SIMULATE_ROMFONT DISPLAY_CHARSET_ISO10646_1 MSG_X MSG_Y MSG_Z MSG_E MSG_H1 MSG_H2 MSG_H3 MSG_H4 MSG_MOVE_E1 MSG_MOVE_E2 MSG_MOVE_E3 MSG_MOVE_E4 MSG_N1 MSG_N2 MSG_N3 MSG_N4 MSG_DIAM_E1 MSG_DIAM_E2 MSG_DIAM_E3 MSG_DIAM_E4 MSG_E1 MSG_E2 MSG_E3 MSG_E4"
IGNORE_DEFINES
=
"LANGUAGE_EN_H MAPPER_NON SIMULATE_ROMFONT DISPLAY_CHARSET_ISO10646_1 MSG_X MSG_Y MSG_Z MSG_E MSG_H1 MSG_H2 MSG_H3 MSG_H4 MSG_MOVE_E1 MSG_MOVE_E2 MSG_MOVE_E3 MSG_MOVE_E4 MSG_N1 MSG_N2 MSG_N3 MSG_N4 MSG_DIAM_E1 MSG_DIAM_E2 MSG_DIAM_E3 MSG_DIAM_E4 MSG_E1 MSG_E2 MSG_E3 MSG_E4"
for
i
in
`
awk
'/#define/{print $2}'
language_en.h
`
;
do
[
-d
"Marlin"
]
&&
cd
"Marlin"
for
j
in
`
ls
language_
*
.h |
grep
-v
language_en.h
`
;
do
t
=
$(
grep
-c
"
${
i
}
"
${
j
}
)
LANG
=
"
$@
"
if
[
"
$t
"
-eq
0
]
;
then
FILES
=
$(
ls
language_
*
.h |
grep
-v
language_en.h |
sed
-E
's/language_([^\.]+)\.h/\1/'
)
declare
-A
STRING_MAP
echo
-n
"Building list of missing strings..."
for
i
in
$(
awk
'/#define/{print $2}'
language_en.h
)
;
do
LANG_LIST
=
""
for
j
in
$FILES
;
do
[[
$j
==
"test"
]]
&&
continue
[[
-n
$LANG
&&
!
"
${
j
}
"
=
~
$LANG
]]
&&
continue
t
=
$(
grep
-c
"define
${
i
}
"
language_
${
j
}
.h
)
if
[[
$t
-eq
0
]]
;
then
for
k
in
${
IGNORE_DEFINES
}
;
do
for
k
in
${
IGNORE_DEFINES
}
;
do
[
"
${
k
}
"
==
"
${
i
}
"
]
&&
continue
2
;
[
[
$k
==
$i
]
]
&&
continue
2
done
done
echo
"
${
j
}
,
${
i
}
"
LANG_LIST
=
"
$LANG_LIST
$j
"
fi
fi
done
done
[[
-z
$LANG_LIST
]]
&&
continue
STRING_MAP[
"
$i
"
]=
"
$LANG_LIST
"
done
echo
for
K
in
$(
printf
"%s
\n
"
"
${
!STRING_MAP[@]
}
"
|
sort
)
;
do
printf
"%-35s :%s
\n
"
"
$K
"
"
${
STRING_MAP
[
$K
]
}
"
done
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