i18n - Internationalization - Standards?

Discussion in 'XML & RSS' started by Romain, Apr 6, 2008.

  1. #1
    Hi,

    I'm starting the development of multilingual PHP app and I'd like to use XML files to store the translations. I never used XML before and it's kind of a personal challenge :eek:

    However, I'd like to do things well from the beginning, thus I'd like to use W3C standards. I've seen this page (and many others!) but as a beginner, I'm really confused :confused:

    There is too much information and theory, all I want is to create a valid and well-formed XML file that would be in accordance with the W3C standards without spending a week of deep i18n learning! Also, the websites I've visited just mix XML and XHTML, which is even more confusing as I need PURE XML to process it with PHP.

    I like concrete examples, so here is the information I'd like to have in my XML document, it'd be great if someone could "convert" it to a valid/well-formed/standardized/etc. XML document? Please do not hesitate to suggest any improvements/updates/etc. to the document below.
    If I understood correctly what I read on XML, what I'm looking for is a NameSpace, isn't it? (I want naming/structure rules)

    <?xml version="1.0" encoding="utf-8" ?>
    <translations xml:lang="en_GB">
     <translation>
      <id>1</id>
       <title>welcome msg</title>
       <translated>Welcome you're the Xth visitor!</translated>
       <files>welcome.php</files>
     </translation>
     <translation>
      <id>2</id>
       <title>friendly thanks</title>
       <translated>Cheers mate!</translated>
       <files>welcome.php account.php</files>
     </translation>
    </translations>
    Code (markup):
    I'm using ID and TITLE in order to be able to call a translation in my project either by the title or the id through my PHP function I use this way:
    showText('welcone msg'); 
    OR THIS WAY 
    showText(1);
    Code (markup):
    I'm not looking to become an Internationalization guru, so please keep it simple :rolleyes:
    Thanks!
     
    Romain, Apr 6, 2008 IP