[wp-hackers] Re: [wp-polyglots] no-code-duplication i18n for WordPress

Jacob Santos wordpress at santosj.name
Wed Jun 4 12:19:47 GMT 2008

I was about to propose something similar. You could do checks for the 
hard coded string first and if it doesn't exist do whatever is done now. 
It would remove the need for a strings.php in the wp-includes directory. 
I do believe having a strings.php in the wp-includes directory would 
help translators with the possible strings that they can translate 
instead of having to look through the code, even if there is a Codex 
page on the topic.

DD32 wrote:
> Just a few quick thoughts:
> wp-includes/strings.php
>  * Contains any hard coded strings in english, Ie. strings for before 
> gettext is loaded.
> wp-load.php:
>  * Checks to see if wp-content/strings.php exists
>    * If so Include that file
>    * Else, include the default wp-includes/strings.php file
> wp-load/wp-settings/etc for before gettext loaded:
>  * Reference to $hardcoded['no_db'], or $hardcoded['php_too_old'] 
> rather than hard coded strings.
> Result:
>  * Core files not modified, Localised distributions have to include a 
> single extra file in the distro in the users content folder
>  * Static files would notbenefit from that, but, i would hope that 
> instead, translated versions were included, ie. readme.html = english, 
> readme-fr.html = french translation
> Once again, Thats just quick thoughts, I dont know if any would 
> actually be implementable or not..
> I guess i shouldn't comment when it comes to internationalised 
> versions given i'm not 100% sure how they work..
> On Wed, 04 Jun 2008 19:34:08 +1000, Bertilo Wennergren 
> <bertilow at gmail.com> wrote:
>> Francesc Hervada-Sala:
>>> Am Dienstag, 4. März 2008 09:04:12 schrieb Lionel Elie Mamane:
>>>> I'm Lionel Elie Mamane, I recently got involved in the Debian
>>>> packaging of WordPress, and I'd like to propose you an enhancement in
>>>> your full-i18n procedures, so that all languages are guaranteed to
>>>> use the same code, only strings differ. I come bearing "proof of
>>>> concept" patches, available from
>>>> http://people.debian.org/~lmamane/wordpress/ .
>>> when we talked about this proposal we said we wanted to follow it after
>>> releasing 2.5. Is it perhaps now a good time to put it into 
>>> practice? I think
>>> it is. This way 2.6 could have unique source files for all locales 
>>> and the
>>> translation could be completely done just translating .po files.
>> I don't understand. As of now there are loads of things that have to
>> be translated directly in the PHP-files since those parts can't be
>> handled by gettext (po). How would those parts of the translation work
>> be taken care of in the proposed plan?

More information about the wp-hackers mailing list