When exporting the translations from a drupal site with the Calendar module installed, the .po-file contains conflicts due to bad translations.
In includes/calendar_plugin_styles.inc the form element "max_items" contain regular translations for counted items. At the moment the options look like this:
'#options' => array(0 => t('Unlimited'), 1 => t('1 item'), 3 => t('3 items'), 5 => t('5 items'), 10 => t('10 items'))
The problem is that other modules use format_plural to translate this. This makes very good sence. If the options are changed - lets say max is 20 instead of 10 - a new translation has to be made, making the translation less than flexible.
I suggest changing the options to the following:
'#options' => array(0 => t('Unlimited'), 1 => format_plural(1, '1 item', '@count items'), 3 => format_plural(3, '1 item', '@count items'), 5 => format_plural(5, '1 item', '@count items'), 10 => format_plural(10, '1 item', '@count items'))
I know it's a bit longer, and not as pretty, but the code is a lot more correct. It only requires one translation no matter how the options will change in the future. And it assures that translations do not collide.
(I'll try to attach a patch in a comment...)
Comment | File | Size | Author |
---|---|---|---|
#3 | calendar-items_translation-1729884-3.patch | 1.28 KB | lund.mikkel |
#1 | calendar-items_translation-1729884-1.patch | 1.22 KB | lund.mikkel |
Comments
Comment #1
lund.mikkel CreditAttribution: lund.mikkel commentedPatch
Comment #2
hass CreditAttribution: hass commentedPlease add some line breaks. One option per line. This is not easy to read.
Comment #3
lund.mikkel CreditAttribution: lund.mikkel commentedEverything for you my dear sir...
Comment #4
hass CreditAttribution: hass commentedLooks good and reuses a core format_plural string.
Comment #5
fizk CreditAttribution: fizk commentedCommitted, thanks!