Multiple Languages in a form? - InfoPath Dev
in

InfoPath Dev

Multiple Languages in a form?

Last post 02-04-2008 09:51 AM by davidair. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-04-2008 05:58 AM

    Multiple Languages in a form?

    What is the recommended way of coping with multiple languages in the same form ?

    I was thinking of having a Field with multiple attributes.

    Field
       FieldText
       FieldTextENG
       FieldTextDUT
       FieldTextGER

    On load of the form I would update the value of FieldText with the appropriate language for the user  eg if they were German I would set the value of FieldText to the value of FieldTextGER.... And display Field Text as the Prompt for Field.

    Does that sound feasible ?  What other methods have people used ? What are the pitfalls ?

    Thank you

    Catharine

  • 02-04-2008 06:55 AM In reply to

    Re: Multiple Languages in a form?

    Hi Catherine.

    We have localization in several of our form solutions. I am not the expert or the one who coded it but I tell you what I know.

    All of the form labels, titles, non-field text is kept in a seperate XML file. One for each language. Then as the language is changed this source XML file is switched. Then all text is displayed with expression boxes which reference this language text XML.

    Obviously it is complex to setup but it does work well once you have eveything.

  • 02-04-2008 09:51 AM In reply to

    Re: Multiple Languages in a form?

    Yeah, so this is how you could do it:

    Your  form should only have field, not the language-specific strings. Then you introduce two secondary data source:

    The Text data source will just define your localization schema. For example, it can look like this:

    <localization>
      <fieldPrompt>Default english text</fieldPrompt>
    </localization>

    You can then use textboxes or even better, expression boxes to display the prompts (make sure to use this trick so that the text shows in InfoPath Design mode as well: http://www.infopathdev.com/blogs/david/archive/2007/07/16/Showing-default-values-from-Secondary-Data-Sources.aspx)

    Then you define another secondary data source with your translations:

    <languages>
      <language id="en-US">
        <fieldPrompt>Enter data</fieldPrompt>
      </language>
      <language id="fr-FR">
        <fieldPrompt>Entrez les données</fieldPrompt>
      </language>
    </languages>

    Then in your code you will copy the language currently chosen into the Text data source and you're done!

    I understand these steps could be a bit complicated but this gives you the most flexible translation scheme and it works pretty well in both IP2003 and IP2007.

    Good luck!

    David Airapetyan / Software Services Architect
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.