SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Feb 2006
    Posts
    257
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Offer multiple languages

    Hi,

    Is there a specific way of offering sites in different languages, or does everyone just develop there own method of doing it?

    I need to offer my site in a couple of different languages and hoped there was a more efficient way that just storing ALL the text in a database and extracting the correct one depending on language settings.

    Thanks

  2. #2
    SitePoint Guru
    Join Date
    Jul 2005
    Location
    Orlando
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A common way of doing it is to create different language files. Each file would be a series of defines of the same phrases in different languages. Depending on user preferences you would require_once the appropriate language file.

    Then you'd just use the defines throughout the script. Like ID_WELCOME_GREETING, which would be defined in each language file as however that message should be translated.

    I do this in my projects which are only meant for one language, as well. This allows the non technical people involved in my project to change the phrasing that I've selected.

  3. #3
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check out GNU gettext.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may also check the following article. I hope you find it useful.
    http://www.stylusinc.com/Common/whit...;20Support.pdf


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
  •