KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

No Language selector at the login page? #3364

Closed Eugene opened this topic on on Oct 25, 2024 - 15 comments

Eugene commented on Oct 25, 2024

Or Am I do anything wrong?

I added this to my App.php - some items was translated but no Language selector

protected function languages()
    {
        // Return list of available languages for your users
        return [
            EN::create(),
            ID::create(),
        ];
    }
Eugene commented on Oct 25, 2024

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)
KoolReport commented on Oct 28, 2024

Let me convey the case to dev.team.

Eugene commented on Oct 28, 2024

Ok. Thanks But please if it possible could you give me the working solution asap I cannot wait till the next update if you decide to change something in your login page.

Eugene commented on Nov 2, 2024

hi, no news?

honestly speaking my solution works - it changes the language but generate an error. I think it is not so difficult to avoid this issue - just tell me how...

KoolReport commented on Nov 4, 2024

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.

Eugene commented on Nov 4, 2024

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)
KoolReport commented on Nov 4, 2024

No it is not the login class that I mean, sorry for confusion, please look for vendor/koolreport/dashboard/pages/Login.php

Eugene commented on Nov 4, 2024

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

Eugene commented on Nov 6, 2024

any ideas?

KoolReport commented on Nov 6, 2024

I have passed the case to dev.team to replicate.

Eugene commented on Nov 24, 2024

hi, Koolreport, have you got any comments from your dev.team?

KoolReport commented on Nov 25, 2024

Our dev.team said that they will provide this feature in next version.

Eugene commented on Nov 25, 2024

oh.... may I ask about a temporary solution?

KoolReport commented on Nov 25, 2024

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.

Eugene commented on Nov 25, 2024

it works. thank you

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed
solved

Dashboard