Closed
Bug 1420225
Opened 7 years ago
Closed 7 years ago
Read legacy files when scanning for Sources in transforms
Categories
(Localization Infrastructure and Tools :: Fluent Migration, enhancement)
Localization Infrastructure and Tools
Fluent Migration
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: stas, Assigned: stas)
Details
Attachments
(1 file)
Right now calling ctx.maybe_add_localization is required to set up the migration context and read legacy translation files.
ctx.maybe_add_localization(
'mobile/android/chrome/aboutDownloads.dtd')
ctx.add_transforms('mobile/about_downloads.ftl', 'about_downloads.ftl', [
FTL.Message(
id=FTL.Identifier('title'),
value=COPY(
'mobile/android/chrome/aboutDownloads.dtd',
'aboutDownloads.title'
)
)
])
There's redundancy between maybe_add_localization and COPY's first argument.
Since we already scan all transforms for instances of Source (which COPY also is) to create a dependency chart of translations needed for each transform, it should be possible to read those legacy files during that scan and remove maybe_add_localization.
I would also like to encourage the use of keyword arguments in calls to add_transforms: target, template and transforms, like so:
ctx.add_transforms(
target='mobile/about_downloads.ftl',
template='about_downloads.ftl',
transforms=[
FTL.Message(
id=FTL.Identifier('title'),
value=COPY(
'mobile/android/chrome/aboutDownloads.dtd',
'aboutDownloads.title'
)
)
]
)
Assignee | ||
Comment 1•7 years ago
|
||
Assignee: nobody → stas
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•7 years ago
|
No longer blocks: fluent.migrate
Component: Python Library → Fluent Migration
Product: L20n → Localization Infrastructure and Tools
You need to log in
before you can comment on or make changes to this bug.
Description
•