Nov 22, 2009

Need Help With Multi-lingual Site Design

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

Need Help With Multi-lingual Site Design

miCRoSCoPiC^eaRthLinG
Does any of you have any ideas on multi-lingual site design? I'm looking for some resources/guides that'll show me the exact technique of achieving this...

I am NOT looking for the Google Translate kind of option, where you've got a bunch of buttons on your site - clicking on which, will pass your page through Google Translator producing a totally garbled grammatical output in another language...

What I want is to define every Text Element on the site as variables and depending on the lanugage of your choice, these variables are filled in from pre-defined language files containing key-value pair declarations of the same.

I know this is very much possible in Firefox extensions - how do you go about doing the same for web-pages ?

Thanks,
m^e

Comment/Reply (w/o sign-up)

vujsa
Generally speaking in PHP at least, the language file is nothing more than a list of defined constants.

Like so:
CODE

DEFINE('_LANGUAGE','en');
DEFINE('_NOT_AUTH','You are not authorized to view this resource.');
DEFINE('_DO_LOGIN','You need to login.');
DEFINE('_VALID_AZ09',"Please enter a valid %s.  No spaces, more than %d characters and contain 0-9,a-z,A-Z");
DEFINE('_VALID_AZ09_USER',"Please enter a valid %s.  More than %d characters and contain 0-9,a-z,A-Z");
DEFINE('_CMN_YES','Yes');
DEFINE('_CMN_NO','No');
DEFINE('_CMN_SHOW','Show');
DEFINE('_CMN_HIDE','Hide');


Basically, you load this file very near the top of your script. Probably after you determine the users preference and every time PHP comes accross one of your defined constants, it replaces the constant with the text..

Pretty simple, right?

So here is some code for you to look at:
CODE

<?php
DEFINE('_LOGIN_SUCCESS','You have successfully Logged In');
DEFINE('_LOGOUT_SUCCESS','You have successfully Logged Out');

if($new_session == TRUE){
    echo _LOGIN_SUCCESS;
}

if($session_end == TRUE){
    echo _LOGOUT_SUCCESS;
}


Now of course, you'll need to store the user's preference somewhere. If you will have regular members, you can set a default language preference in the database for the user but visitors will have to choose each visit. Take your pick as to how you will manage your user sessions and then adapt a language variable to that. You could set a long term cookie on the user's system to ensure that their prefered language is preselected but that is up to you.

Good Luck.

vujsa

 

 

 


Comment/Reply (w/o sign-up)

pyost
If you are doing a site from scratch, this shouldn't be a problem, as you will know exactly what structure to use. However, redesigning one probably isn't worth the trouble.

Anyway, this is how I would solve this problem - assuming that all your pages are PHP. In the page URL, there would always be a language attribute that determines which one to use. Let's say your site offers English, French and German. Therefore, the possible values would be lang=en, fr, de. If the value doesn't match any of these, or isn't set, the default language is used. All of this is a simple case command in PHP.

As for the text elements you will be using, it would be best if you stored them in a separate PHP file for each language (for example, /lang/en.php). Since you have already figured out which language the visitor wants to use, you would just add the language file to your current page - include/require('lang/en.php'). Now you would have all the text elements available inside variables smile.gif

Of course, there are several downsides to this method. First, which is not so bad, you would have to add the language parameter to all the links. And second, it would be a lot harder to create content, as there would be now text in the code, only variables. But it sure is useful if you plan on adding more languages later on.

By the way, I believe this is exactly how IPB works, so you might want to take a look wink.gif

~edit~

Heh. vujsa beat me to it tongue.gif

Comment/Reply (w/o sign-up)

miCRoSCoPiC^eaRthLinG
Thanks guys.. am working out the login/member maintenance issues of a test site... and am going to implement multilingual interface for it.. hence the queries.. Will get back to you with more pestering questions the moment I get around to working on this issue biggrin.gif

Comment/Reply (w/o sign-up)

pyost
And how about some more information on what you are woking on? Are you doing a complete site, or merely editing an already existing PHP script?

Comment/Reply (w/o sign-up)

Aka_Bar
miCRoSCoPiC^eaRthLinG, i can help you with Russian Language, if you want you are welcom, i wll help you with pleasure!!! cotact with me any time!! Russian is my first lang so i wll not have problems with that!! i have years of experiense in translation From English to Russian smile.gif im doing it better then Russian into English smile.gif

Comment/Reply (w/o sign-up)

