Download & Extend

Omit < > characters from t()

Project:Fivestar
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

AttachmentSizeStatusTest resultOperations
fivestari18nfixes.patch7.83 KBIgnored: Check issue status.NoneNone

Comments

#1

Status:needs review» needs work

This 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.

#2

Also, the patch you attached is an HTML document(?) If you could reroll that'd be great.

#3

Status:needs work» needs review

That'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!

AttachmentSizeStatusTest resultOperations
fivestar_module_i18n.patch1.13 KBIgnored: Check issue status.NoneNone

#4

Ah, 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.

#5

Status:needs review» fixed

Fixed with this patch, committed.

AttachmentSizeStatusTest resultOperations
fivestar_t_brackets.patch1.81 KBIgnored: Check issue status.NoneNone

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#7

Title:Rating Labels weren't passed through t()» Omit < > characters from t()

Updating title for what was fixed.

nobody click here