[wp-hackers] [GSoC] Language Packs

Andrew Nacin wp at andrewnacin.com
Tue Mar 29 20:06:03 UTC 2011

2011/3/29 Marko Novaković <atisha34 at gmail.com>

> I consider to choose language packs module as GSoC project.
> This could be the plugin which download mo file for plugins or themes
> from GlotPress if exists for current language.
> I cannot understand this sentence in ideas page:
> "Work is also necessary in GlotPress for this (support for plugins and
> themes, ability to build download packages, etc.), so this task can
> probably
> serve as two separate projects."
> I cannot understand what could be done in the GlotPress side.

I wrote this idea, and if it works out I will likely mentor the project. As
explained, GlotPress does need a bit of work to ensure it can scale to
support thousands of projects. Currently, the plugins that are in GlotPress
(the importers, etc.) were imported manually. We'll need to build a bridge
to the plugins directory, and possibly make some tweaks to GP.

Some of this might fall under GSoC, some of it might fall under WP.org
infrastructure. This is a project we want to do regardless, and it's
definitely a goal of mine for 2011.

  It also could be done automatic support for plugin and theme localization
> in

plugin API,
> because it could be only localized plugins with the following segment of
> code:
> $locale_name  = get_locale();
> $mofile_name  = dirname(__FILE__) . '/languages';
> $mofile_name .= "/$domain_name-$locale_name.mo";
> load_textdomain("domain", $mofile_name);
> load_plugin_textdomain('domain', false, dirname( plugin_basename( __FILE__
> )
> ) . '/languages/');

Nope, that code really isn't necessary. Ideally, language packs in core will
prevent any plugin author from doing anything beyond internationalizing the
plugin under a unique textdomain. After that, we can simply load the
textdomain based on what's available. Simple as that, no need for the plugin
itself to do any loading.

The idea would be that language packs would automate a great majority of
what currently falls on plugin authors, blog administrators, and
translators, and make it easier to keep everything working and updated.

Replying to Stas' comments, there's no need for plugins to even deliver .pot
files. Those, again, could be generated automatically and imported into
GlotPress. Things like an approval system might be necessary, but again,
that's more on the GlotPress side, while there's quite a bit of work that
needs to be done from the plugin/core side.

Hope that helps,

More information about the wp-hackers mailing list