← Back to team overview

schooltool-developers team mailing list archive

i18n messages used in comparisons and assignments

 

Working with the gradebook, in the Set Column Preferences form, there's an option to create a Summary worksheet with the average of all the other worksheets.

When I was using the gradebook in Spanish I saw the worksheet was added with the title 'Summary' even when the form instructions "promised" the worksheet was going to be titled 'Resumen'. No big deal. I can change the title of the worksheet to 'Resumen'. The same happens with the default worksheet being titled 'Sheet1' instead of 'Hoja1' anyway.

But it was the 'Overwrite existing worksheets titled "Summary"' option that made me check the code to see if this could be fixed and I noticed at the top of schooltool.gradebook.browser.gradebook:

SUMMARY_TITLE = _('Summary')

then below I see comparisons like:

...
                if worksheet.title == SUMMARY_TITLE:
...
            if worksheet.title.startswith(SUMMARY_TITLE):
...
            next = SUMMARY_TITLE + str(index)
...
        return self.nextSummaryTitle() != SUMMARY_TITLE

and in schooltool.gradebook.activity:

...
    sheet1 = Worksheet(_('Sheet1'))
...

So this logic that depends on i18n messages which are not translated before the comparison or assignment started to seem weird to me. And now, thanks to Ignas, every time I see a comparison with a "title" (which can be in any language and can be edited by the user) I start to feel something could break.

What do you guys think?

Douglas

"... allí­ es cuando te das cuenta que las cosas malas pueden resultar bastante buenas..." - Lionel Messi

Por favor, evite enviarme adjuntos de Word, Excel o PowerPoint.
Vea http://www.gnu.org/philosophy/no-word-attachments.es.html