Whats the best way to have multilingual site/application?

July 28, 2015 958 views
Security PHP WordPress Applications Ubuntu

i have a website(wordpress)+web application(PHP).

can somebody give me some suggestion whats the best way to make them both multilingual? i don't want to use google translator API becoz that's not 100% accurate. also i want a solution that will not change on page refresh.

another question, is it ok to have multiple SSL certificates from different CA for 1 site? i mean 1 certificate for site another certificate for a sub-domains.

thanks in advance

2 Answers

can somebody give me some suggestion whats the best way to make them both multilingual?

I can tell you from my experience that all wordpress language plugins are a "pain in the behind" and I've tried all of the popular ones.

The most famous one - WPML - is actually the worst of them all.
I spend approx. 2 weeks with cutomer support, ending up with some custom made hacks (bad code) throughout wordpress (e.g. woocommerce, ticket-bookings etc.) which makes it also very difficult to update. In short: any minor update by some other plugin can bring your whole site down. Been there - done that. But to be fair - this was a complex website with lots of different modules.

Even worse is the huge decrease in site speed - and there's nothing you can do about this except reading endless promises that "the next update" will improve things. You may notice - the word WPML alone - makes my blood boil :)

If you must use a plugin (e.g. your client constantly adds new content) then there have been some promising alternatives surfacing on wordpress official plugin site lately - my favourite being qTranslate X which you can find here https://wordpress.org/plugins/qtranslate-x/ .
Do yourself a favour and read the plugins support forums before you install any of these.

Imho the most elegant way for "relatively" static business sites is to have a completely separate wp installation for each language. This will initially take more time to set up but in the long run will safe you lots of time and headaches and is also best performance wise.

Regarding your PHP-application: put a copy of your app in the same subdomain/subfolder as your translated wp installation and search & replace all terms that need translation throughout your code (except if there's a .po-file included, then you don't need that).
If you are comfortable modifying your code you can also create your own .po file but to do that you must manually add a hook to each phrase that needs translation. There should be plenty of tutorials out there how to create your own .po file for your app.

i don't want to use google translator API
You are absolutely right about this. But I see that it's quite popular among scammers who set up lots of meaningless keyword-targeted websites to lure in traffic for their add banners ;)

  • @sugarhill

    thanks a lot for all your valuable inputs. i really appreciate it.

    actually translating my wordpress site was less important then the PHP application. so taking lesson from your experience i guess i will not try to translate my wp site at the moment. ill try the suggestion of .po files as u told me for my php app.

    thanks a lot once again mate.

Have another answer? Share your knowledge.