8000 Unused state of some translations which are really used · Issue #29085 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Unused state of some translations which are really used #29085
Closed
@BonBonSlick

Description

@BonBonSlick

I am not sure if it is expected behaviour.
According to docs https://symfony.com/doc/current/translation/debug.html
I run command php bin/console debug:translation nl --domain=messages --only-unused
and got all unused translations, but, some of them used!
Example

 State         Domain                     Id         Message Preview (nl)        Fallback Message Preview (en)          
  unused  |  messages  |  xml.searchTitle.days.total  | voor %total% ...  |   xml.searchTitle.days.total                
 ---------- ---------- ------------------------------------------------------------------- ---------------------------------------
php bin/console debug:translation nl --domain=messages --only-unused

But with global search I found that this translation is used

 if ($totalDays <= 3) {
                $params['%days%'] = $this->translator->trans(
                    'xml.searchTitle.days.specific',
                    [
                        '%days%' => $this->availabilitiesToString($availabilitySchedule, true),
                    ]
                );
            } else {
                $params['%days%'] = $this->translator->trans('xml.searchTitle.days.total', ['%total%' => $totalDays]);
            }

Why is shows state unused when it is used?

There area thousands of translations, because this command is not reliable I cant trust it, I have to check every translation manually if it is used...
There are a lot of cases with wrong state.
Strange but I found above unused states, that translations with unused state I removed, now has state missing, if I return them, they have both states, used and unused at the same time.
It happens not with all translations, some of them really unused, missing or used and has only one state.
Also, I am not sure if translations which used in twig counted, because found many with status used, but they are used in twig templates.
And some message when adding flash in controller is also missed, state unused.

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

      0