pyost
Now that you mention it, I can do Serbian translation, though I don't know why you would want to have it biggrin.gif

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : multi, lingual, site, design

  1. Website Navigation Hover Buttons Stick So Made Css Today
    need further help with tutorial from this site (7)
  2. Stretching My Site Vertically
    Using CSS or HTML (6)
    I know it's possible, I've seen it one time. But I forgot. Many websites, if they hold more
    content than there is room for in the minimum height, the site stretches vertically. How can I do
    this? I only know that I need a background image of 1px height. Thanks in advance MediYama....
  3. Unicode Encoded Site - Characters Not Displaying Properly?
    (4)
    Hey guys, I've been working on a AJAX based CMS for a client for the last few days
    and am in the final stages of deployment. I've run into a slight problem here. The site is
    supposed to be in Norwegian. The back-end uses the tinyMCE editor for adding in content, which
    is stored in MySQL. Now this presents no problem at all and the content is displayed just fine in
    the browser.. Problem arises when it comes to the site menu. It is a drop-down menu script from
    DynamicDrive, which reads off the menu items the same way from MySQL as the content and b....
  4. Cvs For Maintaining Your Site
    (0)
    This is something every webmaster would love to use.. but didn't know existed. There is a tool
    named "CVS" which can be used to save all versions of your program. You initially start with a set
    of source code files, and the project grows from there on. If you make a mistake you can always
    restore the changes you made from the previous version you added to the "CVS". During a
    website's lifetime, a lot of code keeps changing, and more often than not, some code causes a
    problem in the rest of your website. Using CVS would help to detect where you slipped in those ....
  5. Thinking About An "audio" Web Site
    Your feedback please (4)
    Our company is in the web development (and marketing) business. This winter we are re-developing
    our own site, and I have been thinking of making the web site also available as an audio option.
    Since I'm an audio learner this concept interests me, and I figured I would throw this idea to
    you guys for you opinions / feedback etc. as I don't like to act on something without first
    getting feedback from people. I have the right recording gear to make the files sound good, so
    there's no problem there. And I would still do the usual "TEXT" in particular the sea....
  6. Help Choose A New Banner For Me Please
    Help needed to choose a new banner for my site (11)
    Ok yesterday we got busy and spent some time making some new banners for The Sounds Of The Suburbs
    site. We haev can for sort of an urban decay theme on the site..and were going to totally remodel
    it this week to different feel and maybe even get the databases working /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> So can you take a look at the
    images below and post which one you feel is the best one.. Your views will help us hopefully decide
    on the new banner Banner 1 Banner 2 Banner 3 Banner 4 Banner 5 Banner 6....
  7. How Do I Keep A Background On My Site
    (14)
    I had a background on my site that i got on the internet. I don't remember the name of the site
    but from it I was able to save the background (which was a textured blue background) to
    photobucket.com. I've had it there for awhile, but now, all-of-the-sudden it disappeared. I
    guess you can only keep things on photobucket for so long. But how do I keep a background on my
    site if I can't host it somewhere? Is there a way to put the picture in cPanel and use it from
    there? If there is, I cant figure it out.....
  8. With Or Without Tabs?
    help me choose design for my site. (15)
    As I run this website for more than a 1 year now, Im getting more and more visitors, I have a
    feeling that navigation on my page isn't such great as it seems on the beggining. I tried to
    navigate like first-time user, and have trouble finding information that I was looking for. So, I
    have an idea, to integrate basic types of information on 4 main TABs at the top of page. Look at
    the two pictures and tell me which one is better: the one with the tabs, or the one without.
    The above picture is new version, with tabs... The above picture is current look ....
  9. How To Display XX Users Online On Your Site ?
    (5)
    i've seen many sites around the net that have something on their page that says like 348 users
    online... does anyone here know how that is done and could help with this issue.... like i wish to
    record the number on users on all my 525 pages on my site and add them all together into 1 number
    that i show on the front page of my site (not just the ppl viewing that 1 page).... if anybody could
    help i'd be very thankful thank you!....
  10. How Can You Spice Up Your Basic HTML Site ? Beginner Needs Help
    (9)
    Well im new to this,and i know a person who knows how to do HTML,I of course dont lol,but I was
    wondering with html can you change the way the sites you make on here look and ect..(put flash in
    and w/e..)....
  11. Redirecting All Htm Files To Php Site...
    (8)
    Hi, just finished converting all my files from .HTM to .PHP files. Is there an easy way to redirect
    all my users who go to the .HTM pages to the .PHP pages instead? Basically all the names remained
    the same. Just the extension changed. My webhost has cPanel 10. something... Thanks.....
  12. Embeding Font Files
    How To Embed Fonts To Your Site (1)
    A lot of web designers run into the same problem of wanting a certain font type, but the question
    comes up "How do I guarentee the font to show up without the viewer's computer to install the
    font on the computer?" it's easy, just follow these steps. The first thing you have to do is
    download and install Weft 3 from microsoft, it's free, the download link is on that page. the
    easiest way you can embed a font is by using the wizard and follow the steps commanded to you.
    Easy, but what if you really want to know how the program works, or don't want to....
  13. Good Site To Download Web Templates ?
    (21)
    could anyone recommend a place to download (preferably free (as im not sure i can make it work))
    some (or a) good web template(s), something easy to use and not too complicated! thanks chris p.s
    just needs a couple pages of text (preferably with some graphics which i can change), some contact
    info and links to galleries which i have already made.....
  14. Free Shoutbox For Your Web-site
    And a cool one at that ;) (12)
    Hi guys,     Those who want to avoid the extensive process of setting up a shoutbox on your own
    web-site (messing around with a whole bunch of PHP Code and MySQL Databases in the process) - can
    grab one for FREE rightaway from YellBox. I found out about their site a couple of hours back -
    and it's looks real good. Check out: http://yellbox.com Here's a list of their features:
    QUOTE     *  Instant feedback from visitors you would not hear otherwise.     * Allow your
    visitors to communicate or help each other.     * Greater sense of community will keep vi....
  15. Multi-user Blogs?
    Possible? (6)
    I've seen websites with a news page in a manner like blogging. With the time, date and all that.
    But the one thing interests me most in these kind of "blogs" is the "multi-user" style they use.
    They may have one person posting some information and then there will be another "sub-admin" posting
    another. How would i go about doing this without letting my friend knowing my password to my cpanel
    and giving him access to everything. What i mean is to know how to create a portion of your site
    which you allow your friend to update while he never gets to touch the rest of yo....
  16. Programing My Site
    (4)
    Hey, I just got hosting and I need help to program my site. How do I get a forum program on the
    front of my site. I cant change the design or anything. Can some1 please help me. THAnks
    jrdonjar0591 Edit -> Moved topic to more suitable location (Webdesign and HTML in the design
    category) -- Moon....
  17. Find Out Dead Links In Your Site Automatically
    Want to see a dead link on your site? (11)
    If you try to go to http://www.dead-links.com you will be asked for your domain or url. Enter it
    and the bot will find any dead links that you might not have seen. Have a nice day.......
  18. How Do You Put Flash Into Your Site?
    Help plz... (7)
    Hi, im makin a games site for Tasty Relish Forum. (go here to join and help fill this forum!!!)
    how do I embedd flash games?....
  19. Get Afree Template For Your Site
    (3)
    there is some site whic give u free html templates wich can be so easy to u to design ur own site
    lets share it to find the best i will add the sites i use effex media
    http://www.templatesweb.com/ ....
  20. What Is The Best Language For Web Site ?
    What is the best language for web site ? (23)
    Which is the best language, for a web site ? Topic moved, this suits better here, in the
    design/websites forum /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif"
    /> -- MoonWitch Notice from microscopic^earthling: Moved again.
    Out of Howto's and Tutorials into Designing > Web Design. ....
  21. Wap Sites
    Do you have a WAP site? (4)
    Do any of you guys have a WAP site or has an interest in making one? How many of you have used a
    wap browser or even used your cell phone to access a wap site? I know some people don’t care about
    cell phones other that to make call, but the technology is here to stay. Like computers the cell
    phone will be integrated with every aspect of communication and is constantly expanding. The WAP
    protocol is the leading standard for information services on wireless terminals like digital mobile
    phones and Personal Digital Assistants (PDAs). WML is the language used to create p....
  22. Web Site Trackers?
    (8)
    Hi guys! I need for my site a kind of a tracker, that will show me how many peoples enetred my
    sites, what pages they view, where are they come from? I need detailed information on my visitors!
    is there any such a service for free? plz help!thanks!....
  23. Why A Site Is Viewed Differently In Browsers
    (12)
    hi guys! I have a real big problem... I have made my site, and in explorer it is viewd perfectly!
    When I loaded it on Mozilla Firefox, the first page looks like in explorer, but others are so ugly!
    a cell from the table is moving much more to the right!!! what can I do? Why is so? does it help
    visitors, if I write: best view: internet explorer ? thanks!....
  24. Weather Feed Script In Php
    A good weather feed on your site (2)
    If you are tired of providing your clients with weather feeds that take visitors off of their site
    or slam their site with ads, I finally found one after searching for hours. Here's a link to a
    FREE php script that pulls the feed directly from any airport in the world to your site. It is easy
    to customize and has simple, well documented installation instructions.
    http://www.mattsscripts.co.uk/mweather.htm hope you find it helpful... a good one for designers
    to archive as you will most likely need it some day for a client. Check out Matt's other free
    scri....
  25. Website Review
    Please Review this simplistic site (11)
    I just posted a simple designer site, you comments would be appreciated.
    http://www.pbolduc.astahost.com Please feel free to critique any of the completed sites as well.
    Also would like your opinion on the header of this site under construction (load time)
    http://www.pbolduc.astahost.com/protectSoftware/index.php The links are broken coming off the
    page. Thanks, pete....
  26. All Images Don't Show Up When Published!
    Site looks OK when previed on computer (7)
    First attempt to publish the site didn't work to good. /sad.gif" style="vertical-align:middle"
    emoid=":(" border="0" alt="sad.gif" /> I have all the images used to test in /images/ folder and
    it's my first attempt on using CSS so it may be botched on the css level /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /> My CSS file are here at:
    style.css . I created a index.html file and uploaded it together with all the images used. In the
    #header part 1 image show up but not the other (second image show not the first). Background im....
  27. Free Templates
    Great site! (3)
    I found a website with all free web and flash templates! They're really cool! I have 3 of them
    ready to install now! Just go to www.notemplates.com and sign-up free and download as many as you
    want! They offer only free templates in many genres! I like them a lot because the templates look
    really professional and they're free!....
  28. Site Designing
    (21)
    Do any of you guys have a particular process you go through when designing a site? I always find it
    really hard to get started on a site, and often have to have 4 or 5 gos before I get it right. Is
    there a "perfect formula" out there for getting your designs right every time?....
  29. Help me
    I want to make site to the linux beginer (3)
    Please help me, give me ideas. I want to create a place to help to all the persons that want to
    learn linux. I have ideas but I now you have better ideas. My main idea is to show that everything
    that is done in windows can be done in linux. As see movies, play music and create sites webs.....
  30. Music On My Site?
    (18)
    Does enyone know how to add background music to your webpage? Can you do it using html???
    /mellow.gif" style="vertical-align:middle" emoid=":mellow:" border="0" alt="mellow.gif" />
    Notice from microscopic^earthling: Moved to Designing > Web & HTML .
    Absolutely wrong forum. ....

    1. Looking for multi, lingual, site, design

