mirror of
https://gh.wpcy.net/https://github.com/szepeviktor/wordpress-website-lifecycle.git
synced 2026-04-24 05:09:10 +08:00
23 lines
637 B
Bash
Executable file
23 lines
637 B
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Find WordPress translations not matching the core's available languages.
|
|
#
|
|
# VERSION :0.1.2
|
|
# DEPENDS :apt-get install wget jq
|
|
|
|
WP_ORG_CORE_TRANSLATIONS="https://api.wordpress.org/translations/core/1.0/"
|
|
|
|
set -e
|
|
|
|
LANGS_REGEXP="en_US|$(wget -q -O- "$WP_ORG_CORE_TRANSLATIONS" | jq -r '."translations" | map(."language") | join("|")'
|
|
|
|
while read -r MO; do
|
|
MO_LANG="$(basename "$MO")"
|
|
MO_LANG="${MO_LANG##*-}"
|
|
MO_LANG="${MO_LANG%.mo}"
|
|
if grep -q -x -E "$LANGS_REGEXP" <<<"$MO_LANG"; then
|
|
continue
|
|
fi
|
|
|
|
echo "Unknown language code: ${MO}" 1>&2
|
|
done < <(find . -type f -name "*.mo")
|