mbi / django-rosetta

Rosetta is a Django application that eases the translation process of your Django projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plurals with context are rendered incorrectly

jieter opened this issue · comments

With following .po excerpt, the context marker is rendered on top of the message id, as shown in the screenshot.

msgctxt "BADGE_PROGRESS_OBSERVATIONS"
msgid "1 observation"
msgid_plural "%{count} observations"
msgstr[0] "1 waarneming"
msgstr[1] "%{count} waarnemingen"

Screenshot 2021-07-20 at 08 47 42

I had a look into this: vertical alignment of the msgid's with the textarea's is done using JavaScript here:

$('td.plural').each(function(i) {
var td = $(this), trY = parseInt(td.closest('tr').offset().top);
$('textarea', $(this).closest('tr')).each(function(j) {
var textareaY= parseInt($(this).offset().top) - trY;
$($('.part',td).get(j)).css('top',textareaY + 'px');
});
});

Thanks. That JavaScript code is just ugly, I've moved the the context and comments into the last column, where they make more sense, and where we don't need any silly trickery to position them.

Great, thanks!

@mbi Can you indicate when this fix will be available in a release?

I don't really plan my releases, ... so here you go: 0.9.7, just released, contains this fix.