Open
Bug 1392423
Opened 8 years ago
Updated 7 years ago
[compare-locales] nested directories in [[paths]] are order-dependent
Categories
(Localization Infrastructure and Tools :: compare-locales, enhancement)
Localization Infrastructure and Tools
compare-locales
Tracking
(Not tracked)
NEW
People
(Reporter: Pike, Unassigned)
Details
Attachments
(1 obsolete file)
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) |
Updated•8 years ago
|
Flags: needinfo?(francesco.lodolo)
Comment 2•8 years ago
|
||
(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•7 years 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?
Comment 4•7 years ago
|
||
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/**"
| Reporter | ||
Comment 5•7 years ago
|
||
We're actually reversing in https://hg.mozilla.org/l10n/compare-locales/file/ab17b19d4773/compare_locales/paths/files.py#l54, so broader paths can (and should) be first.
Let's document that in https://moz-l10n-config.readthedocs.io/en/latest/fileformat.html#paths?
| Reporter | ||
Updated•7 years ago
|
Attachment #8899591 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•