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.

Does anyone know how much do the localization functions from WordPress affect the speed of a website?

Do you think it's worth replacing all strings with gettext inside a theme, even if it will only be used on a single, english website?

share|improve this question
    
Ask yourself one thing, is the code being redistributed... Whatever your answer to that question, it's also the answer to whether you should do translation.. (impo).. –  t31os Apr 4 '11 at 12:20

3 Answers 3

up vote 3 down vote accepted

If you know that you or the client will NEVER need to be translated there is no need to replace all the strings within your theme with gettext.

Regarding the performance issue I found a benchmark comparing the 3 gettex methods. It also compared using the default local vs a different local and the differences were negligible which leads me to the conclusion that that you do take a performance hit when replacing all your strings with gettext.

Benchmarks

enter image description here

share|improve this answer
    
interesting chart :) this is not for a client, but for a site of mine –  onetrickpony Apr 8 '11 at 16:30

I agree with Chris_O:

If you know that you or the client will NEVER need to be translated there is no need to replace all the strings within your theme with gettext.

But with that said if you are releasing or distributing the plugin or theme to the public then you should wrap your strings with gettext, and make the life's of none English speaking WordPress Users easier.

share|improve this answer

There is an alternative: Let your client alter the strings and store them in theme options. I did this just recently for a theme which will be used on many different blogs.

Screenshot of the backend:
enter image description here

Alle strings are stored in one option array, which reduces the performance overhead to one cached DB query. And the client has a better interface and more freedom to edit the fields.

This approach doesn’t work well if your theme is used in many different languages, because you have to offer useful default values for each of them. But for a simple use case with just three or four languages it works quite well.

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.