Skip to content
New issue

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

Langman not compitable with laravel 8, #105

Open
ghostofjava opened this issue Feb 23, 2021 · 11 comments
Open

Langman not compitable with laravel 8, #105

ghostofjava opened this issue Feb 23, 2021 · 11 comments

Comments

@ghostofjava
Copy link

  • Laravel Version: 8.12
  • PHP Version: 7.4
  • Database Driver & Version:

I upgrade my app from lara 5.8 to 8 just I couldn't update langman package

there is any solution or ignore it ???

@ghostofjava
Copy link
Author

Any new feed??

@jessuircleydson
Copy link

jessuircleydson commented Mar 24, 2021

i'm with the same problem... Some news about it?

@aymanalhattami
Copy link

I've the same problem !

@ghostofjava
Copy link
Author

ghostofjava commented Mar 25, 2021

I was solve it. By adding in composer file without add it in require dependencies
autoload:{
psr-4:{
"Themsaid\Langman\": "vendor/themsaid/laravel-langman/src"
}
}

note : "Download it from git and put it in vendor folder"

@DonWagner
Copy link

DonWagner commented Oct 28, 2021

@ghostofjava How i cant make it work?

@QuentinGab
Copy link

For those looking for an alternative, I've made this one: https://github.com/ElegantEngineeringTech/laravel-translator
It includes:

  • AI translation
  • AI prooread
  • Dead translation keys detection
  • and more

@tarantula-valon
Copy link

For those looking for an alternative, I've made this one: https://github.com/ElegantEngineeringTech/laravel-translator It includes:

  • AI translation
  • AI prooread
  • Dead translation keys detection
  • and more

Hey quentin, i tried ur package and it has some issues, i tried to use the translator:dead command and i got this error on cmd:
What locales would you like to scan? [en]
al ............................................................................................................................................. 0
en ............................................................................................................................................. 1
❯ 1
┌ Scanning files: en ──────────────────────────────────────────┐
│ │
└───────────────────────────────────────────────────────── 0/5 ┘

PhpParser\Error

Syntax error, unexpected EOF on line 112

at vendor\nikic\php-parser\lib\PhpParser\ParserAbstract.php:359
355▕ /* error */
356▕ switch ($this->errorState) {
357▕ case 0:
358▕ $msg = $this->getErrorMessage($symbol, $state);
➜ 359▕ $this->emitError(new Error($msg, $this->getAttributesForToken($this->tokenPos)));
360▕ // Break missing intentionally
361▕ // no break
362▕ case 1:
363▕ case 2:

1 vendor\nikic\php-parser\lib\PhpParser\ParserAbstract.php:183
PhpParser\ParserAbstract::doParse()

2 vendor\elegantly\laravel-translator\src\Services\SearchCode\PhpParserService.php:90
PhpParser\ParserAbstract::parse()

even the translatr:missing command gave me an error:

What is the locale of reference? [en]
al ............................................................................................................................................. 0
en ............................................................................................................................................. 1
❯ al

TypeError

Elegantly\Translator\Commands\ShowMissingTranslationsCommand::Elegantly\Translator\Commands{closure}(): Argument #1 ($namespaces) must be of type array, Illuminate\Support\Collection given

at vendor\elegantly\laravel-translator\src\Commands\ShowMissingTranslationsCommand.php:24
20▕ $reference = $this->argument('locale');
21▕
22▕ $rows = collect(Translator::getAllMissingTranslations($reference))
23▕ ->flatMap(
➜ 24▕ fn (array $namespaces, string $locale) => collect($namespaces)
25▕ ->flatMap(function (array $keys, string $namespace) use ($locale, $namespaces) {
26▕ $values = array_map(fn (string $key) => [$locale, "{$namespace}.$key"], $keys);
27▕
28▕ if (array_key_last($namespaces) !== $namespace) {

1 [internal]:0
Elegantly\Translator\Commands\ShowMissingTranslationsCommand::Elegantly\Translator\Commands{closure}()
2 vendor\laravel\framework\src\Illuminate\Collections\Arr.php:605

@QuentinGab
Copy link

Hi @tarantula-valon,

  • translator:dead one of your file seems to have a syntax error because the parser can't parse the file.
  • translator:missing should be fixed in the last release.

If you face new issues, please report them directly on the repo

@tarantula-valon
Copy link

@QuentinGab I mean the sort worked fine for my files, but when trying to detect the dead translations, its not working and the same error keeps showing

@QuentinGab
Copy link

@tarantula-valon The dead code detection logic works differently from other operations. It must scan and parse your entire codebase using PHP-Parser.

However, if any .php or .blade.php file contains a syntax error, the parsing operation will fail and throw an error. This seems to be the case here:

PhpParser\Error
Syntax error, unexpected EOF on line 112

I’ve released a new version: v1.1.7 to help you debug this error. Could you try again with the latest version?

@tarantula-valon
Copy link

@QuentinGab ok now i got it figured out, thanks bro very much, this actually helped me remove views which i wasnt using and they apparently had some syntax errrors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants