tohidplus / laravel-vue-translation Goto Github PK
View Code? Open in Web Editor NEWA package to have laravel translation in VueJS
License: MIT License
A package to have laravel translation in VueJS
License: MIT License
Receiving this error.
RuntimeException
Cannot read the file "/home/mrlinnth/www/laravel/resources/lang": permission denied (The web server user cannot read files, chmod needed)
at vendor/elementaryframework/fire-fs/src/FireFS/FireFS.php:413
409▕ $msg = "Cannot {$action} the file \"{$path}\": permission denied";
410▕ if (!$this->isRemote($path)) {
411▕ $msg .= " (The web server user cannot {$action} files, chmod needed)";
412▕ }
➜ 413▕ return new \RuntimeException($msg);
414▕ }
415▕
416▕ /**
417▕ * Write in the file
+20 vendor frames
21 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Fixed it by changing ->setPath('./resources/lang')
to ->setPath('../resources/lang')
in src/Console/Commands/Translation.php
.
Sorry. Forgot to mention my environment.
"laravel/framework": "^8.12",
"tohidplus/laravel-vue-translation": "^2.0"
Linux Mint 20
php 7.4
Hi,
If the key is present only in one language say ar and same key is not in en file then on en version its showing key like message.foo.bar i want it if key is not there on english version then display actual string. can you help me with that ?
If I understand correctly, it is currently possible to pack multiple keys in one key, by using '.' as a separator (i could not find any traces of such packing being done in the code, and this does not occur in original Laravel translation, so i am guessing that this is some custom scheme).
These are then unpacked in Translation.js by using
key.split('.')
Unfortunately, when using json files the keys are full sentences, that can contain different characters, including '.' character, just like in the example from Laravel docs:
{ "I love programming.": "Me encanta programar." }
Unpacking by using split('.') causes the '.' to be removed from key and as a result calling translate("I love programming.")
will fail to load value from json translation string, as the loaded key is now I love programming
instead of I love programming.
Easiest solution would be to use different character as key separator and including information about it in the docs.
How can i solve this issue?
I updated the laravel project and run the below command after that i am receiving below error.
Command
php artisan VueTranslation:generate --watch=1
Error
RuntimeException
Cannot read the file "/home/test/public_html/resources/lang": permission denied (The web server user cannot read files, chmod needed)
at vendor/elementaryframework/fire-fs/src/FireFS/FireFS.php:413
409| $msg = "Cannot {$action} the file \"{$path}\": permission denied";
410| if (!$this->isRemote($path)) {
411| $msg .= " (The web server user cannot {$action} files, chmod needed)";
412| }
> 413| return new \RuntimeException($msg);
414| }
415|
416| /**
417| * Write in the file
+21 vendor frames
22 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Whoops\Exception\ErrorException
PHP Startup: Unable to load dynamic library 'imagick.so' (tried: /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so (libMagickWand.so.5: cannot open shared object file: No such file or directory), /opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so (/opt/cpanel/ea-php73/root/usr/lib64/php/modules/imagick.so.so: cannot open shared object file: No such file or directory))
at Unknown:0
1|
+1 vendor frames
2 [internal]:0
Whoops\Run::handleShutdown()
Is support in Vue 3?
I'm running the app and when i go to the route where my vue application is generated, it throws this error.
I was able to solve the problme by changing from "require" to import.
And so, my code in the app.js turned out like:
import translation from './VueTranslation/Translation';
window.translate=translation.translate;
And on the VueTranslation/Translation.js:
import translations from './translations' assert {type: 'json'};
Hi!
how about fallback_locale for?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.