Repository navigation
Batch actions: Add the ability to pretranslate strings - #4455
MundiaNderi wants to merge 5 commits into
Conversation
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
|
I haven't looked at the code, but
This should not be available to contributors. I would go as far as to limit this to members of the pretranslator group. |
What do you mean by "pretranslator group"? Batch actions in general are only available to translators. |
There is a
In this case, I don't think it should. We want visibility on which projects have pretranslation enabled, and check quality. |
|
Could you elaborate in more detail a bit on how you envision that to work? How would I as a translator join the group?
Why is that not possible if pretranslation is available to translators or managers? |
|
Can we move this conversation to the issue?
They wouldn't, that's a manually curated group, because the associated API has a cost and can be abused. Pretranslation is enabled on a locale+project base with strict criteria. Why would we suddenly change this, through batch actions of all places?
Pretranslation is not available to translators or managers. Pretranslation is enabled on a project and locale, and by default will translate all resources in the project: what's the goal of having a batch action? |
f335fbf to
9f335e9
Compare
|
@MundiaNderi |
|
Looks like it was posted in the wrong PR? #4406 (comment) Can it be that you run the migration with an old version of moz-l10n, and that didn't fix existing strings with PLATFORM()? See #4533 (comment) |
Ah yes - the 'wrong PR' was what I had open during the meeting. I will look into the new issue and see if there's any correlation, then revert, possibly tomorrow evening / Friday. |
9f335e9 to
fce5ee6
Compare
Batch actions: Add the ability to pretranslate strings This is a draft pr because I want to context switch Allows contributors to manually batch pretranslate strings for locales supported by translation engines.
candidate fails to parse, rather than failing the whole batch. Mirrors the existing behavior in pretranslation/tasks.py
EditorMenu only renders when no entities are batch-selected, so requestInProgress === 'pretranslate' can never coincide with it being mounted. In-progress feedback already exists in Pretranslate.tsx.
fce5ee6 to
a1ea4ee
Compare
pretranslation candidate or an unparsable one
| for which pretranslation is not enabled by the admins. | ||
| """ | ||
|
|
||
| entity_pks_with_translation = set( |
There was a problem hiding this comment.
This is excluding approved translations, but it's going to pretranslate strings that already have a pretranslation. We should probably exclude those by filtering the authors (pt_authors = get_pretranslation_authors()).
That means also renaming this variable, e.g. excluded_entity_pks.
Again, flagging @mathjazz for an opinion. Since we want to change the behavior for the task, we might want to pretranslate strings with pending suggestions .filter(Q(approved=True) | Q(user__in=pt_authors.values())).
| fuzzy=False, | ||
| pretranslated=True, | ||
| active=entity.pk not in already_active_entity_pks, | ||
| user=user, |
There was a problem hiding this comment.
Waiting for @mathjazz opinion, but I think we shouldn't attribute this to the user running pretranslation, but to tm or gt, like we do when running pretranslation as a task. At that point, updating badge levels is unnecessary.
In case, the same applies later for the actionlog.
There was a problem hiding this comment.
Removed the badge updates. Happy to revisit attributing pretranslation to tm/gt next week in a follow-up if @mathjazz thinks it's worth it.
Fixes #2790
This is a draft pr because I want to context switch
Allows contributors to manually batch pretranslate strings for locales supported by translation engines.