Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am working on a plugin for myself, so, it's totally useless to load textdomain. But most of codes I copied from others are using the __(' ','') I copied the codes from several plugins. So, even if I load textdomain, it's going to be useless as well,posibly slow down the performence. My question is-- What's going to happen when WP read those __(' ','') without a textdomain loaded ? Will it become a problem?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I've actually been in the exact situation you're in before, all you need to do is drop the __()s and the _e()s and replace them with their first parameter, you can pretty easily do this by regex if there are a lot, and it's quick to do by hand if there aren't...I'm not sure what the performance penalty on them is, especially if they're empty, but I'm a bit of a performance hound, so it wasn't something I was going to risk.

share|improve this answer
    
That's a lot of job if I try to remove the textdomain signs. but if I don't remove it, I fear WP might get confused and searching around for the texdomain. –  Jenny Jan 24 '12 at 14:52
    
Nope, you're good to go just leaving them in. You can just regex for them using your favorite text editor, a regex along the lines of _[_e]\([ ]?\'[^\']*\'([ ]?,[ ]?\'[^\']*\')?[ ]?\) should get them all (I drew that up in the comment box, so don't be surprised if you needa tweak it lol) –  m0r7if3r Jan 24 '12 at 21:47

If you are not localizing your theme/plugin, then these functions are quite useless. Their main purpose is to search through the localization module for translated text.

To answer your question, it will not become a problem I don't believe, but is pretty useless if you are not translating your theme or plugin into a different language - but somebody else might want to if they get their hands on your plugin/theme, so it is good to include if your product is going out to the public.

See here for more info on these:

http://codex.wordpress.org/Translating_WordPress#Localization_Technology

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.