We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How to change lang tag HTML? | Forum

Topic location: Forum home » Support » General Questions
Marcus
Marcus Nov 2 '16
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-ES" dir="ltr">

What PHP code can I use to modify this?

I would like to change
lang="es-ES" ???

I have a custom page so I wanna alter this

lang="es-ES" from the page PHP code?
ross Team
ross Nov 3 '16
What do you mean you want to change that? 

this attribute comes from the language selected on your site. 

Marcus
Marcus Nov 3 '16
Let me explain. My default language is ES. Now I have a PHP page that takes text from language keys.

My ES language key contains EN text but the problem is the source code has lang="es-ES" I wanna change it to lang="en-EN" from the page so that only that page will be affected! Is there a way to parse document from php page and simply change that value?

$Document=OW::getDocument();
echo $Document->language;

How to change lang though this?
The Forum post is edited by Marcus Nov 3 '16
dave Leader
dave Nov 3 '16
marcus... 


//this goes in the page constuct section

//or you can use the full bol name in your call below

$this->langservice = BOL_LanguageService::getInstance();



//this will get you the current language id number

$sitelangid = (int) OW::getSession()->get(BOL_LanguageService::LANG_ID_VAR_NAME);


//this will convert the lang id number to the language alpha name

$sitelang = $this->langservice->findById( $sitelangid );


hope that helps

The Forum post is edited by dave Nov 3 '16
Marcus
Marcus Nov 7 '16
Dave baby thanks so much. If I would have your mind I would do wonders ;)

Thanks buddy.
The Forum post is edited by Marcus Nov 7 '16