Navigation

    ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Dual Content Single HTML

    IT Discussion
    5
    36
    5864
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hobbit666
      hobbit666 last edited by

      Is it possible to do a dual language website but using a single HTML page?

      1 Reply Last reply Reply Quote 1
      • scottalanmiller
        scottalanmiller last edited by

        Yes

        hobbit666 1 Reply Last reply Reply Quote 0
        • hobbit666
          hobbit666 @scottalanmiller last edited by

          @scottalanmiller any pointers? guides? lol been a while since i've done anything HTML

          1 Reply Last reply Reply Quote 0
          • scottalanmiller
            scottalanmiller last edited by

            It would be in the JavaScript to set and determine what is displayed. It would depend if you are going to code it yourself or if you want to use a library for it.

            1 Reply Last reply Reply Quote 0
            • hobbit666
              hobbit666 last edited by

              oh Java, time to get the books out lol.

              scottalanmiller 1 Reply Last reply Reply Quote 0
              • scottalanmiller
                scottalanmiller @hobbit666 last edited by

                @hobbit666 said:

                oh Java, time to get the books out lol.

                Definitely no Java. Java and JavaScript are totally unrelated and Java has no place in web page design. JavaScript is part of HTML now.

                1 Reply Last reply Reply Quote 3
                • scottalanmiller
                  scottalanmiller last edited by

                  JQuery, for example, has a library for this.

                  http://plugins.jquery.com/tag/internationalization/

                  1 Reply Last reply Reply Quote 1
                  • hobbit666
                    hobbit666 last edited by

                    Thanks Scott, will have to read up tonight if i can keep eyes open lol

                    1 Reply Last reply Reply Quote 0
                    • hobbit666
                      hobbit666 last edited by

                      I have asked the question if it can be done in PHP and CCS

                      scottalanmiller 1 Reply Last reply Reply Quote 0
                      • scottalanmiller
                        scottalanmiller @hobbit666 last edited by

                        @hobbit666 said:

                        I have asked the question if it can be done in PHP and CCS

                        Sure, can be done there too. Better to do it there as if you do it in HTML you have to send all of the different languages to the browser and let it decide what to display which will slow down rendering. It would be very silly to do it in HTML, you wouldn't only do that in a situation where you needed to have only a single URL (why) and when you must use static pages and not dynamic ones (no PHP.)

                        1 Reply Last reply Reply Quote 1
                        • scottalanmiller
                          scottalanmiller last edited by

                          CSS would not be involved no matter what. It's JavaScript that enables it if done in HTML, it's PHP that would do it if done on the server.

                          dafyre 1 Reply Last reply Reply Quote 0
                          • dafyre
                            dafyre @scottalanmiller last edited by

                            @scottalanmiller said:

                            CSS would not be involved no matter what. It's JavaScript that enables it if done in HTML, it's PHP that would do it if done on the server.

                            jQuery would make this really easy.

                            hobbit666 1 Reply Last reply Reply Quote 1
                            • hobbit666
                              hobbit666 @dafyre last edited by

                              @dafyre said:

                              jQuery would make this really easy.

                              But still mean reading tutorials and books to work it out lol :D

                              scottalanmiller 1 Reply Last reply Reply Quote 0
                              • scottalanmiller
                                scottalanmiller @hobbit666 last edited by

                                @hobbit666 said:

                                @dafyre said:

                                jQuery would make this really easy.

                                But still mean reading tutorials and books to work it out lol :D

                                Probably still easier than building your own system for this, though.

                                1 Reply Last reply Reply Quote 1
                                • hobbit666
                                  hobbit666 last edited by

                                  Problem is i can't upload any extra files, all i can do is edit the source code of the HTML page.

                                  dafyre scottalanmiller larsen161 3 Replies Last reply Reply Quote 0
                                  • dafyre
                                    dafyre @hobbit666 last edited by

                                    @hobbit666 said:

                                    Problem is i can't upload any extra files, all i can do is edit the source code of the HTML page.

                                    There's a hosted version of jQuery...

                                    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
                                    

                                    You should be able to include that at the top of the html and be done. :-)

                                    1 Reply Last reply Reply Quote 2
                                    • scottalanmiller
                                      scottalanmiller @hobbit666 last edited by

                                      @hobbit666 said:

                                      Problem is i can't upload any extra files, all i can do is edit the source code of the HTML page.

                                      That's good, keeps you from uploading things that you shouldn't :)

                                      1 Reply Last reply Reply Quote 3
                                      • hobbit666
                                        hobbit666 last edited by

                                        OK so not having the best of luck lol. This is what i need to do.
                                        When you go to this site
                                        http://www.somewebserver.com/index.html

                                        you will see:-

                                        Croeso i Aberdaron, rydym yn gobeithio y byddwch yn mwynhau eich ymweliad. I wneud eich ymweliad mor gyfleus â phosibl, rydym fel cymuned wedi darparu mynediad am ddim i'r rhyngrwyd i chi.

                                        If you click on the ENG button or Flag (not decided yet), it will display:-

                                        Welcome to Aberdaron we hope you enjoy your visit.  To make your visit as convenient as possible we have provided you free access to the internet.

                                        I can't upload any files or folders to the webserver i can only edit index.html code :D

                                        1 Reply Last reply Reply Quote 0
                                        • scottalanmiller
                                          scottalanmiller last edited by

                                          Yup, we figured that that was what you needed. JQuery is the best way to do this.

                                          dafyre hobbit666 2 Replies Last reply Reply Quote 1
                                          • dafyre
                                            dafyre @scottalanmiller last edited by

                                            @scottalanmiller said:

                                            Yup, we figured that that was what you needed. JQuery is the best way to do this.

                                            Example blurb below.

                                            <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
                                            
                                            <div id='divEnglish' style='display:none'>
                                            Welcome to Aberdaron we hope you enjoy your visit.  To make your visit as convenient as possible we have provided you free 
                                            
                                            access to the internet.
                                            </div>
                                            
                                            <div id='otherLanguage' style='display:none'>
                                            Croeso i Aberdaron, rydym yn gobeithio y byddwch yn mwynhau eich ymweliad. I wneud eich ymweliad mor gyfleus â phosibl, 
                                            
                                            rydym fel cymuned wedi darparu mynediad am ddim i'r rhyngrwyd i chi.
                                            </div>
                                            
                                            <a id='cmdEnglish' href='#'>Click Here for English</a><br><br><br><br><br><br><br><br>
                                            <a id='cmdOther' href='#'>Click Here for Other Language</a><br><br>
                                            
                                            
                                            <script>
                                            //This is the javascript where the magic happens
                                            $('#cmdEnglish').click(function () {
                                             $('#divEnglish').show()
                                             $('#otherLanguage').hide()
                                            })
                                            
                                            //This is the javascript where the magic happens
                                            $('#cmdOther').click(function () {
                                             $('#divEnglish').hide()
                                             $('#otherLanguage').show()
                                            })
                                            </script>
                                            
                                            hobbit666 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post