What does "In this text domain" mean? How does it work?
How would I apply a text change rule only to a specific area of the admin?
Like only on the admin menu for example?
What does "In this text domain" mean? How does it work?
How would I apply a text change rule only to a specific area of the admin?
Like only on the admin menu for example?
Ok, that thread told me nothing as it is confusing to simply say that if you specify a text domain for a plugin that it will only affect text in that plugin. What does that mean? And again I ask, how could I set where I want it to change the text vs. a global change?
That has no domain, so any changes could not be specifically targeted.
So lets say that we have two plugins using the same text, this can be a horse racing site. In one plugin it deals with names for a Pony and have "Pony" in the gambling section (a different plugin) it uses the term "Pony" to represent a monetary value (I occasionally like to gamble in casinos but not horses)
Perhaps we want to change Pony to Horses (where it actually means horses and because its not a horse of a small breed), but hold on making a change could affect that right across the board because the admin text change doesn't know how to differentiate........... Unless there is a text domain specified and the text in question has a text domain.
So What Do We Do?
Give it a text domain, and how do we do that????
__('Pony','horse_stats')
__('Pony','gambling')
The text domain will depend on the developer of the plugin/theme. In this instance we have one plugin using "horse_stats" and the other using "gambling".
Now we can target them both individually!
So in our plugin, we can target those text domains individually and ensure we do not make sweeping changes that might cause a negative affect.
No. What does __('Pony','horse_stats') mean? What is "horse_stats" ?
Is that the name of a plugin? And does this mean that if horse_stats is the name of the plugin and I enter "__('Pony','horse_stats')" into the text domain field that it will change Pony to Horses, but only in the admin areas that the horse_stats plugin affects?
This ist he part that's still foggy for me. I'm sure I sound dumb and I should probably just understand this, but I don't. Are my above assumptions correct?
Ok, I'll give you an example: I want to know how to change the word Dashboard to Front Desk, but only do so in the WordPress admin areas (admin Dashboard page, menu text, sub menu text, etc) but not do so in any other areas (like theme settings, various plugin pages, etc).
So what should I literally enter into the text domain field to accomplish this?
No. What does __('Pony','horse_stats') mean? What is "horse_stats" ?
Its what ever you want it to be or the developer who made it. In the case of MarketPress I believe its "mp". Pro Sites is psts. It can relate to the plugin and I suppose really it should for consistency and ease of use. but it could be anything.
This ist he part that's still foggy for me. I'm sure I sound dumb and I should probably just understand this, but I don't. Are my above assumptions correct?
Nahh you don't sound dumb at all. Sometimes it takes a little to get your head around things, I know it does me. :-)
But yeah your assumptions are correct.
I think for Dashboard you don't need a text domain. Just the word you want to change.
Responses (6)
WPMU DEV Fanatic — 25th January 2012 21:24 #
Hi coreymj78,
You can check out the following thread for a succinct explanation from the developer. Just be sure to read from Barry's response, as it explains it all in detail:
http://premium.wpmudev.org/forums/topic/what-is-the-in-this-text-domain-field-for
-David
Member — 27th January 2012 04:47 #
Ok, that thread told me nothing as it is confusing to simply say that if you specify a text domain for a plugin that it will only affect text in that plugin. What does that mean? And again I ask, how could I set where I want it to change the text vs. a global change?
Thanks.
Support Chimp — 4th February 2012 01:13 #
I'll go over this again for you :-)
So within a plugin there can be text lets say:
That has no domain, so any changes could not be specifically targeted.
So lets say that we have two plugins using the same text, this can be a horse racing site. In one plugin it deals with names for a Pony and have "Pony" in the gambling section (a different plugin) it uses the term "Pony" to represent a monetary value (I occasionally like to gamble in casinos but not horses)
Perhaps we want to change Pony to Horses (where it actually means horses and because its not a horse of a small breed), but hold on making a change could affect that right across the board because the admin text change doesn't know how to differentiate........... Unless there is a text domain specified and the text in question has a text domain.
So What Do We Do?
Give it a text domain, and how do we do that????
__('Pony','horse_stats')__('Pony','gambling')The text domain will depend on the developer of the plugin/theme. In this instance we have one plugin using "horse_stats" and the other using "gambling".
Now we can target them both individually!
So in our plugin, we can target those text domains individually and ensure we do not make sweeping changes that might cause a negative affect.
Does that better enlighten you?
Take care.
Member — 13th February 2012 17:27 #
No. What does __('Pony','horse_stats') mean? What is "horse_stats" ?
Is that the name of a plugin? And does this mean that if horse_stats is the name of the plugin and I enter "__('Pony','horse_stats')" into the text domain field that it will change Pony to Horses, but only in the admin areas that the horse_stats plugin affects?
This ist he part that's still foggy for me. I'm sure I sound dumb and I should probably just understand this, but I don't. Are my above assumptions correct?
Thanks.
Member — 14th February 2012 20:45 #
Ok, I'll give you an example: I want to know how to change the word Dashboard to Front Desk, but only do so in the WordPress admin areas (admin Dashboard page, menu text, sub menu text, etc) but not do so in any other areas (like theme settings, various plugin pages, etc).
So what should I literally enter into the text domain field to accomplish this?
Support Chimp — 14th February 2012 22:40 #
Hey again.
Its what ever you want it to be or the developer who made it. In the case of MarketPress I believe its "mp". Pro Sites is psts. It can relate to the plugin and I suppose really it should for consistency and ease of use. but it could be anything.
Nahh you don't sound dumb at all. Sometimes it takes a little to get your head around things, I know it does me. :-)
But yeah your assumptions are correct.
I think for Dashboard you don't need a text domain. Just the word you want to change.
Take care.
Become a member