Skip to content

Magento 2.2.0: Translations for 'Item in Cart' missing in mini cart. #12081

Closed
@jhruehl

Description

@jhruehl

Since updating one of our stores to Magento 2.2 the translations for 'Item in Cart' are not compiled into the var/view_processed/pub/static/frontend/{Magento-Theme}/{language code}/js-translation.json files, though the translations for 'Items in Cart' are correctly loaded.

Preconditions

  1. Magento 2.2.0
  2. PHP 7.0 and 7.1 (different local setups and different testservers)
  3. MySQL 5.5.5-10.1.23-MariaDB

Steps to reproduce

  1. Have a store view in another language than en_US.
  2. Set a translation for 'Item in Cart' for that language.
  3. Open your store with the store view according to language, where you expect the translation to be done.
  4. Add exactly one item to your cart.
  5. Open the mini cart.

Expected result

  1. 'Item to Cart' translated to store view given language.

Actual result

  1. 'Item to Cart' is not translated.

Details

So the problem or at least a symptom of the problem seems to be in the 'vendor/magento/module-checkout/view/frontend/web/template/minicart/content.html' template. Strangely not all 'translate'-nodes are triggering the Magento 2 Content Compiler to actually set the requested translations into the theme and language given js-translations.json files.
Though the lines
33 - <translate args="'Item in Cart'" if="getCartLineItemsCount() === 1"/>
and
34 - <translate args="'Items in Cart'" if="getCartLineItemsCount() > 1"/>
are almost completely identical, the translations for 'Items in Cart' are loaded, but not for 'Item in Cart'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions