Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/check-wininstaller-translations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ for LANGUAGE_FILE in ${LANGUAGE_FILES}; do
echo
echo "* ${LANGUAGE_FILE}"
echo -n " - Checking language file is included in ${INSTALLERLNG}... "
if grep -qF $(tr '/' '\\' <<<"${LANGUAGE_FILE}") "${BASE_DIR}/${INSTALLERLNG}"; then
if grep -q '^!include "\${ROOT_PATH}\\'$(tr '/' '\\' <<<"${LANGUAGE_FILE}" | sed -re 's|\\|\0\0|g')'"' "${BASE_DIR}/${INSTALLERLNG}"; then
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect is the same, but I would just use $(sed -e 's|/|\\\\|g' <<<"${LANGUAGE_FILE}")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm, just saw this. Why would you? Avoid using tr for some reason?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's no big deal. Only because it would achieve with one command (/ > sed > \\) what is currently done with two (/ > tr > \ > sed > \\), because tr isn't able to add or double characters.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't believe how I've missed that, even after your comment. Thanks for explaining again, you're completely right. I will update this as part of an upcoming tools PR.

echo "ok"
else
echo "ERROR"
Expand Down Expand Up @@ -53,7 +53,7 @@ for LANGUAGE_FILE in ${LANGUAGE_FILES}; do

echo -n " - Checking if LANG_ macro is in ${INSTALLERLNG}..."
LANG_NAME="$(sort -u <<<"${LANG_MACROS}" | sed -rne 's/\$\{LANG_(.*)\}/\1/p')"
if grep -qi '!insertmacro MUI_LANGUAGE "'"${LANG_NAME}"'"' "$BASE_DIR/${INSTALLERLNG}"; then
if grep -qi '^!insertmacro MUI_LANGUAGE "'"${LANG_NAME}"'"' "$BASE_DIR/${INSTALLERLNG}"; then
echo "ok"
else
echo "ERROR, not found"
Expand Down