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

  • Home
  • SEARCH
  • 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 7405865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:28:08+00:00 2026-05-29T05:28:08+00:00

I am making a page which pulls from the user’s browser their preferred language,

  • 0

I am making a page which pulls from the user’s browser their preferred language, via the Request.UserLanguages….which returns a two letter code (ex. “en”) or detailed code (ex. “en-GB”) .

I basically get the string of user languages (they are in order of preference) and store them in a string array. Then I use a loop to check if the language code in the first position of the string array is any of the codes for a certain language (another string array hard coded in).

Is there a better way to do this? I’m noticing increased load time and am worried additional languages will further slow the page load…

 if (!IsPostBack)

    {   //Holds possible user languages preferences to check client machine against
        String[] compJapaneseLang = { "ja-jp","ja","jp","jpn","euc","shift-jis" };
    }

 //Get client machines langugage preferences                
        String[] userLang = Request.UserLanguages;

//Loop through variation of preferences from possible user langugaes

        for (int i = 0; i < compJapaneseLang.Length; i++)
        { 
                //IF JAPANESE
            if (userLang.GetValue(0).ToString().ToLowerInvariant().Equals(compJapaneseLang.GetValue(i).ToString().ToLowerInvariant()))


                cc.JapeneseObject();
        }

Thanks!

  • 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-05-29T05:28:09+00:00Added an answer on May 29, 2026 at 5:28 am

    Storing them in a list turned out best, not really much else one can do….

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a web page which create user and a page from which
I'm making a page which has some interaction provided by javascript. Just as an
I'm making a page where the user upload a file. I want an if
I am making a web page which will allow users to input and view
I am making a static site which is 'forced' to be cached via Cache-control
I'making website which is for all desktop/iPad/iPhone. In one page I have header and
I have a page in which I have a div. The content from that
I'm making a web page in which I have a list of products, along
I have a form on my index.html page which makes a POST request to
I'm working with PHP, and I'm making an action page which a form posts

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.