- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Attended a Community Meetup
- Referred between 100 and 199 users
- Contributed a Tutorial to a Tuts+ Site
ive managed to get all admin texts to translate apart from custom post type labels. Any thoughts?
Your gettext declarations are a bit wrong. The ”__” returns the text string, “_e” echoes, and the “_x” let’s you mark the context in case there are two exactly same strings used in different contexts. When using any of the above you have to specify the domain like this:
__( 'Lorm ipsum', 'domain' )
Where ‘domain’ will be ‘brandspace’ in your case. Now you use “_x” like this:
_x( 'Lorem ipsum', 'context', 'domain' )
So if you have, for example, ‘Add New’ string which appears twice in your theme, but once it’s in the context of book, and the second time in the context of car, you would do something like this:
_x( 'Add New', 'book', 'brandspace' ); _x( 'Add New', 'car', 'brandspace' );
EDIT : So, in conclusion, you can’t get your labels to translate because you haven’t specified the domain, and you misuse the “_x”. 
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Attended a Community Meetup
- Referred between 100 and 199 users
- Contributed a Tutorial to a Tuts+ Site
Turns out PoEdit is doesn’t even support x. It did what you suggested and it still didn;t work so instead I ditched _x and used _ and everything is working now. Thanks anyway!
That’s right, I don’t know how to get _x working in poedit too. Try using the CodeStyling Localization plugin, it should do the job with _x.
- Exclusive Author
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Sold between 250 000 and 1 000 000 dollars
- Author was Featured
- Item was Featured
- Attended a Community Meetup
- Referred between 100 and 199 users
- Contributed a Tutorial to a Tuts+ Site
pogoking said
That’s right, I don’t know how to get _x working in poedit too. Try using the CodeStyling Localization plugin, it should do the job with _x.
its all working now. I dont really need to use _x as the translator won’t really mind anyway.
