Repository navigation
Conversation
prioux
left a comment
There was a problem hiding this comment.
There is a bug in the PR, see comment.
| :message_type => :notice, | ||
| :header => header, | ||
| :variable_text => "For #{view_pluralize(success_list.count,type)}" | ||
| :variable_text => message_count_prefix(success_list) |
There was a problem hiding this comment.
This is a mistake. The original code would log messages with a prefix that depends on the type of the first object in success_list, which could be any CBRAIN object. This was done by line 31 in the original code which said
type = generic_human_type(success_list.first)So we got messages like "For 3 files" or "For 5 users" or "For 7 tasks".
But this PR has hardcoded that the messages now always say "tasks". which will be very misleading when the list is not tasks.
There was a problem hiding this comment.
Thanks Pierre — agreed that this shared helper must preserve the object type. That distinction is retained in the extracted message_count_prefix helper near the bottom of the file:
def message_count_prefix(objects)
return I18n.t('task_message_helpers.for_tasks', :count => objects.size) if objects.first.is_a?(CbrainTask)
"For #{view_pluralize(objects.size, generic_human_type(objects.first))}"
endThe translated task wording is used only when the first object is a CbrainTask. For files, users, and other non-task objects, the fallback still calls generic_human_type and view_pluralize, preserving the original wording such as “For 3 files” or “For 5 users”. Both the notice and error helpers call this method.
The English/French checks also compared non-task helper output against the original formatting. Non-task prefixes intentionally remain in their original English wording in this task-specific PR.
|
@dlq You're absolutely right, I didn't see the handling of the object types in there. All good. |
Bulk task updates currently send English notification subjects and failure reasons in French sessions. Translate success/failure subjects, all four access/configuration failure reasons, and the shared task-count prefix (“Pour 1 tâche” / “Pour 6 tâches”). Preserve task links, update behavior, and non-task notification formatting.
Validation in the local Apple-container Rails portal, English and French:
git diff --checkpassed; trial merge with [ADD] errors in I18n format #1677 at 0067e3e was clean.Related to #1660. Independent branch based on
dev; no validation-message keys overlap #1677.