Skip to content

Instantly share code, notes, and snippets.

@koseki
Last active July 6, 2023 11:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koseki/6019909 to your computer and use it in GitHub Desktop.
Save koseki/6019909 to your computer and use it in GitHub Desktop.
Download Wordpress translation files. Execute inside the wp-content/languages directory.
#! /bin/sh
#
# Download Wordpress translation files.
# Execute inside the wp-content/languages directory.
#
# http://codex.wordpress.org/Installing_WordPress_in_Your_Language
# http://ja.wordpress.org/install-ja/ (ja)
#
VERSION=3.5.x
WPLANG=ja
wget -O default-$WPLANG.mo "http://translate.wordpress.org/projects/wp/$VERSION/$WPLANG/default/export-translations?format=mo"
wget -O admin-$WPLANG.mo "http://translate.wordpress.org/projects/wp/$VERSION/admin/$WPLANG/default/export-translations?format=mo"
wget -O admin-network-$WPLANG.mo "http://translate.wordpress.org/projects/wp/$VERSION/admin/network/$WPLANG/default/export-translations?format=mo"
wget -O continents-cities-$WPLANG.mo "http://translate.wordpress.org/projects/wp/$VERSION/cc/$WPLANG/default/export-translations?format=mo"
@edwinbradford
Copy link

Thanks, this was very helpful to me to understand how to download Japanese language files for a WordPress Dockerfile. I found that if you change the name of the default .mo from default-$WPLANG.mo to $WPLANG.mo then WordPress will recognize it in the General Settings language drop down menu and display it as 日本語 instead of default-ja.mo.

Thanks for sharing this great resource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment