Code Monkey home page Code Monkey logo

laravel-vue-translation's People

Contributors

abdulrafayets avatar angryalf avatar belguinan avatar mrimran avatar mvd81 avatar tohidplus avatar tohidspeakap avatar webcraft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

laravel-vue-translation's Issues

require is not defined

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'};

RuntimeException php artisan VueTranslation:generate --watch=1

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()

Want to return string instead of key

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 ?

Cannot read permission denied exception.

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

When using json translation files, keys containing '.' character are not loaded properly

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.