Expand my Community achievements bar.

Reg: MessageBox in French locale

Avatar

Level 10

A form has been designed in french version.

The message box using the following syntax produces a dialog box with "Yes" and "No" options in English (as shown in figure)

xfa.host.messageBox("Some French Text","Message Title",2,2)

french.JPG

We need the buttons should display french captions as "Oui" and "Non". Any idea how to do that without creating custom dialog?

PS: The form's locale is set to French_Canada but still shows English captions;

Thanks for any advise,

Nith

3 Replies

Avatar

Former Community Member

Designer can support multi-lingual forms through XLIFF. There is some work to do to create stylesheets but the translation effort can be re-used across multiple forms.

http://www.adobe.com/content/dam/Adobe/en/devnet/livecycle/pdfs/using_xliff.pdf

Steve

Avatar

Former Community Member

That message box is being controlled by the javascript engine inside of Acrobat/Reader. I woudl think that the language woudl be based on the version of Reader you installed or perhaps the version of the locale of your OS. The locale of the form woudl not play in it at all.

Hope that helps

Paul

Avatar

Level 6

You can find more info about this solution at http://www.windjack.com/product/acrodialogs/

also check http://www.windjack.com/resources/Examples/DialogUses.pdf

  here is an example that might help you achieve what you are looking for...

 

var CustomAlert =
{

    result:"cancel",
    DoDialog: function(){return app.execDialog(this);},
    initialize: function(dialog)
    {
        var dlgInit =
        {
            "img2":
                {
                    "width": 25,
                    "height": 25,
                    offset: 0,
                    "read": function(bytes){return asdf.slice(this.offset,this.offset+=bytes);}
                },
            "stat": "Some French Text",
        };
        dialog.load(dlgInit);
    },
    commit: function(dialog)
    {
        var oRslt = dialog.store();
    },
    description:
    {
        name: "Message Title",
        elements:
        [
            {
                type: "view",
                elements:
                [
                    {
                        type: "view",
                        align_children: "align_top",
                        elements:
                        [
                            {
                                type: "static_text",
                                item_id: "stat",
                                width: 224,
                                height: 64,
                                alignment: "align_fill",
                                font: "dialog",
                            },
                        ]
                    },
                    {
                        type: "ok_cancel",
                        ok_name: "Oui",
                        cancel_name: "Non",
                    },
                ]
            },
        ]
    }
};

// Example Code
if("ok" == CustomAlert.DoDialog())
{
xfa.host.messageBox("Oui is used")
}else {
xfa.host.messageBox("Non is used")
}

Good luck,