Thread: Translating XML

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    4
    Rep Power
    0

    Translating XML


    Hello - I have a question about translating XML code. I am not sure which parts are the actual code, and which parts are to be viewed by the user, and therefore translated. I have bolded what I suppose I shall translate:

    <organizations default="interface_01">
    <organization identifier="interface_01">
    <title><![CDATA[IP Video Surveillance and Storage]]></title>
    <item identifier="course_launch" identifierref="mainindex">
    <title><![CDATA[IP Video Surveillance and Storage]]></title>
    </item>
    <imsss:sequencing>
    <imsss:controlMode choice="true" choiceExit="true" flow="true" forwardOnly="false"/>
    <imsssostConditionRule>
    <imsss:ruleConditions>
    <imsss:ruleCondition condition = "always"/>
    </imsss:ruleConditions>
    <imsss:ruleAction action="continue" />
    </imsssostConditionRule>
    </imsss:sequencing>
    </organization>
    </organizations>

    I am not sure about "true" "false", "always" and "continue" elements - are they parts of the code? Or maybe it depends on DTD or something?

    I don't know too much about programming.
    Thanks for help
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,413
    Rep Power
    1871
    What do you mean "translate"?

    The embedded text to a foreign language (but still retaining the XML), so

    IP Video Surveillance and Storage
    becomes
    Vidéosurveillance sur IP et de stockage

    Or translate the XML into something else, like say HTML for displaying in a nice pretty browser?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    4
    Rep Power
    0
    Well, of course I meant translating between natural human languages

    So, I need (can) only translate these parts of the text that are to be read by the end-user of the software.

    Thanks
  6. #4
  7. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,413
    Rep Power
    1871
    > I am not sure about "true" "false", "always" and "continue" elements - are they parts of the code? Or maybe it depends on DTD or something?
    I would probably leave those alone for now, until you understand more.

    Do you have some means of automatic translation, if you've managed to get as far as say extracting "interface_01"?

    The XML standard
    Some information on xml:lang
    This last one might be worth a look, as it would allow you to store multiple translations in the same XML file, which might be easier from a data management point of view. That is assuming that the consumer of this XML is savvy enough to deal with xml:lang to begin with.

    > I don't know too much about programming.
    So what do you know?
    Which programming languages, which operating systems, which compiler(s) and so on.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    4
    Rep Power
    0
    Well, I think you misunderstood me

    >So what do you know?

    I am a translator, I specialize in legal and literary translations.
    I know how to use some CAT tools, but it is not a case here.

    I want to cooperate with a new agency, and as a part of the recruitment (apart from translation and CAT tools test) i have to answer the question:
    Software Translation) Please highlight the text that would be translated in the following xml strings excerpt: (and below is the excerpt that i have pasted)

    I am not a software translator nor a programmist (and I'm not aiming at these positions but I have to complete this task. There is no automatic translation tool whatsoever in this task. Just the fragment of the code and the question (isn't it too little information?)

    Thank you
  10. #6
  11. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,413
    Rep Power
    1871
    OIC,

    Without knowing the context in which the XML is used, I would just stick with translating
    <title><![CDATA[IP Video Surveillance and Storage]]></title>

    XML attribute names with names like identifier, eg
    <organization identifier="interface_01">
    are almost certainly used control some aspect of processing elsewhere, and not just used to display information to the end user.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    4
    Rep Power
    0
    Great, thank you.

    Can you tell me whether the DTD file would contain some hints for the translator? I mean, if I had a DTD for this script, would it be possible to determine whether to translate other elements (e.g. "interface_01")?
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0
    you could add the "xml:lang" attribute inside your XML document for setting your current language

    Best regards,

    A.Brillant
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0
    Originally Posted by salem
    OIC,

    Without knowing the context in which the XML is used, I would just stick with translating
    <title><![CDATA[IP Video Surveillance and Storage]]></title>

    XML attribute names with names like identifier, eg
    <organization identifier="interface_01">
    are almost certainly used control some aspect of processing elsewhere, and not just used to display information to the end user.
    Hi,

    Did I get it correctly, that you would translate only "IP Video Surveillance and Storage" and nothing more?

    Thx in advance,
    pagi.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    1
    Rep Power
    0
    however,
    ![CDATA[IP Video Surveillance and Storage]]
    has brackets and ! before and after, which mean it is an element and should not be translated, is it? That is, it is a "identified element" that has been previously explained...is it?


    <organizations default="interface_01">
    <organization identifier="interface_01">
    <title><![CDATA[IP Video Surveillance and Storage]]></title>
    <item identifier="course_launch" identifierref="mainindex">
    <title><![CDATA[IP Video Surveillance and Storage]]></title>
    </item>
    <imsss:sequencing>
    <imsss:controlMode choice="true" choiceExit="true" flow="true" forwardOnly="false"/>
    <imsssostConditionRule>
    <imsss:ruleConditions>
    <imsss:ruleCondition condition = "always"/>
    </imsss:ruleConditions>
    <imsss:ruleAction action="continue" />
    </imsssostConditionRule>
    </imsss:sequencing>
    </organization>
    </organizations>

    I understand that the parts to be translated are those between quotation marks, like "true" and so. And also, any tag like <organization> COULD be translated to make easier the work of the other developers which are not English, BUT it would not be a absolute condition, since the browser would understand them anyway. Is it true?
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Location
    Bangkok and Vietnam
    Posts
    20
    Rep Power
    0
    It gives me False . Then I submitted this to my instructor, he will answer for this soon.

IMN logo majestic logo threadwatch logo seochat tools logo