Open slobich opened 8 years ago
Your last snippet should work
array(
'post_type_name' => 'brand',
'singular' => __('Brand', 'my-text-domain'),
'plural' => __('Brands', 'my-text-domain'),
'slug' => 'brands'
),
Are you using poedit (or similar software) to scan your source files? They should come up in the translator and then you can provide the translated terms
@slobich Sorry for the late reply
As @bynicolas said, your last example should work.
Depending on how you are translating, the set_textdomain()
method can work in some cases, however if you are using something like poedit, it reads the source files and not the result of what set_textdomain
will do.
Hope this helps,
Thanks :)
I have the same problem... My textdomain works fine everywhere but singular name
I just encountered the same issue, using CPT in a plugin. Solved it by creating the CPT's after loading the plugin's textdomain (and not before).
// this first
load_plugin_textdomain( 'my_textdomain', false, dirname( PLUGIN_BASENAME ) . '/languages/' );
// then create the CPT's
Perhaps this saves a couple of minutes here and there.
Thanks a lot. I got a solution using this.
i don't know if i'm doing something wrong but i'm not able to translate the name of the post type/taxonomy... not the 'Add New' label but the singular and plural names of the post type/taxonomy (ie: my CPT singular name is "Brands" and i want to translate "Brands").
this is the way i'm registering the post type
i also tried using WordPress translation functions in the names section like so:
and with adding a text domain name
hope you can help. thnx.