2588 posts Put a Donk On It
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $250,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”. :)

2588 posts Put a Donk On It
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $250,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.

2588 posts Put a Donk On It
  • Elite Author: Sold more than $75,000 on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
  • Has sold $250,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.

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by