Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,818 members, 7,831,660 topics. Date: Saturday, 18 May 2024 at 12:07 AM

Multilingual Website. How Do I Do This? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Multilingual Website. How Do I Do This? (883 Views)

(2) (3) (4)

(1) (Reply) (Go Down)

Multilingual Website. How Do I Do This? by fastchange: 2:13pm On Oct 13, 2009
Hello NL,
I have just started a new project that requires a multilingual facility. Now this has to be done automatically mainly because it is going to be a CMS based site and I/they (the owners of the site) dont want to go through the stress of uploading different versions of a content every time the site is updated.
I have gone through sites that provide this has a service but then they always have a way of branding their translator. Take google site translator for example, anytime you hover over a link, a tooltip comes out making it obvious that its Google doing the translation. I would have being fine by this but this is really not good for business, Anyway, any help along this line will do.
Thanks in anticipation. (, the last line makes it feel like an official letter. smiley).
Re: Multilingual Website. How Do I Do This? by yawatide(f): 2:56pm On Oct 13, 2009
What cms are you using? If Joomla, check this site to see a bunch of commercial and non-commercial plugins for this:
http://extensions.joomla.org/extensions/languages

Of course, you will want to go with what has the least complaints/the most +ve user reviews.

Good luck!
Re: Multilingual Website. How Do I Do This? by fastchange: 3:00pm On Oct 13, 2009
If it were Joomla or any of the contemporary CMSs this would have been easy. They wanted a custom CMS (for security reasons anyway). They didnt want anything of public knowledge.
Re: Multilingual Website. How Do I Do This? by yawatide(f): 4:22pm On Oct 13, 2009
Then you will have to code it yourself, if I understand what you mean.

Here is a crude way of doing it (if you are using a framework like php kohana (I haven't used it yet but happen to know it has good support for this)):

1) Create files for each language (say english.php and yoruba.php)

2) In each of the files, you will have name-value pairs like so (assuming php is what you are using, though logic remains the same, regardless):

english.php
$consonant = "consonant";

yoruba.php
$consonant = "konsonanti";

3) In the page that calls the include, you would print out the value of words you need translated like so:

Welcome to our site. We have a lot of <?php echo $consonant; ?> in our alphabet

4) Using the url, pass a name-value pair defining the language, like so: www.abc.com/?lang=engish (or yoruba)

5) In your code, you sniff the "lang" value and include either of the 2 files based on the value for "lang" (should be straightforward so I won't include code for this)

If I undestand your original post, this should do it. If not, sorry for the rant cool
Re: Multilingual Website. How Do I Do This? by Nobody: 6:21am On Oct 14, 2009
am interested in this smiley
Re: Multilingual Website. How Do I Do This? by fastchange: 12:52pm On Oct 14, 2009
@ yawa-ti-de
Thanks for your response, I appreciate it.
The thing is that the whole site has to be converted to a specified language (say French) and not specific text. I mean, doing what you suggested would take a lot of time. I was thinking maybe there could be a service provider just like google or an open source package that can do this.
Re: Multilingual Website. How Do I Do This? by yawatide(f): 1:54pm On Oct 14, 2009
you want to build a custom cms, what do you expect?  Do you think those who have gone before you didn't have to "suffer" to get it done?   Why do you think I referred to my solution as a "crude way of doing it"? wink

I have seen the google translator, babel fish (alta vista) et al at work and wouldn't recommend it as I think it does a tacky job, not to mention it makes it 1000% obvious that they are doing the translating as it goes to their site and returns to yours (as at the last time I checked).  There is also the issue of the glaring logo they have which again, I don't like.

Considering there is pretty much everything under the sun on google, I wouldn't be surprised to find a less obtrusive solution, if only you can use the right search terms.

Give google a try and see if it will help you find something.  Just be careful though because these generic translators most likely are following the central language.  In other words, what might be a good word in central french might be a bad word in Cameroonian french.  I have worked for a company that actually used a translation script.  when we ran the Chinese section by our chinese co-worker, he said it was all wrong.  In the end, the company ended up paying an actual company to do the translation for us and we used my "crude way" above to get it done.  It cost a lot, but it was worth it, given the potential customer base the site was opened up to.

Good luck!
Re: Multilingual Website. How Do I Do This? by Nobody: 4:20pm On Oct 14, 2009
@yawa i like your logic i was thinkin this would be difficult but your logic with get methods makes sense.Am no expert i was thinking.[concept not solution oh] You create languages in a db table called languages.With three fields. id(auto increment,not null),language_name and lang lang_message.Then to fill up your db like
1 yoruba ese
2 hausa kwana
3 igbo dalu
then for your language links.
<ul>
<li>
<?
$query="select * from languages";
Result=mysql_query($query);
While($row=mysql_fetch_array($result))
Php echo "<a href=language.php?Choice=."urlencode($row['id'])>"$row['lang_name'] ."</a>;
?>
then in your content just make sure all write up from database so when you click on the link create a code to pull the same content from db in different language.
But if you mean translating the user's input to another language then sorry that's out of my head.I myself not too good in Cms.But your life will be easier if you do this in Oop style.
Re: Multilingual Website. How Do I Do This? by Nobody: 4:26pm On Oct 14, 2009
Syntax error alert cuz i'm typing from phone.@yawa and nairaland techs I wish pple are like you and others here.I study at aptech and it's obvious that pple don't know what they r doing or why they doing the course they r applying for.
Re: Multilingual Website. How Do I Do This? by yawatide(f): 5:05pm On Oct 14, 2009
@yawa and nairaland techs I wish pple are like you and others here.I study at aptech and it's obvious that pple don't know what they r doing or why they doing the course they r applying for.

You are too kind   kiss

Wow! Based on your comments about aptech, maybe I need to organize a seminar/workshop or even go work for them.  Hmm, I wonder if ppl would b interested  undecided

I try to avoid using a database whenever possible as I don't want to unnecessarily tax my server and of course, something could go wrong with/in it, resulting in no returns. That's just me though wink

(1) (Reply)

Working With Facebook As A Query Language / Msc Project Write Up / Pro Call Flasher Android App

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 33
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.