0

I'm working on a windows 8 application and during my application i want to load a different CSS file based on the language of the Windows . for example if the default language for the user is En i load a CSS file and if it is Ar i load a different one , how can i do that ?!

1
  • I think you mean the default language of the web broswer, correct? You are not going to be able to access information about the os in an HTML page. Commented Sep 27, 2012 at 13:56

2 Answers 2

1

I believe Windows8 app still have a <head> right? Then you can use javascript to add css to the head.

var h=document.getElementsByTagName('head')[0]; var l = document.createElement("link"); l.setAttribute("rel", "stylesheet"); l.setAttribute("type", "text/css"); l.setAttribute("href", filename); h.appendChild(l); 
Sign up to request clarification or add additional context in comments.

Comments

1

if you want to check the default langauge for the browser ,

var l_lang; if (navigator.userLanguage) // Explorer l_lang = navigator.userLanguage; else if (navigator.language) // FF l_lang = navigator.language; alert(l_lang); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.