Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: What is the trick for multi-language websites (eg you surf in english and when you go

  1. #11
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    yes... you can store html code of whole web page in a field... the type of field should be 'text' so that unlimited amount of text can be stored...

    It can be very long, include javascript and css.. It still works without any problem..

  2. #12
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default VARCHAR is not suited and it will return error for page code in a field ?

    you mean in mysql, correct ? TEXT field type need any parameter for Length/Values (in PHPmyadmin GUI DB TABLE creator) ? VARCHAR is not suited and it will return error for page code in a field ?

  3. #13
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    Yes.. In mysql....

    You cannot choose 'VARCHAR' or anything other than 'TEXT'..

    You don't have to specify any Length/Values for 'TEXT' but there is no harm in doing so except that it will limit the length to the number of characters you have specified.

    VARCHAR is not suited because there is a limit for the number of characters a VARCHAR field can have..

  4. #14
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Jason: that approach looks alright, but what you are stuck with then is just two languages. If you want to have three (or more) then that won't work, and if you ever later want to expand your site you will have to rewrite the code.
    Of course you could just add another layer to all of it where those are the "fr" sub-array items, but starting off that way will help in the end.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #15
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Unless I'm missing something, I'm pretty sure you can have an unlimited number of languages. You are stuck with one base language though.

    You'd have your english=>french array file, a english=>german array file, etc, etc. Then you pass the selected language to the zend_translate object and you are good to go.

    Now if someone wants to translate from any language other than english, things might get a bit more complicated.

  6. #16
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Hmm.... true. But that requires a copy of the English phrases for every language (as opposed to a sub-array of each language for each phrase). Actually, that may work better in some cases. Still, though, you need to include a setup where you will include the correct translation page (fr_trans.php, eng_trans.php, etc) then base it on that.

    As for more than one base language, no, that's not very useful. One language as a base makes the most sense. (You could, with complex code, do that anyway, just look for fr->X && ger-->X, where X is the phrase in English and thus fr==ger.)


    On a more general note, the big advantage of a phrase-by-phrase system like this (or any variation) is that you are allowed to just default to the english if no french (etc) translation is available for a certain phrase. This way you can have the really important bits of information translated into a language and have the long complex text (like a "welcome" note) in English.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #17
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Quote Originally Posted by djr33 View Post
    Still, though, you need to include a setup where you will include the correct translation page (fr_trans.php, eng_trans.php, etc) then base it on that.
    Yeah, but that is the beauty of Zend_Translate. Once the translate object is set up, all you have to do is pass it a language, either based on the user's choice, or one you automatically determine, or a default. And that's it. The object takes care of including the right translation. And with the base language in the source, if a language somehow gets selected that you don't have a translation for, the default is used.

    Quote Originally Posted by djr33 View Post
    On a more general note, the big advantage of a phrase-by-phrase system like this (or any variation) is that you are allowed to just default to the english if no french (etc) translation is available for a certain phrase. This way you can have the really important bits of information translated into a language and have the long complex text (like a "welcome" note) in English.
    Exactly.

  8. #18
    Join Date
    Oct 2004
    Posts
    425
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    If I save html code in DATABASE field(eg german) then how I can fast change the code in a wysiwyg Editor like dreamweaver ?

Tags for this Thread

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
  •