2509 posts Put a Donk On It
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Attended a Community Meetup
  • Referred between 100 and 199 users
  • Contributed a Tutorial to a Tuts+ Site
+5 more
ThemeProvince says

ive managed to get all admin texts to translate apart from custom post type labels. Any thoughts?

741 posts
  • Has been a member for 5-6 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Poland
  • Referred between 10 and 49 users
Orbital_Themes says

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”. :)

2509 posts Put a Donk On It
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Attended a Community Meetup
  • Referred between 100 and 199 users
  • Contributed a Tutorial to a Tuts+ Site
+5 more
ThemeProvince says

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!

741 posts
  • Has been a member for 5-6 years
  • Sold between 50 000 and 100 000 dollars
  • Exclusive Author
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Poland
  • Referred between 10 and 49 users
Orbital_Themes says

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.

2509 posts Put a Donk On It
  • Exclusive Author
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Attended a Community Meetup
  • Referred between 100 and 199 users
  • Contributed a Tutorial to a Tuts+ Site
+5 more
ThemeProvince says
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.

by
by
by
by
by
by