[Bug] Save and back with translations
See original GitHub issueBug report
Using https://backpackforlaravel.com/docs/4.1/crud-operation-update#translatable-models-and-multi-language-cruds I’ve found two issues editing a field:
- when you add a new record, language selector does’nt appear, you have to save a value then edit again
- when a field jus have one value for a language, button “Save and back” does’nt works well, save but not go back
Is it a bug in the latest version of Backpack? YES
After I run composer update backpack/crud
the bug… is it still there? YES
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
PHP VERSION:
PHP 7.4.25 (cli) (built: Oct 23 2021 18:05:05) ( NTS ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Zend OPcache v7.4.25, Copyright ©, by Zend Technologies with Xdebug v3.1.1, Copyright © 2002-2021, by Derick Rethans
LARAVEL VERSION:
v8.73.1@36dfae9d9ef7f88e8f9489c484a0a0609592bc21
BACKPACK VERSION:
4.1.60@bec5cfa11f0cd0712c79256748acf5850080c0ee
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Didn't we already fix this? Why you keep seeing the same ...
It is the database that remembers your project has been translated in the past, pairing your text with past results depending on how...
Read more >Save and Submit Translations - Smartling Help Center
Save in bulk: Click Save Page to save multiple translated strings at once. The bulk save functionality will save the strings for the...
Read more >Translations not saved · Issue #23033 · PrestaShop ... - GitHub
Go to 'International -> Translations'; Select any installed module translation and click edit; Input a translation, and click save; Return to ...
Read more >Error Save Translation? - Avaya: CM/Aura (Definity) - Tek-Tips
Check the software load against each other. Now you will run the command 'save trans'. This backs up what is in active memory...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve done it myself on my project. I’ll try to explain it as much as possible
This code goes into app\Models\Traits\HasTranslations.php
Add these two files into resources/views/vendor/backpack/crud/fields/
FILE: text_locale.blade.php
FILE: textarea_locale.blade.php
Now in your model that uses the HasTranslations trait change the trait to
Now in any CRUD controller you may use those new fields
Hope this helps
@blondie63 Thanks for the feedback, it’s nice to know it’s working. Very appreciated the feedback!
Cheers man 🍺