-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a quick script to download all .mo files
- Loading branch information
Showing
2 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/bin/bash | ||
|
||
# Check if correct number of arguments are passed | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 [format] [download_directory]" | ||
exit 1 | ||
fi | ||
|
||
# Define arguments | ||
format=$1 | ||
download_directory=$2 | ||
|
||
# Check if download directory exists, if not create it | ||
if [ ! -d "$download_directory" ]; then | ||
mkdir -p "$download_directory" | ||
fi | ||
|
||
# Define language codes | ||
language_codes=( | ||
"nl" | ||
"pl" | ||
"zh-tw" | ||
"it" | ||
"sq" | ||
"es" | ||
"en-ca" | ||
"de" | ||
"en-au" | ||
"pt-br" | ||
"en-nz" | ||
"fr" | ||
"ja" | ||
"sv" | ||
"ru" | ||
"zh-cn" | ||
"ro" | ||
"es-mx" | ||
"es-ar" | ||
"uk" | ||
"pt" | ||
"es-ve" | ||
"en-gb" | ||
"fi" | ||
"bg" | ||
"eu" | ||
"hu" | ||
"da" | ||
"ca" | ||
"cy" | ||
"nb" | ||
"el" | ||
"hr" | ||
"et" | ||
"sk" | ||
"sr" | ||
"az" | ||
"tr" | ||
"he" | ||
"bn" | ||
"cs" | ||
"is" | ||
"sl" | ||
"ko" | ||
"id" | ||
"ary" | ||
"lt" | ||
"es-cl" | ||
"de-formal" | ||
"fa" | ||
"vi" | ||
"nn" | ||
"ar" | ||
"lv" | ||
"th" | ||
"ms" | ||
"nl-formal" | ||
"es-pe" | ||
"de-ch" | ||
"bs" | ||
"es-co" | ||
"hy" | ||
"mk" | ||
"ta" | ||
"tl" | ||
"gl" | ||
"kn" | ||
"af" | ||
"es-ve" | ||
) | ||
|
||
# Loop through each language code and download the corresponding translation file | ||
for code in "${language_codes[@]}"; do | ||
echo "Downloading $code..." | ||
curl -o "$download_directory/$code.$format" "https://translate.wordpress.org/projects/wp-plugins/fakerpress/stable/$code/default/export-translations/?format=$format" | ||
sleep 3 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters