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

Version 4.21 has bug to translate #676

Closed
1 task done
medeiroz opened this issue May 30, 2023 · 10 comments
Closed
1 task done

Version 4.21 has bug to translate #676

medeiroz opened this issue May 30, 2023 · 10 comments
Labels
bug Something isn't working

Comments

@medeiroz
Copy link

Scribe version

4.21

PHP version

8.1

Framework

Laravel

Framework version

10.12.0

Scribe config

title => "MS.Indicacao Documenta\u00e7\u00e3o"
base_url => "http://localhost:8888"
type => "laravel"
auth.enabled => true
auth.default => true

What happened?

I ran php artisan scribe:genrate the error "Translation not found for $key. You can add a translation for this in your lang/scribe.php, but this is likely a problem with the package. Please open an issue." is shown

I rollback to 4.20 and it worked as expected

Docs

@medeiroz medeiroz added bug Something isn't working triage labels May 30, 2023
@brecht-vermeersch
Copy link

We have the same issue

@shalvah
Copy link
Contributor

shalvah commented May 30, 2023

Do you use custom views or something? Did you publish the previous translation files? Also see the changelog https://github.com/knuckleswtf/scribe/blob/master/CHANGELOG.md#4210-29-may-2023 and the docs on localisation https://scribe.knuckles.wtf/laravel/advanced/localization

@shalvah
Copy link
Contributor

shalvah commented May 30, 2023

Also, can you share the exact exception that was thrown? This isn't the actual message.

@ccec1t91077
Copy link
Contributor

ccec1t91077 commented May 31, 2023

I did some trace, it might be a environment issue.

The $this->app->runningInConsole() here will return false in some case, and it will trying to use default loader instead of the CustomTranslationsLoader, then the error will thrown by this line.

@shalvah
Copy link
Contributor

shalvah commented May 31, 2023

Hmm, interesting. Are you using Laravel Octane? How are you running the generate command?

@shalvah shalvah removed the triage label May 31, 2023
@shalvah
Copy link
Contributor

shalvah commented May 31, 2023

Okay, I think I've found a fix. Can you guys try with the master branch now? composer require --dev knuckleswtf/scribe:dev-master should be enough.

@JonPurvis
Copy link

Also had the same issue, rolled back to 4.20 for now. Definitely an environment thing though as it worked fine in dev but only errored during our production deployment.

@bmbBAMBUS
Copy link

I had the same issue, I can cofirm that dev-master works.

@shalvah
Copy link
Contributor

shalvah commented Jun 3, 2023

Fixed in 4.21.1

@shalvah shalvah closed this as completed Jun 3, 2023
@JonPurvis
Copy link

Thanks @shalvah 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants