[compare-locales] nested directories in [[paths]] are order-dependent

NEW
Unassigned

Status

a year ago
3 days ago

People

(Reporter: Pike, Unassigned)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
In a l10n.toml context, I found that

[[paths]]
  reference = "browser/locales/en-US/**"
  l10n = "{l}browser/**"
[[paths]]
    reference = "browser/extensions/onboarding/locales/en-US/**"
    l10n = "{l}browser/extensions/onboarding/**"

and 

[[paths]]
    reference = "browser/extensions/onboarding/locales/en-US/**"
    l10n = "{l}browser/extensions/onboarding/**"
[[paths]]
  reference = "browser/locales/en-US/**"
  l10n = "{l}browser/**"

don't produce the same result.

The problem is that on the l10n side, browser/** picks up browser/extensions/onboarding/foo.

Not sure how to fix this yet. We could try to sort paths, or we need to define ordering in [[paths]].

flod, any opinion?

Gonna attach a simpler test case in a minute.
Comment hidden (mozreview-request)
Flags: needinfo?(francesco.lodolo)
(In reply to Axel Hecht [:Pike] from comment #0)
> The problem is that on the l10n side, browser/** picks up
> browser/extensions/onboarding/foo.
> 
> Not sure how to fix this yet. We could try to sort paths, or we need to
> define ordering in [[paths]].
> 
> flod, any opinion?

Sorting paths seems quite brittle.

These are both acceptable paths, aren't they?

"browser/**"
"browser/**/onboarding/locales/en-US/**"

Since we're already imposing an order on filters, I guess it would make sense to have a similar thing for paths.
Flags: needinfo?(francesco.lodolo)
(Reporter)

Comment 3

3 days ago
(In reply to Francesco Lodolo [:flod] from comment #2)
> 
> Since we're already imposing an order on filters, I guess it would make
> sense to have a similar thing for paths.

I just recently removed a patch with tests I had lying around, 'cause I think it's OK to just assume that the configuration files are written with this in mind.

Is that what your comment means, too?
I think I meant that we should call out that paths will be evaluated in order, like it happens for filters. So broader paths should go at the end of the list.

[[paths]]
    reference = "browser/extensions/onboarding/locales/en-US/**"
    l10n = "{l}browser/extensions/onboarding/**"
[[paths]]
  reference = "browser/locales/en-US/**"
  l10n = "{l}browser/**"
You need to log in before you can comment on or make changes to this bug.