Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using WP 3.4.1 with German language files and started using the Event Organiser plugin. This plugins already comes with some German language files, but I'm not 100% happy with it due to following reasons:

  • Some typos
  • Mixture of informal (Du) and formal (Sie) usage
  • Some unusual sentence structure (translated one by one from English - not a real mistake, but it sounds weird)
  • The term 'Event' is not translated at all. Depending on the audience that might be okay, since 'Event' is also used in German language (the more 'modern' style), but for my designated audiance the translation of Event (Veranstaltung) would fit better.

So I created a customer version of the German .po and .mo files and uploaded it back to the wp-content/plugins/event-organiser/languages directory. Unfortunately those will be overwritten every time the plugin gets updated.

Is there a way to place the custom language files to anywhere else so they don't get overwritten by an update but pulled before the ones in the plugin's language folder? I tried to put the eventorganiser-de_DE.mo and eventorganiser-de_DE.po to the wp-content/languages and the wp-content/themes/<theme>/languages folder, but it looks like that the language files won't be pulled from there.

So any ideas how to 'resolve' this issue? I could also do the translation and provide the language files to be part of the main plugin, but I could imagine that then other people would complain that it is 'Veranstaltung' and not 'Event' anymore ;-)

Thanks a lot in advance!

P.S.: For Stephen, the author of the plugin (if you see this here ;-)), it's me, Mathias, who posted in the bugs forum of your page yesterday. But I didn't know where to ask this question on your site, so I ask it here and hope that anybody responds ;-)

share|improve this question
    
Please add links to the plugins. Also use the WYSIWG editor to format code as such. –  kaiser Aug 30 '12 at 17:29

2 Answers 2

Put your language files to a place where they are not overwritten. Then change the path to your custom language files on 'load_textdomain_mofile'.

Pseudo-code, you have to change the path and the text domain:

add_filter( 'load_textdomain_mofile', 'wpse_63643_custom_eo_lang', 10, 2 );

function wpse_63643_custom_eo_lang( $mofile, $domain )
{
    if ( 'eventorganiser' === $domain )
    {
        remove_filter( current_filter(), __FUNCTION__ );
        return '/full/path/to/your/language/files.mo';
    }

    return $mofile;
}
share|improve this answer

As with every »bug« you find (typos in language files are bugs too):

  • Contact the developer
  • Search if the plugin is on GitHub
    • If so: Fork, Clone, Pull Request

...open source means contributing too!

share|improve this answer
    
I agree with you in matters of typos that these should be addressed as bugs. However, the other things like formal/informal German, the way what you translate how, is much likely a matter of taste. The first user likes it as it is, the seconds one would change this, the 3rd that and the 4th would do it completely different. So I think that's a difficult thing to decide what translation to provide and hence it would be perfect if you would be able to use a customised language file. –  preachie Aug 30 '12 at 16:59
    
@preachie Inconsistent translations are also bugs. When you look at the offered german translations for WP core, then you'll find two versions. A lot of other languages have that too. If it's a mixed, file, than it got bugs. You simply can't say »Wenn Sie den Button klicken, dann werden Deine Optionen zurückgesetzt« (black/white example for better understanding). –  kaiser Aug 30 '12 at 17:02
    
Well, agreed :-) I didn't want to start a debate on principles, currently I would be more interested in the technical options of maybe addind a customised language file - if that's possible or not, and if yes, how ;-) –  preachie Aug 30 '12 at 17:08
    
@preachie Then you need to rework your question (or add a new one): "How to replace a language file of plugin with an extending plugin" or something like that. –  kaiser Aug 30 '12 at 17:30
    
What's wrong with the question 'Using customised language file for Event Organiser plugin'? since this is exactly what I want, use a customised (German) language file for the Event Organiser plugin... ;-) –  preachie Aug 30 '12 at 17:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.