Code Monkey home page Code Monkey logo

laravel-auto-translate's People

Contributors

aerjotl avatar ben182 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  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  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  avatar  avatar  avatar  avatar

laravel-auto-translate's Issues

Adding support for laravel 8 (with install instruction)

because this package never updated since 2019 so i decided to fork this repo and laravel-langman (the package that this package depends on) and make it support laravel 8 (i've tested laravel 9 but no luck).

you can install it from my repo with the following way:

  1. edit your composer.json
...
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/AbidKhairyAK/laravel-auto-translate"
        },
        {
            "type": "vcs",
            "url": "https://github.com/AbidKhairyAK/laravel-langman"
        }
    ],
...
    "require": {
        ...
        "themsaid/laravel-langman": "dev-master",
        "ben182/laravel-auto-translate": "dev-master",
        ...
    }
...
  1. run composer update on your terminal
composer update
  1. follow the rest instruction in the README.md

Configuration not working

Thanks for this fantastic tool.

The only detail I can see is that the default language can be indicated in the configuration, in my case: "es", but the "messages" file is always written in the "en" folder.

ErrorException `503 Service Unavailable` : Server error: `POST https://translate.google.com/translate_a/s

First, thanks in advance for sharing this very useful package!.

I tried the package and receive:

| => php artisan autotrans:missing

   ErrorException  : Server error: `POST https://translate.google.com/translate_a/single?client=t&hl=en&dt=t&dt=bd&dt=at&dt=ex&dt=ld&dt=md&dt=qca&dt=rw&dt=rm&dt=ss&sl=en&tl=de&ie=UTF-8&oe=UTF-8&multires=1&otf=0&pc=1&trs=1&ssel=0&tsel=0&kc=1&tk=319219.191885` resulted in a `503 Service Unavailable` response:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="content-type" content="te (truncated...)


  at /Applications/MAMP/htdocs/domain/vendor/stichoza/google-translate-php/src/GoogleTranslate.php:312
    308|                     'query' => $queryUrl,
    309|                     'body'  => $queryBodyEncoded,
    310|                 ] + $this->options);
    311|         } catch (RequestException $e) {
  > 312|             throw new ErrorException($e->getMessage());
    313|         }
    314| 
    315|         $body = $response->getBody(); // Get response body
    316| 

  Exception trace:

  1   Stichoza\GoogleTranslate\GoogleTranslate::getResponse("Activate")
      /Applications/MAMP/htdocs/domain/vendor/stichoza/google-translate-php/src/GoogleTranslate.php:223

  2   Stichoza\GoogleTranslate\GoogleTranslate::translate("Activate")
      /Applications/MAMP/htdocs/domain/vendor/ben182/laravel-auto-translate/src/Translators/SimpleGoogleTranslator.php:32

I dont know if Im missing any setup, like API personal key or similar. any help appreciated.

Missing Short Codes?

   Symfony\Component\Debug\Exception\FatalThrowableError  : Return value of Stichoza\GoogleTranslate\GoogleTranslate::translate() must be of the type string, null returned

  at /var/www/html/vendor/stichoza/google-translate-php/src/GoogleTranslate.php: 235
  231:         }
  232: 
  233:         // Check if translation exists
  234:         if (!isset($responseArray[0]) || empty($responseArray[0])) {
  235:             return null;
  236:         }
  237: 
  238:         // Detect languages
  239:         $detectedLanguages = [];
  240: 

  Exception trace:

  1   Stichoza\GoogleTranslate\GoogleTranslate::translate("About")
      /var/www/html/vendor/ben182/laravel-auto-translate/src/Translators/SimpleGoogleTranslator.php : 32

  2   Ben182\AutoTranslate\Translators\SimpleGoogleTranslator::translate("About")
      /var/www/html/vendor/ben182/laravel-auto-translate/src/AutoTranslate.php : 65

  Please use the argument -v to see more details.
    'target_language' => ['ar', 'bg', 'bn', 'cn', 'cs', 'da', 'de', 'en', 'es', 'et', 'ir', 'fr', 'gr', 'it', 'nl', 'pl', 'pt', 'br', 'ro', 'ru', 'tr', 'tw'],

It appears to have failed php artisan autotrans:all at ro with the error above.

However ro is correct for Romanian

json file translations?

Hi,

Love this package, works great, thank you!

Do you plan to add support for Translation Strings (json) files as well as the Translation Strings

Thanks, James

No support for parameters or translation strings as keys

I'm aware that this project hasn't had work done on it for some time.

For other people thinking of evaluating this module, they should be aware that if they do get it working with later versions of laravel (they will need to fork and allow for laravel 8 in both this project and laravel-langman) , then the project does not support parameters (used in laravel's validation translations for one) or for the 'translation strings as keys' functionality, where translations are stored in json files.

strlen() expects parameter 1 to be string, array given

Hello.

I'm using laravel 5.7 and php 7.2, and when I execute "php artisan autotrans:missing", I get the following:

**root@c3ac4083fd6f:/var/www# php artisan autotrans:missing
Found 1 language to translate

ErrorException : strlen() expects parameter 1 to be string, array given

at /var/www/vendor/ben182/laravel-auto-translate/src/Commands/MissingCommand.php:57
53| foreach ($targetLanguages as $targetLanguage) {
54| $missing = $this->autoTranslator->getMissingTranslations($targetLanguage);
55| $missingCount += $missing->count();
56| $strLen += $missing->map(function ($value) {

57| return strlen($value);
58| })->sum();
59| $this->line('Found '.$missing->count().' missing keys in '.$targetLanguage);
60| }
61|

Exception trace:

1 strlen([])
/var/www/vendor/ben182/laravel-auto-translate/src/Commands/MissingCommand.php:57

2 Ben182\AutoTranslate\Commands\MissingCommand::Ben182\AutoTranslate\Commands{closure}([], "validation.attributes")
[internal]:0

Please use the argument -v to see more details.**

Do you know where can my problem be?.

Thanks

Laravel 9 Support?

Is there any way this package is gonna have support for laravel v9 and php 8.1 ?

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.