Page 1 of 1

change the add page caption with two language project

Posted: Mon Jul 22, 2024 4:34 pm
by SOHIB

Hi,
i am using tow language in my project, when i use this code :

if (CurrentPageID()=="add")
 {
	$this->setTablePhrase("fees", "tblCaption", "اضافة رسوم");
}

it work fine but it work with arabic language
how i can add same line for english language


Re: change the add page caption with two language project

Posted: Mon Jul 22, 2024 4:41 pm
by arbei

You may check the CurrentLanguageID(), which is a global function.


Re: change the add page caption with two language project

Posted: Mon Jul 22, 2024 5:05 pm
by SOHIB

thanks for replay could you please write me the full code
where i can find the language ID?


Re: change the add page caption with two language project

Posted: Tue Jul 23, 2024 9:29 am
by mobhar

For example:

if (CurrentPageID() == "add") {
    if (CurrentLanguageID() != "en-US") { // assume you use English and Arabic languages
        $this->setTablePhrase("fees", "tblCaption", "اضافة رسوم");
    } else {
        $this->setTablePhrase("fees", "tblCaption", "Your Caption");
    }
}

Re: change the add page caption with two language project

Posted: Tue Jul 23, 2024 11:23 pm
by SOHIB

Thank you so much , it is clear and it is working properly