Solution to get the locale of the browser

I believe that other people will have the same problem as mine.
So I'll post the solution to get the browser's locale.
First:
/ / Get the full URL
var test: String = ExternalInterface.call (window.location.toString ");
Second:
if (teste.indexOf ("locale = pt")!=- 1) (
    return 'pt_BR';
) Else if (teste.indexOf ("locale = en")!=- 1) (
    return 'en_US;
That is all
Good weekend to all

Depends a lot exactly what locale you need.
window.location is good if you pass a locale as part of the URL. But that is not the browser locale (although it might come from the browser if someone got it from the browser there at some point and added it to the URL)
The locale that is most locale for the user is the one that he specified in the browser preferences
(http://www.w3.org/International/questions/qa-lang-priorities)
That info is part of the HTTP request header (HTTP Accept-Language).
And that is only accessible server side. So you will need something that runs server side (JSP, ASP, PHP, CGI, whatever) and to return it somehow (for instance somewere in the html page).
Here is a quick reference on how to do that: http://www.developershome.com/wap/detection/detection.asp?page=readHeader
Regards,
Mihai

Similar Messages

  • Is there a way for java plug-in to get the browser login authentication

    I have an applet that is loaded from a password protected html page. I use java plug-in with the applet.
    When I try to read this page I get the browser window asking for password and username. So far so good.
    Then I log in successfully and starts using the applet.
    If the applet wants to access pages on the same PW protected area, I have to give the plug-in PW and UN.
    My question is then:
    Is there a way that java plug-in can get hold of the login information that the browser has obtained? (So that I wont have to give the same information twice)
    I thought the answer would be no, but then I started experimenting with https and found out that if I use the same scenario as above, except from that I give a certificate to the browser before the first login, then the plug-in will get certificate info from the browser, and it wont promt me for UN and PW either!
    When it is possible for the plug-in to obtain certificate info and login info from the browser then it should be possible just to get the login info with ordinarily http?

    bump

  • My Windows 7 gadgets are on top of the browser since I've upgraded to Firefox 4. How do I get the browser on top?

    My Windows 7 gadgets are on top of the browser since I've upgraded to Firefox 4. How do I get the browser on top?

    Glad to have helped.

  • After app update the app icon is gone.cant open it anymore.no possibility to connect to iTunes on laptop.is there another solution to get the app open again.cuz it's a office app and I need it.

    After app update the app icon is gone.cant open it anymore.no possibility to connect to iTunes on laptop.is there another solution to get the app open again.cuz it's a office app and I need it.

    Try a reset or restart.
    If the app is still missing, download again via iTunes or connect to the computer and sync it back from iTunes on the computer.
    Frankly, in the time it took to sign up and post here the app could have already been re synced from iTunes on the computer.

  • I have LINUX and I cannot seem to get the browser to download on the computer, I have extracted the files from the download & then all I get is a folder

    The browser I have for Linux is SeaMonkey or some other annoying thing and I wanted FF because it actually has compatible add-ons but I cannot seem to get the browser to actually run on the computer. I click the download button and get the files but once I extract them nothing happens. I extracted them to the desktop, perhaps there is somewhere else in this system that they need to go to make them work?

    Ok...I should have also mentioned that I absolutely hate having Linux b/c I have no idea how to use it. If u could explain that in simpler terms I'd appreciate it.
    Also, I was able to get the browser to open once but then when I dragged the icon from the folder on the desktop & tried opening it [I wanted to make it a sort of desktop icon] it stopped working...
    EDIT: Ok so I re-extracted the downloaded file & clicked on the icon that said Firefox & I got the browser. My problem now it seems is the fact that I do not have a desktop shortcut, how would I go about making that happen?

  • How to Upgrade solution to get the newly added feature

    Hello,
    I have a scenario like following:-
    1. Have a solution deployed already
    2. Solution have a feature which creates a list on activating and deletes the list on deactivation.
    3. Now modified the exsisting solution as the list should not be deleted.
    4. Feature will create the list if the list not exists only.
    5. Added some others features.
    Now I need to update the new .wsp but it does not reflect the latest added features untill I retract the old one and deploy the new one. If I retract the old one, it deletes the existing list(point#2) which I dont want as the list has lots of data.
    So what should be the proceedure by which I can update the latest wsp and get the newly added feature without deleting the exsisting list?
    Thanks in advance.

    You can use the Update-SPSolution command first:
    Update-SPSolution [-Identity] <SPSolutionPipeBind> -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-CASPolicies <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-FullTrustBinDeployment <SwitchParameter>] [-GACDeployment <SwitchParameter>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]
    This will deploy your new DLL to the SharePoint environment. After that, retract, remove, add and install the solution to make the new features available.
    Alain de Klerk
    Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • DUH! I need help getting the browser setup on BB 8130 Pearl

    Just got it yesterday, have mastered calendar address book and email....
    but I CANNOT figure out how/where to enter a web address to get started.
    I do have Verizon's VZ Access Manager..But no ability to do it on the handheld that I can find....HELP!
    Solved!
    Go to Solution.

    When you go into the browser, hit the menu button, and choose Go To. Should allow you type in a web address
    If someone has been helpful please consider giving them kudos by clicking the star to the left of their post.
    Remember to resolve your thread by clicking Accepted Solution.

  • Can't Get the Browser to Install

    Hi-
    I am not sure if this is the place to ask this but since I am in a bind I wil try it. I need Firefox browser instead of using Safari for an online course I am teaching. Since I figured installing Firefox would not cause problems I was not prepared to encounter problems. the platform called BlackBoard suggests the instructors install and use Firefox.
    I have downloaded the browser several times and each time I have tried to follow the steps for installing it but it will not "take." The HelpDesk at the university opens at noon and my class starts in 2 hours.
    I can imagine this this is not the place Apple suggests I come but I have no choice. I am hoping someone who can sympathize with my neglect of being prepared will spark the time they were not prepared and maybe know what it is I am not doing.
    I tried the forum but there were just a few people in the forum at this hour and i got no responses. it downloads fine, I drag the application to the HD and drop it there, right? After that I thought it would install but it won't. I get no errors just the same logo and application I dropped into the HD, which actually comes up in another window and tells me to drop it where I want it installed. The HD is the only option I think for me.
    thanks a lot if you can hep me out. even if you don't know what I am not doing o doing wrong--thanks for trying. I appreciate any advice or help I can get.
    cheers.

    If I may try to clarify the excellent advice posted thus far. After the download, there should be a .dmg or .pkg on your desktop. Find the FireFox.app. You'll probably have to minimize the window with the .app and then open Finder. Then open the window again (with the .app) and drag the FF.app to your Applications folder. Trash the .pkg and .dmg. Open your Applications folder and dbl click the Firefox.app. HTH!

  • How do I get the browser to allow Office programs to open files?

    I have created a .JSP/servlet index of documents on a server. Basically, the JSP displays a list of all the documents in a directory with a summary of each and a link out to the right...like this:
    <b>reference document<b> open
    Word documents and PDF files open fine b/c they open in the new browser window, however, most other documents such as .XLS, .ZIP, and .PPT all return gibberish to the browser window. Obviously, I would prefer that the browser allow the associated program on the user's PC to open the file but I have no idea how to do that effectively...especially since I am dealing with a variety of filetypes??
    Can someone tell me what the best way would be to manage this problem given that it could be any number of file types??
    any help is greatly appreciated!
    Thanks,
    Chuck

    I have gotten closer...I can get the application to open with the below code using response.setHeader() as follows but the file is not opened:
    <%
    String filename = request.getParameter("filename");
    out.print(filename);
    String format = ".PPT";
    if ((format != null) && (format.equals(".PPT"))) {
    response.setHeader("Content-Type","application/ms-powerpoint");
    response.setHeader("Content-Disposition", "attachment;");
    response.setHeader("Content-Disposition", "filename=".concat("test.ppt"));
    %>
    So, I am close...I was hoping someone could explain how to get the file to open in the application...right now all that happens is the app. opens but no content is diplayed.
    Do I also have to do something like FileOutputStream with the file? can somebody possibly provide an example?
    thanks again,
    Chuck

  • Formula or solution to get the range between numbers in on column (KF)

    Hello All,
    I am in need of a solution (formula) to get the range of numbers in one column of query results.
    I have a variable number of sales orders and three keyfigures that show the number of days between when the order was received and when the customer received the order.
    I need to get the range of days from each keyfigure column
    ex.
    Sales Order          Days-Order to Box   Days-Order to Release   Days-Release to Box
    SO 11111                       10                                   2                                 8
    SO 11111                       13                                   5                                 8
    SO 11111                       12                                   2                                10
    SO 11111                       16                                   4                                12
    The range for the  Days-Order to Box   Days-Order to Release   Days-Release to Box
                                             6                                     3                                 4
    I have tried using formulas for Min and Max setting the Calculations tab for both Results and Singles Values
    than creating a formula using SUMCT, SUMRT and SUMGT but I get the red X for results.  I have used NOERR(x) and NODIV(x)
    to determine that the formula is seen as having undefined calculations or errors in the logic (I do not get errors when saving the query).
    NOERR(SUMRT (OtB-Max - OtB-Min))
    OtB-Max is a formula that hides the singles values and displays the results as the Maximum number in the column Days-Order to Box
    OtB-Min is the same kind of formula but it displays the Minimum number for the same column.
    Thanks in advance for any suggestions.
    Btw - I have searched this forum and the How-To forum for BI on the SAP site without finding an answer -
    If I have missed one in my search I apologize and would appreciate a link to it

    Hi.
    As I think only use of virtual KF and APA code will help you.
    Regards.

  • When I have the downloads window open and I close the browser window, how can I get the browser to open the homepage the next time I start it while the download window is still open?

    When I have the downloads window open and I close the browser window, the next time I reopen the browser while the downloads are still going, it returns me to the last page I was on. All previous versions of Firefox would return me to my homepage which I would prefer. Please let me know if this is possible.

    When you re-open Firefox and choose Restore Session, by default it picks up your most-recently-open window, and the other windows should then show up in Recently Closed Windows.
    The Firefox add-on Session Manager lets you manage how many closed windows and closed tabs are saved, in case it's not enough.

  • How do you get the browser to work offline. It stays connected even if you click on Work Offline option and there is a check mark beside it.

    I play an online game which requires me to open and set up several tabs, click on them offline, and then reload all tabs. With this new update, the work offline button does not work. I click on it 'Work Offline', a checkmark appears before the option. But when I click on the confirm button on the tab, it does not show the usual message that I am offline and I should try again after going online.
    I also do a lot of offline reading, which was possible with the previous Firefox versions. I'd load them while I was online, then I could read them when I was offline. Now I can't do this.
    I am not happy with this new version of FF. Is there a way to revert to the old Firefox?

    Does the Live Http Headers extension confirm that there is network traffic?
    *https://addons.mozilla.org/firefox/addon/live-http-headers/
    I notice that you are likely infected by Conduit software (malware) looking a the browser.newtab.url pref in the System Details list.
    Your System Details list shows that you have a user.js file in the profile folder to initialize prefs each time Firefox starts.
    The user.js file is only present if you or other software has created this file and normally it wouldn't be there.
    You can check its content with a plain text editor (right-click: Open with) if you didn't create this file yourself.
    The user.js file is read each time Firefox is started and initializes preferences to the value specified in this file, so preferences set via user.js can only be changed temporarily for the current session.
    *http://kb.mozillazine.org/Preferences_not_saved
    You can also check in "Windows Control Panel > Programs" for recently installed programs to see if anything from Conduit.
    *Control Panel > Programs > Programs and Features > Uninstall or change a program
    *Click the Installed column to sort by this heading

  • I tried to install inspiration browser to uninstall how do I get the browser

    I went to control panel to uninstall Inspiration Browser.  It did not appear in the list how to I get inspiration browser?

    Hi jaguar2420,
    Inspiration browser gave many problems, that's why Adobe dropped it in PSE11.
    I will recommend you to use tv.adobe.com, which has almost all the video tutorials you will find through inspiration browser.
    -Rahul

  • How do I get the browser windows at the top to come back

    how do i get thge browser windows at the top to come back

    How to get all the iWork apps, iPhoto, and iMovie for free on an eligible iPhone or iPad
    http://www.imore.com/how-get-all-iwork-apps-iphoto-and-imovie-free-eligible-ipho ne-or-ipad
     Cheers, Tom

  • Since upgrading to Firefox 5.0, the screen freezes & have to force quit in order to get the browser to work. This happens every time I try to use it.

    Every time I open Firefox, within several minutes, the screen freezes, and the only way I can make it work is to force quit.
    This works for awhile, and then I go through the whole thing
    again.

    c uses the same profile folder as the Windows and Linux platform.
    You can locate the Firefox Profile Folder via
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    * http://kb.mozillazine.org/Profile_folder_-_Firefox
    Copy and Paste this code in the Code field in the <i>"Tools > Error Console"</i> and click the <i>Evaluate</i> button to see the location of the profile folder.
    <pre><nowiki>alert(Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("ProfD", Components.interfaces.nsIFile).path);
    </nowiki></pre>

Maybe you are looking for