Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines
I tried to play with Login.View.php file
But if I add something like this to the form
<button class='btn btn-link px-0'
type='button' onclick="KoolReport.dashboard.app.changeLanguage('ID')">ID
</button>
I get the error
Message: Could not handle your request
Line: 106
File: /public_html/vendor/koolreport/dashboard/Page.php
#0: /public_html/vendor/koolreport/dashboard/Page.php Line 90 : actionLost(null)
#1: /public_html/vendor/koolreport/dashboard/Application.php Line 361 : handle(null)
#2: /public_html/vendor/koolreport/dashboard/Application.php Line 270 : handle(null)
#3: /public_html/src/public/index.php Line 9 : run(null)
Yes, just add this function directly to Login.php
protected function actionRefreshPage($request, $response)
{
$response->updatePanel("Page",$this->view());
}
Problem: You are right that you call the changeLanguage(), it does the job of changing language. The issue lies in the way Login page is refreshing itself (which is missing here).
Let me know if it works.
Unfortunately no, it does not
I have updated this file
namespace koolreport\amazing\dashboard;
class Login extends Base
{
protected function actionRefreshPage($request, $response)
{
$response->updatePanel('Page', $this->view());
}
}
but get the same error (just lines number are different)
Message: Could not handle your request
Line: 116
File: /public_html/vendor/koolreport/dashboard/Page.php
Collapse
#0: /public_html/vendor/koolreport/dashboard/Page.php Line 100 : actionLost(null)
#1: /public_html/vendor/koolreport/dashboard/Application.php Line 380 : handle(null)
#2: /public_html/vendor/koolreport/dashboard/Application.php Line 289 : handle(null)
#3: /public_html/src/public/index.php Line 9 : run(null)
Thanks.
it works but a bit strange
initially the page is in English, when I change the language to ID - it happens from the first click
but when I try to return to English part of items change the language only after the second click:
the items that use $this->page()->...
like headerText()
, descriptionText()
and buttonText()
do not change the language after the first click
Temporary solution is to reset the text for those items in actionRefreshPage:
protected function actionRefreshPage($request, $response)
{
$this->headerText(Lang::t("Login"))
->descriptionText(Lang::t("Sign in to your account"))
->buttonText(Lang::t("Login"))
->failedText(Lang::t("Wrong username or password"));
$response->updatePanel("Page",$this->view());
}
Let us know if it works.
Let KoolReport help you to make great reports. It's free & open-source released under MIT license.
Download KoolReport View demo