Bilingual form - InfoPath Dev
in

InfoPath Dev

Bilingual form

Last post 09-08-2011 02:02 PM by Tom Bollah. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-03-2011 01:47 AM

    Bilingual form

     Hello the forum,

    Recipients of an InfoPath form based on the template "Mail Item" are either French or English speaking..
    Is it possible to design a form so that recipients receive it in their own language (and how can Infopath  detect  the language) or do I have to create two separate forms?
    In advance thank you for your answers
    Tom

  • 09-05-2011 01:49 AM In reply to

    Hello Tom,

    in my personal opinion I would use views which are in different languages. Then you can detect the language in the "FormEvent_Loading" event. To detect the language you can use the 'CultureInfo' class which is in the System.Globalization namespace.

    So you have to add in your using block:

    using System.Globalization;

    ... and in the "FormEvents_Loading" you can detect the language in the following way:

    CultureInfo ci = CultureInfo.InstalledUICulture ;

    XPathNavigator nav = MainDataSource.CreateNavigator();
    nav.SelectSingleNode("/my:myFields/my:field1", NamespaceManager).SetValue(ci.Name);

    Depending on the system (english, french) the result in 'field1' is "en-en" or "fr-fr" (culture info). Then you can switch the views depending on the value.

    Hope that helps,

    Karsten
    Filed under:
  • 09-05-2011 04:22 AM In reply to

    Matt Faus has a blog post on how to accomplish this using one view, and I suggest going that route as trying to maintain two views that are the same except for the language can get a bit hairy.
    http://www.infopathdev.com/blogs/matt/archive/2006/02/02/Add-Language-Localization-to-a-Form.aspx

     As far as I know, there isn't a codeless way to get the local language, and I think Karsten's approach would be the way to go about that, if you're willing to use code.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 09-08-2011 02:02 PM In reply to

     Hallo Karsten and Jimmy

    Thanks for your answers.

    At this moment I have a lot of work but as soon I have a moment, I try your solutions

    Tom

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.