Tomasz
El Presidente
Just Getting Started
Member Likes (0)
Hi,
At the moment, plugins language files are kept in the plugins folder.
This is a very bad solution, because language files are delete when I automatically updating plugins.
Is there a way to keep all plugins language files in the folder "/ wp-content/languages/"?
Thanks,
Tom

Responses (8)
WPMU DEV Fanatic (joined October 2009) Likes (0)
Hi Tom,
Good idea! I wonder if it'd be best to have the plugins check for the existing of the language file in /wp-content/languages/ and if it exists, it'll use that file. If not, then it'll check the plugin folder. Just another though.
I'll run this by the developer. Anyone else have other thoughts on this? +1s?
Cheers,
David
Lead Developer (joined May 2009) Likes (0)
This happens when you autoupdate from wp.org too unfortunately. You could filter every plugin to load from the languages folder:
This is the filter to tie into:
$mofile = apply_filters( 'load_textdomain_mofile', $mofile, $domain );http://core.trac.wordpress.org/browser/tags/3.2.1/wp-includes/l10n.php
SOmething like:
That would tell wp to look in the language folder if it doesn't exist where the plugin said to look. Untested, but that should be a working plugin I think.
Member (joined October 2011) Likes (0)
@DavidM
Exactly, is the best solution!
@Aaron
It works.
Thank you Aaron, you are as always reliable!
I don't understand why it hasn't yet been added by the developers of WordPress.
Thanks,
Tom
Lead Developer (joined May 2009) Likes (0)
Cool, I made a quick plugin of it and submitted to the repo if you want to watch for it there to be approved:
http://wordpress.org/extend/plugins/translation-preserver/
Lifetime member! (joined May 2010) Likes (0)
ho !
this is good !
but the fact is also that major plugins come directly with many translations files directly. For those one that mean change manually the translation file, this is not really a "plus", since translation files are generally modified.
personnally i keep them on my pc, update theme to update changes and upload them.
We have discussed here about a translation section several times.
would be also good to set it up so that every one here could participate and translations could directly be inserted in updates...
Lifetime Member (joined March 2011) Likes (0)
@Aaron To add my thoughts on what Aphrodite mentioned.
On the installation page you write:
All of the themes have their language files in: sometheme/lang/fr_FR.mo
This is the exact same naming structure of the files we find in many plugins as well. What happens and how do we store those files in one single folder? I don't understand it.
Furthermore. Should the plugin be network activated or just for the main site?
Thanks
Lead Developer (joined May 2009) Likes (0)
Good point, wasnt aware of the theme files name. Plugins if they use the proper wp functions will always be textdomain-fr_FR.mo so have no issues in the languages folder.
For themes can you just put the language file in the child theme?
Yes network activate.
Lifetime Member (joined March 2011) Likes (0)
Not really. It depends on how the parent theme was built.
Here is some "homework" that may help you.
http://wordpress.stackexchange.com/questions/30016/localization-textdomain-of-child-teme
http://wordpress.org/support/topic/plugin-codestyling-localization-theme-is-not-recognized
http://snipt.net/c10b10/internationalize-localize-wordpress-themes
But I am sure the WPMUDEV designers like Tammie or Richie would be the right people to ask.
Become a member