2578 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
ThemeProvince says

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

741 posts
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
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”. :)

2578 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 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
  • Had an item featured on Envato Market
  • Won a Most Wanted contest
  • Has been part of the Envato Community for over 5 years
  • Has sold $40,000+ on Envato Market
+4 more
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.

2578 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 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