[wp-hackers] Plugins using post types with localization

Diana K. Cury dianakac at gmail.com
Mon Jul 4 05:21:41 UTC 2011


Tried the priority and still no changes. Also, the metabox script never get 
translated, I think some problem there.

I tried to move the
    $PETPostType = new PETPostType();
    $LOSTPostType = new LOSTPostType();
For their "respective" file, but no luck.

Pasted in pastebin http://pastebin.com/Zwj0akPX



----- Original Message ----- 
From: "Dion Hulse (dd32)" <wordpress at dd32.id.au>
To: <wp-hackers at lists.automattic.com>
Sent: Monday, July 04, 2011 2:10 AM
Subject: Re: [wp-hackers] Plugins using post types with localization


> On 4 July 2011 14:58, Diana K. Cury <dianakac at gmail.com> wrote:
>
>> Thanks Hulse, I don't undertand too much about all this, quite adapted 
>> the
>> plugin from many sources.
>>
>> I think your note on priority can be helpful (no tested yet).
>> I don't understand how register post is being loaded before anything or 
>> the
>> post types are always handled firstly, by default !?
>>
>>
> My apologies, It looks like i've misread the code, It's hard skimming code
> where indentation isn't consistent.
> The post type isn't being registered before init, it's being registered on
> init.
>
> However, The post type structure,
> http://plugins.trac.wordpress.org/browser/ada-plugin/trunk/creation/pet_post_type.php?rev=404248#L14IS
> being run on plugin inclusion basically.. It's creating the $labels
> array
> before the language files are loaded, so __(something, 'ADA') is returning
> 'something' since at that point in time, the translations functions havn't
> been loaded..
>
> So;
> * PETPostType() is run at plugin inclusion time, this sets the labels and
> attemptt to translate them (and fails);
> * Then on init, adafunc_setup() is called loading the translations.
> * And then, on init again, PETPostType::register() is called, registering
> the post type, with the previously "untranslated" strings from step 1.
>
> That combined with the priorities, should be able to get you on the right
> line.. Make sense?
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers 



More information about the wp-hackers mailing list