See Also,

*SIMILAR VIDEOS*
Searching Video's for multi, lingual, site, design
Similar
Website Navigation Hover Buttons Stick So Made Css Today - need further help with tutorial from this site
Stretching My Site Vertically - Using CSS or HTML
Unicode Encoded Site - Characters Not Displaying Properly?
Cvs For Maintaining Your Site
Thinking About An "audio" Web Site - Your feedback please
Help Choose A New Banner For Me Please - Help needed to choose a new banner for my site
How Do I Keep A Background On My Site
With Or Without Tabs? - help me choose design for my site.
How To Display XX Users Online On Your Site ?
How Can You Spice Up Your Basic HTML Site ? Beginner Needs Help
Redirecting All Htm Files To Php Site...
Embeding Font Files - How To Embed Fonts To Your Site
Good Site To Download Web Templates ?
Free Shoutbox For Your Web-site - And a cool one at that ;)
Multi-user Blogs? - Possible?
Programing My Site
Find Out Dead Links In Your Site Automatically - Want to see a dead link on your site?
How Do You Put Flash Into Your Site? - Help plz...
Get Afree Template For Your Site
What Is The Best Language For Web Site ? - What is the best language for web site ?
Wap Sites - Do you have a WAP site?
Web Site Trackers?
Why A Site Is Viewed Differently In Browsers
Weather Feed Script In Php - A good weather feed on your site
Website Review - Please Review this simplistic site
All Images Don't Show Up When Published! - Site looks OK when previed on computer
Free Templates - Great site!
Site Designing
Help me - I want to make site to the linux beginer
Music On My Site?
advertisement



Need Help With Multi-lingual Site Design

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com