knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.7k stars 303 forks source link

Implement custom translation layer #673

Closed shalvah closed 1 year ago

shalvah commented 1 year ago

Translations should work correctly onLaravel 8,9 and 10 now.

To publish translations, run php artisan vendor:publish --tag="scribe-translations". This will create the file resources/lang/scribe.php (or lang/scribe.php).

This may be a bit of a minor breaking change to the previous translation system—they will be ignored. I would recommend deleting any previously published Scribe translations (the en.json file).

The new system is:

ccec1t91077 commented 1 year ago

I've tested localization branch in Laravel 8 and 10 clean project, works fine. :D

Testing process

  1. composer require --dev knuckleswtf/scribe:dev-localization
  2. php artisan vendor:publish --tag=scribe-config
  3. Setup .env
  4. php artisan scribe:generate
  5. Check docs
  6. php artisan vendor:publish --tag="scribe-translations"
  7. Modify lang/scribe.php
  8. php artisan scribe:generate
  9. Check docs

Extra

I've also tested on my current project in development, works fine, too.

shalvah commented 1 year ago

Nice, thanks!