jasonc Posted November 22, 2011 Share Posted November 22, 2011 According to woorank.com my page shows the following. Language Declared: Missing Detected: en I have used header('content-type: text/html; charset=utf-8'); but do not know how I declare the language. also how do i specify Language/character encoding how is this done ? Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/ Share on other sites More sharing options...
thaiwolf Posted November 22, 2011 Share Posted November 22, 2011 maybe that helps you? $lang=0; //default ger if(substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)<>'de')$lang=1; if(substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2)=='th')$lang=2; I use for switching my homepage to ger/eng/thai if no user defined Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290337 Share on other sites More sharing options...
jasonc Posted November 22, 2011 Author Share Posted November 22, 2011 sorry I mean actually delcaring that the page is 'en' like i use header('content-type: text/html; charset=utf-8'); to declare that the page's character set is 'utf-8' how do I declare that the page is 'british' or 'en' ? Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290339 Share on other sites More sharing options...
thaiwolf Posted November 22, 2011 Share Posted November 22, 2011 sorry, have to ask again: If you declare your charset e.g. UTF-8-> that is effectiv onyour outputs. If you declare 'british' or 'en', what should it effect on your following php/html-code? Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290350 Share on other sites More sharing options...
jasonc Posted November 22, 2011 Author Share Posted November 22, 2011 I was wanting to have the page fully HTML5 but using the meta method I get errors validating the page stating that they are not supported! Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290355 Share on other sites More sharing options...
thaiwolf Posted November 22, 2011 Share Posted November 22, 2011 <meta http-equiv="content-language" content="en"> should work... Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290357 Share on other sites More sharing options...
jasonc Posted November 22, 2011 Author Share Posted November 22, 2011 but when I validate using w3.org I get this error Line 54, Column 35: Bad value language for attribute name on element meta: Keyword language is not registered. <meta name="language" content="en"> Quote Link to comment https://forums.phpfreaks.com/topic/251601-how-do-i-declare-language-for-my-page/#findComment-1290369 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.