We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would be nice to manage string translations in database with this package instead of using json files. https://laravel.com/docs/5.7/localization#using-translation-strings-as-keys
Translations with group and item column feels very weird.
The text was updated successfully, but these errors were encountered:
Hey I don't know if it can help you but I managed to translate directly the strings by creating the following helper :
<?php use \Waavi\Translation\Models\Translation; function translate($string, $params = []){ try{ $translation = Translation::where('item', $string)->where('locale', App::getLocale())->first()->text; foreach($params as $key => $value){ $translation = str_replace(':'.$key, $value, $translation); } }catch(\Exception $e){ return '"'.$string.'"'." has no translation"; } return $translation; } function reverseTranslate($string){ return Translation::where('text', $string)->first()->item; } ?>
Then you only need to create a service provider like this :
... public function register(){ require_once app_path('Helpers/TranslationHelper.php'); }
And you can use it in every view / controller!
Sorry, something went wrong.
No branches or pull requests
Would be nice to manage string translations in database with this package instead of using json files.
https://laravel.com/docs/5.7/localization#using-translation-strings-as-keys
Translations with group and item column feels very weird.
The text was updated successfully, but these errors were encountered: