www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > XML

    XML Discussion and technical support for using and deploying XML applications and websites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-06-2009, 03:48 PM
    nickreserved nickreserved is offline
    Registered User
     
    Join Date: Aug 2009
    Posts: 12
    XML Translation

    I load with AJAX this XML (apps.xml) which is translated (//menu/@name and app/@name) in english:

    Every menu or app element has a big depth of hierarchy but here I omit it.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <menu name="Main Menu" path="">
    	<menu name="Menu #1" path="classification">
    		<app name="Application #1" path="vehicle" />
    		<app name="Application #2" path="bridge" need="vehicle" />
    	</menu>
    	<menu name="Menu #2" path="demolitions" />
    	<menu name="Menu #3" path="minefield" />
    	<menu name="Menu #4" path="river_cross_op" />
    </menu>
    I want to translate this XML to many languages with these permissions:
    - Only these elements must be translated //menu/@name and //app/@name
    - Do not clone XML and translate it. It isn't a big waste of size, but I don't want to make a change to all XMLs
    - Translations must be in separated files. Not all translations in the same file.

    Any directions? I can change the whole structure of XML, if you want. No limits.

    My thoughts:

    - Convert all XMLs to PHPs and use gettext like this:
    <menu name="<?=_('Menu #2')?>" path="demolitions" />
    - instead of loading e.g. apps.xml load translator.php?apps.xml (use very tricky code to translate with gettext, elements //menu/@name and //app/@name)
    - Use apps.xml with apps.french.xml included and change elements //menu/@name and //app/@name with translator.xsl.
    apps.french.xml here:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <translations>
    <translation name="Main Menu in french" path="">
    <translation name="Menu #1 in french" path="classification">
    <translation name="Application #1 in french" path="vehicle" />
    <translation name="Application #2 in french" path="bridge" />
    <translation name="Menu #2 in french" path="demolitions" />
    <translation name="Menu #3 in french" path="minefield" />
    <translation name="Menu #4 in french" path="river_cross_op" />
    </translations>
    What do you say?

    Thanks for your time and brain-scratching.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:47 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.