SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Changing Language.

    How would I change the language that a site is displayed in using php? I've seen it done on many sites, and I need to have a little link at the top of my site saying "Russian Version" or "English Version", and when a user clicks, the url stays the same, but the file being retrieved is in a different language.

    Any ideas on how? And how advaced is it to do something like this?
    Content Writing Service - Get custom SEO articles for 10$

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There is no translation function, you have to do this yourself.
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See how they do it at php.net http://www.php.net/source.php?url=/my.php

    Owen

  4. #4
    SitePoint Member
    Join Date
    Aug 2002
    Location
    Linz, Austria
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  5. #5
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, how would I go about doing this swithch?

    How do I have a set of links that will change the text size of the document

    A wonderful example is at http://getthelook.adampolselli.com/corporate.php
    Content Writing Service - Get custom SEO articles for 10$

  6. #6
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Client side Javascript - cannot be done w/out page reload using server-side.


    Very easy to do with the DOM btw

    PHP Code:
    .
    .
    # your link for example
    <a href="index...." target="_self">....</a>
     
    .
    .
    # Javascript
    var aHref document.getElementsByTagName('a')[0];
    # refering to first link within document only
    aHref.onClick = function() {
    # untested
    this.style.fontFamily "24px verdana";

    It's been a while since I've really used Javascript and the DOM though this above would be the general idea - if you need more help, post your thread in the Javascript forum as well.

  7. #7
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That makes sense... I was just curious though. Don't have any practical reasons.
    Content Writing Service - Get custom SEO articles for 10$

  8. #8
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whats DOM?
    Content Writing Service - Get custom SEO articles for 10$

  9. #9
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Document Object Model -

    A standard method of one thing working with Javascript for example, would also work with another language, for example:

    PHP Code:
    # Javascript
    var Para document.getElementsByTagName('p');
    alert(Para.length); 
    Would alert to you the number of <p> tags in your document, thus you can then reference them using the DOM to change them effectively, yes ?

    It also means that what DOM script you write for IE, would work in Netscape6+ and Mozilla and Opera6 (mostly) w/out any changes to actual script - not including the event object which Microsoft so selfishly left out of IE all together in favour of their own crude methods of detecting events.

    Bloody Bast.... Ahem

    It's well smart anyway and most people nowadays are all for it.

  10. #10
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Technical speach... *brain hurts* ...
    Content Writing Service - Get custom SEO articles for 10$


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •