Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:08:35+00:00 2026-06-04T11:08:35+00:00

I am working on a HTML5 app which uses PhoneGap and Backbone JS. Problem

  • 0

I am working on a HTML5 app which uses PhoneGap and Backbone JS.

Problem is that Language changed on Android device through settings doesn’t get in my HTML 5 app, though i can see it getting changed in independent Browser instance.

To support globalization of the app I am using i18n plugin to select current language for the app. My app works just fine with iOS. However when i try this on Android, language selected by user doesn’t get reflected For example if i choose french as my language from system setting and try to see what is the value of window.navigator.language it remains en as oppose to fr, this gets reflected perfectly on iOS. Just for your information ,as recommended by PhoneGap, on Android I am calling

`public class myApp extends DroidGap {
    private String pageURl = "somepath";
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.loadUrl(pageUrl); // this will load my app's main html page.
    }
}`

Could somebody please help me in figuring out what the problem is?

Thanks
Big O

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:08:37+00:00Added an answer on June 4, 2026 at 11:08 am

    Try fetching language from user agent string with following patch, it should work:

        var lang;
        if (navigator
                && navigator.userAgent
                && (lang = navigator.userAgent
                        .match(/android.*\W(\w\w)-(\w\w)\W/i))) {
            lang = lang[1];
        }
    
        if (!lang && navigator) {
            if (navigator.language) {
                lang = navigator.language;
            } else if (navigator.browserLanguage) {
                lang = navigator.browserLanguage;
            } else if (navigator.systemLanguage) {
                lang = navigator.systemLanguage;
            } else if (navigator.userLanguage) {
                lang = navigator.userLanguage;
            }
            lang = lang.substr(0, 2);
        }
    
        console.log("current language is", lang);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I used to have a small chat app(which was almost working), that uses PHP,
I'm working on an app that uses a jQuery UI plugin, which in turn
I am working on an Android app that uses the gdata-java-client to download documents
I'm working with a PhoneGap app that uses Safari local storage (SQlite DB) via
Background: I'm working on a single page web app that loads everything through AJAX
I am working on an android app which links to facebook (using the following
We are currently working on the finishing touches of an application which uses Phonegap
I'm working on a small app that uses and xml file to print an
I'm working on an offline html5 app which does a lot of DOM manipulation
Hello all I am working in javascript and html5.I want to ask that how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.