Multi-lingual Things

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Multi-lingual Things

Post by shiznatix »

Ok I am making a site and its going to be in however many languages they want. Now I am having a bit of a design problem with parts of it though.

There is going to be a shopping cart and so when the admin adds a new item in they put a name and a description. Well now this would have to be in every different language, so what I naturally think to do is cycle though all of the languages and put in a field for that language. The problem is that you now have 4 input's for the name and 4 textboxes for the description flying around. It gets messy, really messy.

I suppose I could use javascript to hide them and whatnot but I dont want to rely on javascript to make the page and also that would require custom javascript for each input area which would get annoying.

Is there a good way to do this that I havnt thought about?
User avatar
theFool
Forum Newbie
Posts: 17
Joined: Thu Oct 26, 2006 2:00 am
Location: Berlin, DE

Post by theFool »

Well another possibility would be to let the user select the language first and then show him only the text box for that language. But that would be a two step process then.

I've chosen the 'one textarea for every language' approch but used javascript to minimize unused fields. Is isn't that hard.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Multi-lingual Things

Post by Christopher »

shiznatix wrote: It gets messy, really messy.
There is not much you can do about the mess because there are multiple of everything. Certainly you can clean up the interface somewhat by hiding things, but in the long run it just slows down data entry for admins.
(#10850)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Erm... how many different languages does the admin know? ;-)

I would go for an "Add a translation" modification button, perhaps giving the user one textarea for an initial alternate language. A bit of JavaScript can let the admin dynamically add more textareas, but it's not strictly necessary.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

If you need to set a lot of data you need to set a lot of data...there's no way of getting away from it.
Erm... how many different languages does the admin know?
Perhaps the admin could make a choose before hand with a bunch of checkboxes saying what languages he knows, the goes in a session or a user table and then you use that not to overwhelm the admin with prompt for language he doesn't know.
obiron
Forum Newbie
Posts: 15
Joined: Fri Nov 10, 2006 4:50 am

Post by obiron »

Sounds like a perfect job for code igniter or one of the other frameworks. You can pass the language code through the functions as an argument and have CI build the base HTML and just drop the relevant text into the correct locations. It takes a bit of work, but has the added advantage of being search engine friedly so you get lots of page rankings.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Not sure I understand your problem but...

Instead of one field for each language, why not have each language listed in an <option>

Still the same amount of work but slightly cleaner interface???
Post Reply