Skip to content
Snippets Groups Projects
Commit f526ab5c authored by Bob Mottram's avatar Bob Mottram
Browse files

Translate alt text and title

parent b18da429
No related branches found
No related tags found
No related merge requests found
......@@ -304,6 +304,28 @@ function web_admin_translate {
sed -i "/translate=\"yes\"/s|value=\"$english_text\"|value=\"$translated_text\"|g" "${webfiles[j]}"
j=$((j+1))
done
# get the alt text
# shellcheck disable=SC2207
webfiles=($(grep -l " alt=\"$english_text\"" "$webadmin_install_dir"/*.html))
# translate each file
j=0
while (( ${#webfiles[@]} > j )); do
sed -i "s| alt=\"$english_text\"| alt=\"$translated_text\"|g" "${webfiles[j]}"
j=$((j+1))
done
# get titles
# shellcheck disable=SC2207
webfiles=($(grep -l " title=\"$english_text\">" "$webadmin_install_dir"/*.html))
# translate each file
j=0
while (( ${#webfiles[@]} > j )); do
sed -i "s| title=\"$english_text\">| title=\"$translated_text\">|g" "${webfiles[j]}"
j=$((j+1))
done
fi
i=$((i+1))
echo -n '.'
......
......@@ -156,6 +156,28 @@ function web_admin_translate {
sed -i "/translate=\"yes\"/s|value=\"$english_text\"|value=\"$translated_text\"|g" "${webfiles[j]}"
j=$((j+1))
done
# get the alt text
# shellcheck disable=SC2207
webfiles=($(grep -l " alt=\"$english_text\"" "$webadmin_install_dir"/*.html))
# translate each file
j=0
while (( ${#webfiles[@]} > j )); do
sed -i "s| alt=\"$english_text\"| alt=\"$translated_text\"|g" "${webfiles[j]}"
j=$((j+1))
done
# get titles
# shellcheck disable=SC2207
webfiles=($(grep -l " title=\"$english_text\">" "$webadmin_install_dir"/*.html))
# translate each file
j=0
while (( ${#webfiles[@]} > j )); do
sed -i "s| title=\"$english_text\">| title=\"$translated_text\">|g" "${webfiles[j]}"
j=$((j+1))
done
fi
i=$((i+1))
echo -n '.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment