Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaravelGettext::setLocale() not working #57

Open
andrew26031990 opened this issue Mar 28, 2022 · 0 comments
Open

LaravelGettext::setLocale() not working #57

andrew26031990 opened this issue Mar 28, 2022 · 0 comments

Comments

@andrew26031990
Copy link

LaravelGettext::setLocale() not working properly. During executing this code in runtime, an error appeared.
Details:
Error: Using $this when not in object context in file C:\OpenServer\domains\bla-bla\vendor\zerospam\laravel-gettext\src\Xinax\LaravelGettext\LaravelGettext.php on line 68
` * @return string
*/
public function getLocale()
{
return $this->translator->getLocale();
}

/**
 * Set current locale
 *
 * @param string $locale
 * @return $this
 * @throws Exceptions\LocaleNotSupportedException
 * @throws \Exception
 */
public function setLocale($locale)
{
    **if ($locale != $this->getLocale()) {**
        $this->translator->setLocale($locale);
    }

    return $this;
}`

Please give me an answer.
Laravel version 8.65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant