[wp-hackers] Will automatic translation files updates overwrite user's modifications

Xavier Faraudo i Gener wordpress at web-warlocks.net
Wed Dec 4 13:49:50 UTC 2013

El 04/12/2013 14:36, Nikola Nikolov ha escrit:
> That is also an option, but when I have some free time on my hands some day
> I might look into the more complicated way.
> Simply because if you don't get any updates on your custom translation
> files, then you would have missing translations as well - and merging the
> default with your custom translations manually would eventually get time
> consuming.

Well, this only disables *automatic* translations. You can always check 
them manually from the update panel, AFAIK. (May be wrong in this). 
Meaning that you can manually update the non-custom files in the good 
ol' way of clicking a link to update.

Merging custom and official (rather than "default", which is a text 
domain) may not be that time-consuming. You can add any number of 
translation files to a domain (they're just keys of the global array 
l10n, after all). And the way that the gettext implementation merges 
entries/files/domains is basically "if it exists, do nothing" (not true 
for the loaded comments, though, but developer comments are basically 
unused, and highly useless once strings are translated). So, you'd only 
need to make sure your translation files are loaded before any other if 
you want to go this way…

I'm not sure if I follow you at all, though. I mean, you'd have missing 
translations as long as the source files are changed and you don't 
update your custom files, right? So you need to update your *custom 
translations* anyway, which is not that time-consuming (unless the 
source files are highly changed, that is).

> On Wed, Dec 4, 2013 at 1:36 PM, Xavier Faraudo i Gener <
> wordpress at web-warlocks.net> wrote:
>> El 03/12/2013 20:25, Otto ha escrit:
>>   If the files are being stored in a place that WordPress is expecting to be
>>> able to update them, then yes. It's no different than changing core code
>>> or
>>> changing code in a plugin or theme directly.
>>> If you use customized files, then you should put them in custom locations
>>> with some form of custom code to cause the system to use them. Modifying
>>> files that can be updated by an auto-update process directly means your
>>> changes are not safe.
>> Wouldn't just something like:
>> add_filter( 'auto_update_translation', '__return_false' );
>> do the trick of avoiding auto-update on translations?
>> I mean, you do normally know when you're using custom translations, and
>> adding this filter is trivial (it's custom code that looks easier than
>> using custom loading code, and user-unfriendly custom locations).
>> Maybe the only issue is *when* should it be added, but so far it worked
>> for me hooking it at init.
>> Cheers
>> Xavier
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> -----
> No se encontraron virus en este mensaje.
> Comprobado por AVG - www.avg.com
> Version: 2014.0.4259 / Base de datos de virus: 3657/6890 - Fecha de publicacion: 12/04/13

Xavier Faraudo i Gener (the WordPress Web Warlock)

More information about the wp-hackers mailing list