Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Translation] Loco provider fails when pushing for multiple domains #43953

Copy link
Copy link
Closed
@vlad-ghita

Description

@vlad-ghita
Issue body actions

Symfony version(s) affected

5.3.6

Description

Given:

  • non-empty Loco project.
  • multiple translation domains

When pushing multiple domains to Loco, exception is thrown:

php bin\console translation:push loco --domains forms --domains messages --domains validators --force
12:31:09 INFO      [http_client] Request: "POST https://localise.biz/api/assets"
12:31:09 INFO      [http_client] Request: "POST https://localise.biz/api/assets"
12:31:09 INFO      [http_client] Request: "POST https://localise.biz/api/assets"
12:31:09 INFO      [http_client] Request: "POST https://localise.biz/api/assets"
12:31:10 INFO      [http_client] Response: "201 https://localise.biz/api/assets"
12:31:10 INFO      [http_client] Response: "201 https://localise.biz/api/assets"
12:31:10 INFO      [http_client] Response: "201 https://localise.biz/api/assets"
12:31:10 INFO      [http_client] Response: "201 https://localise.biz/api/assets"
12:31:10 INFO      [http_client] Request: "GET https://localise.biz/api/tags.json"
12:31:11 INFO      [http_client] Response: "200 https://localise.biz/api/tags.json"
12:31:11 INFO      [http_client] Request: "POST https://localise.biz/api/tags/forms.json"
12:31:11 INFO      [http_client] Response: "200 https://localise.biz/api/tags/forms.json"
12:31:11 INFO      [http_client] Request: "GET https://localise.biz/api/locales"
12:31:11 INFO      [http_client] Response: "200 https://localise.biz/api/locales"
12:31:11 INFO      [http_client] Request: "GET https://localise.biz/api/assets?filter=forms"
12:31:11 INFO      [http_client] Response: "200 https://localise.biz/api/assets?filter=forms"

In LocoProvider.php line 78:
                                                                                                        
  [ValueError]                                                                                          
  array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements  
                                                                                                        

Exception trace:
  at C:\work\jtmweb\vendor\symfony\loco-translation-provider\LocoProvider.php:78
 array_combine() at C:\work\jtmweb\vendor\symfony\loco-translation-provider\LocoProvider.php:78
 Symfony\Component\Translation\Bridge\Loco\LocoProvider->write() at C:\work\jtmweb\vendor\symfony\translation\Provider\FilteringProvider.php:47
 Symfony\Component\Translation\Provider\FilteringProvider->write() at C:\work\jtmweb\vendor\symfony\translation\Command\TranslationPushCommand.php:116
 Symfony\Component\Translation\Command\TranslationPushCommand->execute() at C:\work\jtmweb\vendor\symfony\console\Command\Command.php:299
 Symfony\Component\Console\Command\Command->run() at C:\work\jtmweb\vendor\symfony\console\Application.php:996
 Symfony\Component\Console\Application->doRunCommand() at C:\work\jtmweb\vendor\symfony\framework-bundle\Console\Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() at C:\work\jtmweb\vendor\symfony\console\Application.php:295
 Symfony\Component\Console\Application->doRun() at C:\work\jtmweb\vendor\symfony\framework-bundle\Console\Application.php:82
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at C:\work\jtmweb\vendor\symfony\console\Application.php:167
 Symfony\Component\Console\Application->run() at C:\work\jtmweb\vendor\symfony\runtime\Runner\Symfony\ConsoleApplicationRunner.php:56
 Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner->run() at C:\work\jtmweb\vendor\autoload_runtime.php:35
 require_once() at C:\work\jtmweb\bin\console:11

translation:push [--force] [--delete-missing] [--domains [DOMAINS]] [--locales [LOCALES]] [--] [<provider>]


Process finished with exit code 255

How to reproduce

  1. Have empty Loco project.
  2. Run this command once:
    php bin\console translation:push loco --domains forms --domains messages --domains validators --force
  3. Run same command again:
    php bin\console translation:push loco --domains forms --domains messages --domains validators --force
    Error occurs.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.