Custom Fields
Re-Envisioned
Support General meta-box in the "themes folder" language settings Reply To: meta-box in the "themes folder" language settings

#9267

Anh Tran
Keymaster

Hi,

The problem with this method is the translation files are not loaded from translate.wordpress.org. It works only with local translation files which are included directly inside the plugin. The translation from translate.wordpress.org is preferred since it allows users to contribute easily and distribute more reliably. Besides, it has a higher priority, meaning if a language is available on both translate.wordpress.org and inside plugin, the file from translate.wordpress.org is loaded.

For example, this is the translation page for Meta Box in Vietnamese:

https://translate.wordpress.org/locale/vi/default/wp-plugins/meta-box

Translation files from translate.wordpress.org are stored in wp-content/languages/plugins/meta-box/ and are regularly updated when new translations available.

Ideally, I’d love to remove the languages file from the plugin, so only translations from translate.wordpress.org are used. At the moment, some languages are not available on translate.wordpress.org yet.

In your case, in order to make it work with your theme without modifying the plugin, you can add this line directly into your theme:

load_textdomain( 'meta-box', plugin_basename( RWMB_DIR ) . '/languages/meta-box-'.get_locale().'.mo' );

It works the same way 😉