Change Browser Language with Javascript

Hey
I need to change the language of the user in the portal , using two small links , EN | PT  if the user clicks EN the browser language will be EN_US else pt_PT how can i do something like this?
i'm looking for javascript solution mainly or anything else related to sap. thanks

Hi,
String user = null;
     try {
      user =
       WDClientUser
        .getCurrentUser()
        .getSAPUser()
        .getUniqueName();
     } catch (WDUMException e) {
      // fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), e);
try{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("user"+user);
IUserFactory userfact = UMFactory.getUserFactory();
IUserMaint userMaint = userfact.getMutableUser(user);
userMaint.setLocale(Locale.FRENCH);
userMaint.commit();
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("success");
}catch(Exception e){
Hope this code helps you.
Cheers-
Pramod

Similar Messages

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • How can I change the language with the .dat (.bak) file?

    How can I change the language with the .dat (.bak) file? Is it legal?
    How does it work?
    Thanks for answering

    https://discussions.apple.com/message/17364930#17364930

  • Could i change the language with the keyboard buttons ?

    could i change the language with the buttons ? i mean something like command+ctrl+alt or shift,idk. thank you

    I think this might help you
    Switch language using keyboard shortcuts
    To select the input source (language) you previously used, press Command-Space bar.
    To select the next input source in the Input menu, press Command-Option-Space bar.
    If Spotlight opens when you’re switching input sources, see:
    If Spotlight opens when you’re switching input sources

  • Change page attribute with JavaScript

    Hi,
    hope someone can help.
    Is it possible to change a BSP page attribute with JavaScript??
    I have a JavaScript array with some serialnumbers. After push a save button, i want to save the array data into a page attribute.
    Some ideas?
    Regards Anton

    Hi,
    The only way of passing vars from JS to page attributes is submitting them via (hidden) values in a form or via params in an URL.
    Alternatively, you can try to let JS store things in a client cookie and let the BSP read that cookie.
    I didn't try that out yet though.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Problem, change the language with dynamic text

    I am looking for a way to change simply the language of my flash animation
    I work with flash cs4
    of course I got Mylocale.as:
    import mx.lang.Locale;
    class MyLocale extends mx.lang.Locale {
    static function start():Void {  
    var langCode:String = xmlLang;
    currentXMLMapIndex = 0;
    xmlDoc.load(xmlMap[langCode][0]);
    static function setXMLLang(langCode:String):Void {
    xmlLang = langCode;
    and different xml files in the same folder than my swf file
    in string , I ticked : "replace  strings automatically during the execution"
      with a default language (I am wondering if the problem is not from there)
      if I tick: "replace strings manually using the scene language " or "replace strings via actionscript"
    my code does not work.
      then I kept: "replace strings automatically during the execution"
    in my flash animation I have several scenes (pages)
    p1, p2, p3, p4
    in p1
    I created a language bar
    then 2 layers inside
    Layer--action:
    langListener = new Object();
    langListener.change = function(eventObj) {
    var target = eventObj.target;
    var newLang = target.selectedItem.data;
    MyLocale.setXMLLang(newLang);
    MyLocale.start();
    lang_cb.addEventListener("change", langListener);
    // Force Japanese
    lang_cb.selectedIndex = 1;
    lang_cb.dispatchEvent({type:"change"});
    Layer--language ex Fr:
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "fr") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    ex Ja :
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "ja") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    When I change the language in p1 , the language is also modified in p2, p3 and p4
    however , after a navigation in p2, p3 and p4 , once I come back in p1 , the default language is back automatically although I did not touch the language bar!!
    I don't know how to solve the problem
    to my mind , the script reset itself each time I come back on p1
    is there a way to keep the saved settings even when I am back on p1 until I modify manually again the language bar
    thanks a lot

    I am looking for a way to change simply the language of my flash animation
    I work with flash cs4
    of course I got Mylocale.as:
    import mx.lang.Locale;
    class MyLocale extends mx.lang.Locale {
    static function start():Void {  
    var langCode:String = xmlLang;
    currentXMLMapIndex = 0;
    xmlDoc.load(xmlMap[langCode][0]);
    static function setXMLLang(langCode:String):Void {
    xmlLang = langCode;
    and different xml files in the same folder than my swf file
    in string , I ticked : "replace  strings automatically during the execution"
      with a default language (I am wondering if the problem is not from there)
      if I tick: "replace strings manually using the scene language " or "replace strings via actionscript"
    my code does not work.
      then I kept: "replace strings automatically during the execution"
    in my flash animation I have several scenes (pages)
    p1, p2, p3, p4
    in p1
    I created a language bar
    then 2 layers inside
    Layer--action:
    langListener = new Object();
    langListener.change = function(eventObj) {
    var target = eventObj.target;
    var newLang = target.selectedItem.data;
    MyLocale.setXMLLang(newLang);
    MyLocale.start();
    lang_cb.addEventListener("change", langListener);
    // Force Japanese
    lang_cb.selectedIndex = 1;
    lang_cb.dispatchEvent({type:"change"});
    Layer--language ex Fr:
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "fr") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    ex Ja :
    // Forces combobox to have the correct value
    on (release) {
    var component = _parent.lang_cb;
    for (var i=0; i< component.length; i++) {
    var item = component.getItemAt(i);
    if (item.data == "ja") {
    component.setSelectedIndex(i);
    component.dispatchEvent({type:"change"});
    break;
    When I change the language in p1 , the language is also modified in p2, p3 and p4
    however , after a navigation in p2, p3 and p4 , once I come back in p1 , the default language is back automatically although I did not touch the language bar!!
    I don't know how to solve the problem
    to my mind , the script reset itself each time I come back on p1
    is there a way to keep the saved settings even when I am back on p1 until I modify manually again the language bar
    thanks a lot

  • Change 3D views with JavaScript code?

    I am looking for a way to change 3D views using JavaScript. I want to obtain similar result as the predefine action (Go to a 3D view) but with code.
    More preciselly, I want to connect items within a list box to different 3D views.
    Any ideas or suggestion would be greatly appreciated.
    Thank you
    Tutorial on how to use the Go to a 3D view action:
    Connecting Document JavaScript to 3D Views (PDF: 2.3M)
    http://partners.adobe.com/public/developer/en/tips/topic_tip3.pdf
    Related topics:
    looking for a way to switch views using Javascript
    http://www.adobeforums.com/cgi-bin/webx/.3bbed722/0
    SMOOTH TRANSITION BETWEEN VIEWS?
    http://www.adobeforums.com/cgi-bin/webx/.3bc0ce56
    Cameras vs. views; views.xml
    http://www.adobeforums.com/cgi-bin/webx/.3bbf0748/3

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Change TextView value with Javascript

    Hello,
    I'm trying to find a way of changing the value of an HTMLB TextView on the client side with javascript.
    Do you know how to do that ? Cannot work it out...
    Many thanks
    Nicolas

    Hi,
    this can be a bit tricky, because you have to know, how to access the element. that means you need an unique id or an absolute position of the TextView-element
    if you can see, how to access the specific element in your client-pagesource, a possible javascript could be:
    document.getElementById("<id of element>").firstChild.nodeValue="My new Text"
    or access by name/count of the element:
    document.getElementsByName("<name of element>")[#position of occurance].firstChild.nodeValue="My new Text"
    kr, achim

  • Changing applet parameters with Javascript

    Is it possible to have an applet read a param value which has been changed with Javascript after the applet loads?
    I've tried changing the param value in this way, but the applet doesn't read the new value. It reads the default value in the HTML when the applet loads, and getParameter is in the main loop of the applet which runs and updates other (internal) values fine...

    Well that page says that param values can't be changed at run-time. Never mind though because I read some more and found out how to implement a method in the applet (which can be called from Javascript) that reads the host page's DOM, thereby achieving the same result.
    Thanks for the pointer.

  • Change product language with upgrade?

    Hi there,
    we're currently working on CS4 Production Premium in german and would like to change to ENGLISH with the new upgrade to the latest installment of the Suite, CS5.5. Is that possible in an easy way or do we have to purchase the german version of 5.5 and after that swap the product again (by destroying our german 5.5 and getting shipped the english version)?
    Thanks in advance,
    Stefan

    Hi,
    String user = null;
         try {
          user =
           WDClientUser
            .getCurrentUser()
            .getSAPUser()
            .getUniqueName();
         } catch (WDUMException e) {
          // fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), e);
    try{
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("user"+user);
    IUserFactory userfact = UMFactory.getUserFactory();
    IUserMaint userMaint = userfact.getMutableUser(user);
    userMaint.setLocale(Locale.FRENCH);
    userMaint.commit();
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("success");
    }catch(Exception e){
    Hope this code helps you.
    Cheers-
    Pramod

  • New browser window with javascript

    Hello,
    I'm trying to accomplish something similar to what has been
    discussed in other threads (Jess Learnin, 9/30/2008, and another
    thread from back in '07). I've tried the advice given in these
    threads and have had no luck. I would like to create a button to
    call a new browser window that displays a URL of my choosing. I'd
    like to specify the size and attributes of the new window. I've
    created a small dummy tutorial in order to work on this feature.
    I'm using the "Execute Javascript" option when configuring
    the button. I include the following javascript:
    window.open('
    http://lib.berkeley.edu/BIOS/index.html',
    'myWindow','height=400, width=700, toolbar=no');
    I have the Captivate button context set to "Current". I have
    deselected "Continue Playing Project" (though I've tried it with
    that option selected as well).
    I've tried prefacing the script w/
    "javascript:window.open...", but no luck.
    I'm testing the file on a development server, rather than
    from a local copy. When I test in Firefox, my movie simply stops
    when I click the button, without opening a new window or loading a
    web page. When I test in IE7, the movie stops and I get a message,
    "Error on page"; still no new window.
    I do notice that I'm currently running Flash Player 10. I'm
    using Captivate 3. When I publish my file, my options only go up to
    Flash Player 9, which is what I have chosen. I don't know if this
    would make a difference.
    I have also tried altering the standard.js file in the manner
    that jbradley88 suggested in the 9/30/08 thread, and using the
    corresponding javascript in the button properties window, with
    similar unsuccessful results.
    I have tried running the movie on a different computer, in
    case some local setting was somehow mucking things up. I get
    nothing.
    Any suggestions? If anyone's willing to take a look, I can
    send along my small dummy .cp file that I've been working on.
    Thanks in advance.
    -Kelly

    Hi John,
    Here's the exact javascript that I currently have associated
    with the button:
    void(window.open('
    http://lib.berkeley.edu/BIOS/index.html',
    'myWindow','height=400, width=700, toolbar=no'));
    I've tried multiple permutations, including placing
    "javascript:" in front of the script, both with and without the
    void().
    The message in IE7 just says "Error on page". It's not a
    pop-up message; it's just the small message that appears at the
    bottom left of the browser window in IE7 when a page fails to load
    properly. The message doesn't appear until I click on the button
    that's supposed to call the javascript. There's a yellow
    exclamation point icon that appears next to the "Error on page"
    message. When I click on that I get:
    "Problems with this Web page might prevent it from being
    displayed properly or functioning properly. In the future, you can
    display this message by double-clicking the warning icon displayed
    in the status bar."
    It also displays a pointer to the error:
    Line: 1
    Char: 111
    Error: Syntax error
    Code: 0
    URL:
    http://library11.berkeley.edu/bios/kelly/Practice_demo.htm
    I looked at the source for the page as displayed by IE7 (have
    also looked at the .htm and .js files generated by Captivate) and
    haven't seen anything obvious, but I'm somewhat unschooled in such
    matters.
    If it would help to see what it does, you can view the demo
    at the URL above.
    Thx again,
    Kelly

  • Change php variable with javascript??

    Hey Guys
    I need to know how can i send the form to a different email address if someone selects an option from the "BSU(area)" on the HTML from.
    So basically if the are on the html form and they select NewCastle from the "BSU(area)" for example i want the script to change the email address to the address assigned to that option.
    How can i achieve this? If you guys need to see my PHP script let me know.
    Help please!!
    Here's the link: http://flyingant.co.za/invite.html
    yours
    Ashveer

    Yes i agree with you.
    Here's my script tell me where i am going wrong?
    <?php
    // Build message.
    $my_email = "";
    global $my_email;
    function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}
    $message = build_message($_REQUEST);
    $message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."";
    $message = stripslashes($message);
    $subject = "Form To Email Comments";
    $headers = "From: " . $_REQUEST['Email'];
    mail($my_email,$subject,$message,$headers);
    ?>
    <?php
    function getValue($Result){
    //$Item = form.BSUarea.selectedIndex;
    $Item = $_POST["BSUarea"];
    //$Result = form.BSUarea.options[Item].text;
    $Result = $_POST["BSUarea"];
    switch ($Result) {
    case ($Result = "Gauteng"):
    //$Gauteng = "[email protected]";
    $my_email = "[email protected]";
    //$my_email = $Gauteng;
    break;
    /*case ($Result = CapeTown):
    CapeTown = "[email protected]";
    $my_email = CapeTown;
    break;
    case ($Result = Richards_Bay):
    Richards_Bay = "[email protected]";
    $my_email = Richards_Bay;
    break;
    case ($Result = Pinetown):
    Pinetown = "[email protected]";
    $my_email = Pinetown;
    break;
    case ($Result = Pietermaritzburg):
    Pietermaritzburg = "[email protected]";
    $my_email = Pietermaritzburg;
    break;
    case ($Result = NewCastle):
    New Castle = "[email protected]";
    $my_email = NewCastle;
    break;
    case ($Result = George):
    George = "[email protected]";
    $my_email = George;
    break;*/
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>BSU - Evite</title>
    </head>
    <body>
    <div class="main">
    <div class="content"></div>
    <form id="form1" name="myform" method="post" action="#build_message">
    <table width="525" border="0">
    <tr>
    <td width="270"><label><strong>BSU(area)</strong></label></td>
    <td width="10"> </td>
    <td width="240" align="left">
    <select name="BSUarea" id="BSUarea" onchange="getValue($Result)">
    <option value="Durban">Durban</option>
    <option value="Richards_Bay">Richards Bay</option>
    <option value="Gauteng">Gauteng</option>
    <option value="CapeTown">Cape Town</option>
    <option value="George">George</option>
    <option value="NewCastle" >NewCastle</option>
    <option value="Pietermaritzburg" >Pietermaritzburg</option>
    <option value="Pinetown">Pinetown</option>
    <option value="Polokwane">Polokwane</option>
    </select></td>
    </tr>
    <td width="270"></td>
    <td width="10"> </td>
    <td width="240"><label>
    <input type="reset" name="Reset" id="Reset" value="Reset" />
    <input type="submit" id="Submit" value="Submit" />
    </label></td>
    </tr>
    </table>
    </form>
    </div>
    </body>
    </html>

  • Change rtmfp groupspec with javascript

    hello
    is it possible to change dynamically the groupspec and play the new rtmfp group?
    test code
      var parameters =
                            {       src: "rtmfp://p2p.rtmfp.com/2924a8afa44eaff4aac318fe5b39248d277688d663c6dfb422e6e9663967d39b/"
                            ,       autoPlay: true
                            ,       groupspec: "G:0101010c040e6f747200"
                            ,       multicastStreamName: "stream"
                            ,       streamType: "live"
                            ,       streamName: "stream"
                            ,       controlBarAutoHide: false
                            ,   javascriptCallbackFunction: "onJavaScriptBridgeCreated"
                    // Embed the player SWF:
                    swfobject.embedSWF
                            ( "StrobeMediaPlayback.swf"
                            , "strobeMediaPlayback"
                            , 640
                            , 480
                            , "10.1.0"
                            , parameters
                            , { allowFullScreen: "true"}
                            , { name: "strobeMediaPlayback" }
    var player = null;
                    function onJavaScriptBridgeCreated(playerId)
                            if (player == null) {
                                    player = document.getElementById(playerId);
                                    document.getElementById("newchannelgroup").onclick = function(){
                                                   //HERE SET NEW groupspec and play the rtmfp
                                                    player.play2();

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Changing Global Spot with Javascript

    Hello,<br /><br />I'm trying to update a swatch (global, spot) that is linked to a path object, say, a rectangle.<br /><br />In Illustrator, if I double-click the swatch, change the CMYK values and click ok, the path object fill colour updates to the new swatch colour.<br /><br />I want to replicate this with script.<br /><br />So far I have written:<br /><br />if (app.documents.length > 0){<br />     var swatches = app.activeDocument.swatches;<br />     for(i=0;i<swatches.length;i++){<br />          var currSwatch = swatches[i];<br />          if(currSwatch.name == "Prim1"){<br />               var newColor = new CMYKColor();<br />               newColor.cyan = 35;<br />               newColor.magenta = 0;<br />               newColor.yellow = 50;<br />               newColor.black = 0;<br />               currSwatch.color = newColor;<br />          }<br />     }<br />}<br /><br />Which updates my swatch "Prim1" and changes the colour as it's supposed to.<br /><br />However.<br /><br />The link to the object is lost, and the swatch is no longer global. Basically, it updates the swatch, and not the object (that's bound to it by its original global setup).<br /><br />Am I missing a line that tells my swatch to keep its global property?

    Just in case you haven't gotten a reply<br /><br />Try<br /><br />if (app.documents.length > 0){<br />var swatches = app.activeDocument.spots;<br />for(i=0;i<swatches.length;i++){ var currSwatch = swatches[i]; if(currSwatch.name == "Prim1"){ var newColor = new CMYKColor(); newColor.cyan = 35; newColor.magenta = 0; newColor.yellow = 50; newColor.black = 0; currSwatch.color = newColor; } } }<br /><br />I would like to change the name also - Any ideas?<br /><br />Good Luck<br /><br />Nick

  • Closing browser window with Javascript

    In our Forms application, we have been using a line of Javascript in POST-FORM to close the browser window after the form is closed. After installing Windows XP SP2, this no longer works and my understanding is that putting the code in a standalone HTML file, and calling this file from POST-FORM will work.
    1. Where does this HTML file reside? My guess is
    {ORACLE_HOME}\forms90\server
    2. How is this script invoked? I guessed it would be
    WEB.SHOW_DOCUMENT('close.html').
    I'm clearly wrong, as this does not work!
    Many thanks in advance.

    You might also want to look at the following thread:
    Re: IE message "The web page you are viewing is trying...
    It refers to the addition of some JAVASCRIPT to your formsweb.cfg file which resolves the problem of the IE message "The web page you are viewing is trying..." from being displayed. It still may not work if you are running seperateFrame=True though, I have detailed the problem I'm experiencing in the associated thread.
    I'd be interested to hear if you can get round the display of the message if you are running in a separate frame.
    Richard

Maybe you are looking for