Skip to content

magento generate a broken js-translation.json file while deploying locale  #18519

Closed
@sezio

Description

@sezio

Preconditions

  1. magento CE 2.2.6 or 2.2.5 with porto theme
  2. apache 2.2
  3. php 7.0.30
  4. data were migrated from magento 1 using the migration tool

Steps to reproduce

I have no idea of how it could be reproduced 😞
However, context is the following : I've been migrating some Magento 1 data using the migration tool on a clean magento 2.2.5 (and then on 2.2.6 hoping the problem would be gone).
Deploying the static content with bin/magento setup:static-content:deploy -f fr_FR creates an invalid js-translation.json file

Expected result

A fine js-translation.json containing valid json as :
{"Save":"Sauvegarder","Close":"Fermer","Submit":"Envoyer",...}

Actual result

A broken js-translation.json file containing non replaced string with triple curved brackets :
{"Method %s does not exist on jQuery.decorate":"{{{Method %s does not exist on jQuery.decorate}}{{Method %s does not exist on jQuery.decorate}}{{Method %s does not exist on jQuery.decorate}}{{themeSmartwave\/porto}}}","Please wait...":"{{{Please wait...}}{{Please wait...}}{{Please wait...}}{{themeSmartwave\/porto}}}",

Additional information

  1. No error in the logs or thrown by the deployment, file is generated but content is broken
  2. I have the problem on my staging env but not on my local env... Both have the same php version running (7.0.30) on debian stretch and I use apache2 with the same modules enabled : php -i and apachectl -M return the exact same values between the two environments
  3. on my staging env, js-translation.json is broken in each deployed theme, even the ones from Magento
  4. Same problem on every locales

I've also found the following issue #16633 which is the exact the same problem but was closed because it needed an update

Thanks for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: TranslationFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: doneReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject itstale issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions