SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I18N+L12N (formely: "Locales, encoding & date manip'n")

    For sure, an all-encompassing post topic!

    The Project:

    We are building a web-based travel portal in PHP/MySQL which will be 'ported' to other languages and time-zones in the future, to be used by joe-public and by travel agency staff.

    The Environment:

    At present we are developing locally on WAMP, with the publicly accessible setup to be LAMP using Apache 1.3, PHP4 and MySQL4.1.

    The Setup:

    Having read around the subject of char-encoding In order to properly cope with multi-language data we will probably then:



    • send XHTML headers as UTF-8
    • encode & store DB data as UTF-8
    • send POSTed form-data as UTF-8
    • possibly make use of the mbstring library?
    Presently however we have no such comprehensive measures for time, date and currency (locale settings) for when the system is ported to other countries. (The location of the host may be changing according to the country, the language and currencies of its users will need to change).

    Ideally we'd like to be able to tweak a few constants and vars in a custom PHP config script and the system would be ready to go in its new locale.

    The likelyhood of required support for languages such as Chinese variants, Korean and Japanese is unlikely but if the support for these could be be fairly easily built-in at the outset, then all the better.

    The Question:

    I'd like to know what techniques you guys might have used or are using right now in the development of multilingal and multi-locale PHP/MySQL websites and web-apps.

    Thanks a lot for any ideas you all might have
    Last edited by phptek; Aug 14, 2005 at 18:57.

  2. #2
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Update

    ...been doing a lot of reading. If anyone else finds this post, these links will probably prove useful:

    I hope these help someone out.

    If you're reading this and you have something to add on I18N or L12N with PHP, then please can you post it here or alternatively suggest another area where such info would be more appropriate?

    Thanks folks

  3. #3
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    These don't work

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2004
    Location
    Australia
    Posts
    101
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, search for I18N and L10N on sitepoint forums.

  6. #6
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phptek
    I hope these help someone out.
    It does . I still have to figure some issues myself and I always enjoy getting references. Thank you.
    There’s more than one way to skin a cat.

  7. #7
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I18N and L10N have such poor support in PHP that every programmer has it's own method. I use XML or INI files for translating static text and the database for translating dynamic text.
    My template manager (that I built) can collect phrases from templates that are marked with <i18n>....</i18n> and translate and replace them. If they are kept in the database it is very important that you issue a single query for every text in the page.

    L10N support in PHP is so poor that I can do without almoust all the time. And if I have too I use my own functions for formatting dates and numbers.

  8. #8
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe nothing specific to dates, but to internationalisation in general, is this presentation I found via Marcus PHP London. Lots of helpful advice and things that need to be remembered

    http://babylon.idlevice.co.uk/phplondon/2005-05/

  9. #9
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nacho
    It does . I still have to figure some issues myself and I always enjoy getting references. Thank you.
    If you have any more links or info please post them here or PM me and I'll put them up. I'm still looking at this myself

    Cheers

  10. #10
    SitePoint Addict phptek's Avatar
    Join Date
    Jun 2002
    Location
    Wellington, NZ
    Posts
    363
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    And if I have too I use my own functions for formatting dates and numbers.
    For sure I will roll my own functions for some of this as well. What I was specifically seeking was hints and tips from people like yourself pertaining to timezone issues.

    For example - in our project people will be booking things in the northern hemisphere but the actitivites they are booking may well be located in the southern hemisphere (.au, .nz etc) I am guessing that as long as all dates are calculated as offsets from GMT (with daylight savings taken into account) then it should all be fine?

    How do you accurstley tell if daylight savings is enabled on a host server? Specify that this be set before you go ahead with a hosting plan?

    Thanks for any other tips you might have


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
  •