Skip to content

Commit

Permalink
Add a quick script to download all .mo files
Browse files Browse the repository at this point in the history
  • Loading branch information
bordoni committed Apr 21, 2024
1 parent 8d5a470 commit d040763
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 2 deletions.
96 changes: 96 additions & 0 deletions dev/download-language-files
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
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ FakerPress is a clean way to generate fake and dummy content to your WordPress,
**Contributors:** [bordoni](http://profiles.wordpress.org/bordoni)
**Tags:** [generator](http://wordpress.org/plugins/tags/generator), [dummy content](http://wordpress.org/plugins/tags/dummy+content), [dummy data](http://wordpress.org/plugins/tags/dummy+data), [lorem ipsun](http://wordpress.org/plugins/tags/lorem+ipsun), [admin](http://wordpress.org/plugins/tags/admin), [exemples](http://wordpress.org/plugins/tags/exemples), [testing](http://wordpress.org/plugins/tags/testing), [images](http://wordpress.org/plugins/tags/images), [attachments](http://wordpress.org/plugins/tags/attachments), [featured image](http://wordpress.org/plugins/tags/featured+image), [taxonomies](http://wordpress.org/plugins/tags/taxonomies), [users](http://wordpress.org/plugins/tags/users), [post type](http://wordpress.org/plugins/tags/post+type), [faker](http://wordpress.org/plugins/tags/faker), [fake data](http://wordpress.org/plugins/tags/fake+data), [random](http://wordpress.org/plugins/tags/random), [developer](http://wordpress.org/plugins/tags/developer), [dev](http://wordpress.org/plugins/tags/dev), [development](http://wordpress.org/plugins/tags/development), [test](http://wordpress.org/plugins/tags/test), [tests](http://wordpress.org/plugins/tags/tests)
**Requires at least:** 5.5
**Tested up to:** 6.5.2
**Stable tag:** 0.6.2
**Tested up to:** 6.5.2
**Stable tag:** 0.6.2
**License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
**Requires PHP:** 7.4
**Donate link:** https://fakerpress.com/r/sponsor
Expand Down

0 comments on commit d040763

Please sign in to comment.