scribe: Missing Translation after Update

Scribe version

4.19.0

PHP version

8.1

Framework and version

9.52.7

Scribe config

auth.enabled => true
auth.default => true

What happened?

The Translation is broken after update in all my sites. Also local in dev.

This is shown as link and as Header

scribe::headers.introduction scribe::base_url: http://localhost

or like this

sribe::endpoint.request scribe::try_it_out.open
POST api/login

I delete .scribe folder and public docs folder. Clear cache and generate new but the same.

Docs

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 25 (12 by maintainers)

Most upvoted comments

Here’s what I believe is the root cause, after some experimentation.

The default scribe lang file is published to: resources/lang/vendor/scribe/en.json

However, during scribe:generate, translations are being looked for in resources/lang/en.json instead of resources/lang/vendor/scribe/en.json.

When manually copying resources/lang/vendor/scribe/en.json to resources/lang/en.json, everything works.

Related: the documentation at https://scribe.knuckles.wtf/laravel/advanced/localization incorrectly states otherwise:

You can publish Scribe’s default translations using php artisan vendor:publish --tag=scribe-translations. This will create a lang/en.json (or resources/lang/en.json) file in your project.

Does this give you enough of a hint as to how to resolve it? I’m guessing the high level solution is to ensure that the path to the lang file is consistently prefixed with vendor/scribe/.

UPDATE: providing my details as requested.

  1. What Laravel version are you on? 10.9.0
  2. What is your app locale and fallback locale? en
  3. Do you have any translation files in your app for your current locale? (either in lang or resources/lang). Where are they located (including file name)? None, other than those the framework published (resources/lang/en/(auth|pagination|passwords|validation).php)
  4. Do you have any translation files in your app for en? Where are they located (including file name)? No translations for the app.
  5. Did you publish the scribe-translations file? If so, where is it located? (In Laravel 10, it’s in lang/vendor/scribe, in earlier versions, it’s in resources/lang. Please confirm.) Originally did not publish any scribe translations at all, but published it for the purpose of testing this. Ended up in resources/lang/vendor/scribe.