Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There were a few labels for ratings which weren't passed through locale, so they'd never get translated on an i18n site.
This patch should correct this.
Comment | File | Size | Author |
---|---|---|---|
#5 | fivestar_t_brackets.patch | 1.81 KB | quicksketch |
#3 | fivestar_module_i18n.patch | 1.13 KB | hailu |
fivestari18nfixes.patch | 7.83 KB | hailu | |
Comments
Comment #1
quicksketchThis is intentional as t() is meant to be used for non-dynamic, hard-coded values (not user-inputed values). However, I won't argue that Fivestar is unable to translate the custom star labels.
Comment #2
quicksketchAlso, the patch you attached is an HTML document(?) If you could reroll that'd be great.
Comment #3
hailu CreditAttribution: hailu commentedThat's really funny, i have no idea how i got that to be HTML!
I've re-rolled this patch to contain only first hunk, so that the default labels are wrapped in t()'s.
I see your point about dynamic values and t() not really seeing eye to eye.
For dynamic values, tt() might be a good alternative.
I hope this helps!
Comment #4
quicksketchAh, okay I see what you're recommending now. This location is actually intentionally left without the t() also, though again, I'm not positive it's the best approach. If Fivestar were to wrap the labels in t() or tt() on output, you'd want the initial setup of the labels to be in English, so the t() is omitted to keep the labels in English by default.
Comment #5
quicksketchFixed with this patch, committed.
Comment #7
quicksketchUpdating title for what was fixed.