Open Bug 1315005 Opened 8 years ago Updated 2 years ago

New command: migrate-l10n

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: stas, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

In bug 1280685 we want to create a workflow for migrating legacy translations (DTD, properties) to the new FTL format used by L20n. We'd like to have a new mach command, migrate-l10n, which is able to run migrations "spec" files written by developers and apply the results to l10n repos in form of commits, preserving the attribution of localizers. The migration specification was discussed in https://github.com/mozilla-l10n/roadmap/issues/13#event-821050149. The attribution requirement was discussed in bug 1288141 and bug 1288146. The migration tool will be implements as part of the python-l20n package. It requires an update to the in-tree version of compare-locale. The mach command will also require python-hglib.
Comment on attachment 8807316 [details] Bug 1315005 - Part 2. The migrate-l10n command for mach. Pike, can you take a look and let me know if this is going into the right direction? Thanks!
Attachment #8807316 - Flags: feedback?(l10n)
I don't think this needs to be a mach command. Especially considering the limited scope and the fact that it's a one shot thing for every directory it will be run for.
Axel, can you provide some more rationale behind the idea for this being a mach command?
Flags: needinfo?(l10n)
Some expectations: We'll incrementally migrate existing Firefox UI to l20n, and for each patch, there will be a migration. So we're likely looking at double-digit number of those migrations. Given they're associated with the code landing on mozilla-central, I think it makes sense for those migrations to be in m-c, too. And by that, the code to run them. We'll have the dependency on python-l20n as part of our build automation anyway, it's basically a dependency of compare-locales at the point where we land l20n. Wether this is a mach command or not is really just icing on the cake, in terms of that command being able to run. I like the idea of having python module discovery done, some formalized out, etc. I expect us to need this command for localizers on central on a more or less daily basis, and the whole migration should take at least two cycles. So I don't think of this as a one-time thing.
Flags: needinfo?(l10n)
Assignee: nobody → stas
Depends on: 1316640
Depends on: 1319829
Comment on attachment 8807316 [details] Bug 1315005 - Part 2. The migrate-l10n command for mach. https://reviewboard.mozilla.org/r/90512/#review95254 I'm a bit wonky about our encoding story here at large, didn't yet give this a real spin. Do we care about python3 in this code at all? 'cause hglib.util.b() is a no-op on python 2, too. I think we should take out the argument parsing stuff out of l10n_migrate.py completely. Also, that probably doesn't need to be called l10n_migrate.py. Once we strip the args handling, is there enough code in there to warrant it still being a dedicated file? For file structure, it's quite common to have python/foo/foo/__init__.py. Maybe python/mozl10n/mozl10n ? To avoid the obvious conflicts at the toplevel. ::: python/l10n/l10n_migrate.py:62 (Diff revision 3) > + ) > + > + print(' Committing changeset: {}'.format(message)) > + if not dry_run: > + client.commit( > + b(message), user=b(author), addremove=True I don't think we should use b() here explicitly. ::: python/l10n/l10n_migrate.py:86 (Diff revision 3) > + parser.add_argument( > + '--localization-dir', type=str, > + help='directory for localization files' > + ) > + parser.add_argument( > + '--blame', type=argparse.FileType(), default=None, We should have this option on the mach command, too. ::: python/l10n/mach_commands.py:62 (Diff revision 3) > + from l10n_migrate import main > + from l10n_blame import Blame > + > + if not lang or not migrations: > + print('You must specify --lang and at least one migration module.') > + return 1 We should move these constraints into the CommandArguments ::: python/l10n/mach_commands.py:72 (Diff revision 3) > + > + if not localization_dir: > + localization_dir = mozpath.join( > + self.topsrcdir, > + self.substs['L10NBASEDIR'] > + ) I think you copied a bug from the compare-locales mach command :-/. toolkit/moz.configure sets L10NBASEDIR to an absolute path, and it resolves against the objdir, from all that I can tell, too.
Attachment #8807316 - Flags: review?(l10n) → review-
Depends on: 1315976
Depends on: 1344782
No longer depends on: 1315976
Product: Core → Firefox Build System

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: smalolepszy → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: