Added: 2 years ago
From: phpacademy
Views: 10,209
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (39)

Sign In or Sign Up now to post a comment!
  • Hi ,

    First of all great tutos .

    I wanted to know how can i save the language selected on a website if there are many pages .

    Thanks 

  • Hi, Everyone!

    It's also a good tut, but I'm thinking about, when somebudy select a language, it also set a cookie. First it's checked is cookie isset, else get the basic language, or the selected language. In this way, if the website has more pages, they get always the selected language, and if they come back, it's selected the last language. let's see:

    if(isset($_POST['lang'])){

    //select language

    setcookie('lang')=$_POST['lang­'];

    }

    if(isset($_COOKIE['lang'])){

    //select language

    }

    

  • @pocak87 Hi ,

    Is this code works for you with many pages ? .

    Thanks

  • @nhamza1988

    Yes, I treid, end it fine, and easy, just set a cookie, and every page-loading check it, is it setted or not. That's it. sorry for my bad english!!

    If You have any matter, just ask Me

  • @pocak87 Yes , i tried but it doesn't work for me , i have to change everytime the language when i change the page on the site . I putted the same code that you shared .

  • @nhamza1988

    Go there: send me an email, with your e-mail address, neved mean's Your name, email címed mean's your email, üzenet mean's your message, and the message must be minimum 100 character. So send Me an e-mail, and I send back a hole code to You, what mast work. Just I need your email address, and don't want to write here the email addres, cos anybady see here. So send me an e-mail!!!!

  • @pocak87

    youtube Dosen't allow to write an link :-( so the address: google search leg-technic.hu the buttom of the page @ sing the kontakt page!!! and send me email

  • @pocak87 I sent you an email from your website .

    Thanks

  • @nhamza1988 Sorry, but I didn't get it. I tried agein, it works fine. You was on leg-technic.hu, the backround is big red lego bricks, you write neved=name e-mail cím=email address üzenet= message and after you pushed the Küldés button, you get a message in blue: A levelet elköldted ???? Sorry, but i won't write here my e-mail address :-( or you can try kapcsolat@leg-technic.hu

  • @pocak87 Yes , i sent you the messge from leg-technic.hu . I sent you an email which email you gave me .

  • hello

    

  • @phpsaudi CALM DOWN SIR! CALM DOWN!

  • how can i do it where if the player wants to have it translated to portugal then they choose that and it translates every single word to portugal not just 1 word or line.

  • Awesome, this really helped me. Do you have any tutorial on how to use language chooser if you have more than one page? I want to use this for a site, not just one text page.

  • hello from portugal =)

    i'm trying to build a multi language script where i have 2 links; the "index.php" and the "2page.php" but i'm cannot make it work. when i click on one of the 2 links, the language selection goes back to the original

    help?

    thanks =)

  • What about a TRANSLATOR. I've been trying to work on one such as (If $variable == "hello" echo "hallo"; etc) but you can't add other words BEFORE that. So it's just a single-worded translator. And that sucks. How can I do this?

  • SELECTED doesn't work in HTML, because the proper way is selected="selected".

  • @GrigorHovhannisyan In HTML - SELECTED, in XHTML - selected="selected".

  • this tutorial is usefull..but can i know how to translate to others language for real?can someone help me?

    thanks in advance

  • please help me on how to create language chooser in multiple web pages.

  • I love this videos, just one suggestion: for avoiding the switch/case at the end you can simply use something like:

    include('lang/'.$lang.'.php');

    Cheers.

  • This can be done much faster, you can use an if statement :P.

  • LMAO! "Back to our english pa... err... index * "  XD

  • Why not just copy the HTML document and translate it to another languages and just make a link saying "English" or any other language

  • Because this doesn't work for dynamic content very well. This is much more organised and in the long run, easier to translate pages as the language files are seperate

  • Instead of using a separate file for every language, you could set up an advanced array system and just call out that variable. Very simple and more effective.

  • I'd class this as a beginner tutorial. Many many systems use this type of language selection which is why I chose to make it. By saying 'advanced array' you're already going into...advanced arrays!

  • Just saying, there are much easier ways than this. Plus, less files to use, and easier management (For some)

  • Use google translate and translate your code for each page your done.

  • This won't work very well for dynamic content. You get much more control this way.

  • i was about to do something like this in javascript then i realized it was stupid and i see this video in subscription videos... i like the idea, i'm gonna play with cookies later, thanks.

  • Thanks! Keep up with your great tutorials!

  • Thank you for this tutorial I really need this :)))

    You are the best!!!

  • Thanks for the tutorial!

  • 6:52 = fail :p

    Good tutorial Alex :D

  • Question; how do you display PHP files in Chrome? I try it but it just shows the code.

  • he uses XAMPP, which allows your computer to become a webserver, if you like.

  • you need a test server. it's his first video.

  • nice tutorial but no use to me because i use a blog and my website aint like text that be kept as it is, i change it at least one a week

  • Comment removed

  • Nice tut! :)

    Very useful.

  • Comment removed

  • Comment removed

  • Comment removed

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more