PrestaShop / PrestaShop/TranslationToolsBundle

Twig extractor returns the same message over and over in file where it doen't exist

Open
#108 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
5
Forks
21
PR merge metrics
No merged PRs in 30d

Description

When trying to translate a module, some messages in twig templates are not visible in the BO interface

Debugging the TwigExtractor class, it seems that we have one message which come back in templates where it doesn't belong

See the video

https://user-images.githubusercontent.com/7426640/187469128-288b0e1b-1ca6-4acc-b37e-f2415ffb7f3b.mp4

The message "It looks like we have trouble connecting to Addons. Please refresh the page or check your firewall configuration." belongs to error.html.twig but the extractor found it again in layout-ajax.html.twig and catalog-refresh.html.twig
But this string is not present in these files

On the other hand we have a lot of wordings which are not extracted

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TwigExtractor class and compare its results for error.html.twig, layout-ajax.html.twig, and catalog-refresh.html.twig. Reproduce the module translation case shown in the video, then verify that messages are extracted only from the templates where they occur and that the reported missing wordings are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.