I am wondering how to make a multilingual site?
I figured I'd use gettext & Zend_Translate, but I still haven't got the application part figured yet.
The site is going to have an article manager and a gallery and it is planned it is going to be in 3 languages.
Can you give me some tips on doing this, I really don't like the solution on adding the language 1 and language 2 parts in admin. I want it added in one language to MySQL and if selected the secondary language the MySQL data is translated from the primary to secondary language.
I know that. :)
Well here is the deal:
I have a CMS let's say a classic one - article manager.
I add an article in English and my website is in French, Italian and Hungarian (for example).
English is the main language and is added to the MySQL database. Is there a way to translate the English text to other languages (dynamicly) - or the same text has to be pre-translated in mysql or in a language file (CSV, getext, XML) and then parsed and displayed.
Translating a language to another language verbatim yields a laughable reading sentence in the other language, although the basics are there. If you can find a system that recognises language phrases then you might be in with a shout. However, if it's a website such as a business website or any other website where it's impeccable the language is perfectly, definitely the best way is to pre-translate it. For a blog or that kind of website, dynamic translation will suffice because as aforementioned, people can get the basics.
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Right now I'm nowhere about this translation thing.
I know that dynamic translation is - laughable.
Do I save the translated text to a special table in mysql to where save the translated text.
I'm really lost :) After reading 1000 tutoriuals, articles & how-to's I'm lost. :)
Maybe I'm being a bit simple minded here but couldn't you just have a Google Translate link for the article? Just post all your articles in X Language and set up a button to convert it to Y language.
Occam's Razor :: the simplest solution is always the best
There are actually lots of way to go about doing this. You could of course save the translated copies in an XML File, SQL Table, or where-ever you want for that matter. But for the sake of performance, here's my two cents.
First, publish all your articles in English. Then, in your publishing code, set up a curl method to send a POST request to an online translation service such as Google Translate or BabelFish. Then just parse the outputted HTML & retrieve your translated text.
lol maybe I'm crazy. It's late over here and I'm drunk on coffee. But it's just an idea. *
Yeah that is one solution, but not as well good since most of my sites are going to be in croatian :)
I've got a plan for now:
in the config file I set the main lang - the lang that is the data in the DB in.
For other languages there is a file with translated text with keyword for the phrase - articleid-pageid - so if the alternate language is selected the data is pulled out of that file.
I'm thinking gettext for the file. or CSV variant. What do you suggest?
Also there is an idea I was working on.
Country recognition via IP.
There are online services (APIs) where you send guests IP and it returns the country.
Via that you can build :
a) your own service for that - all you need is 1 mysql db :) and a subdomain (you ping your own server about the IP)
b) group of countries that can use the same language (for instance - Serbian, Bosnian & Croatian can use Croatian language :) )