Closed (fixed)
Project:
Panels
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
1 Oct 2008 at 17:22 UTC
Updated:
19 Oct 2008 at 21:31 UTC
CivicActions is reviewing and upgrading multiple modules for use on client sites. Part of this work is a coding standards review. Attached you will find a patch based on a review with the coder module and a careful examination of the code. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| panels_i18n_2.patch | 5.8 KB | samlerner |
Comments
Comment #1
stella commentedThere's one additional issue identified by the potx coder review that the attached patch doesn't cover:
The line of code in question is the 'category' line below:
The
t()function is not intended for use on dynamic variables and it also means that the potx module is unable to extract this string for translation. This is why the i18nstrings module provides thett()function, perhaps you should consider using that instead? There's a discussion on the misuse of t() at http://groups.drupal.org/node/15177 in case you're interested.Cheers,
Stella
Comment #2
catchThese are all minor changes, but they look good to me, and the patch applies cleanly.
Comment #3
catchComment #4
sdboyer commentedUsing
tt()would necessitate introducing a direct dependency on i18n, which isn't an option. If there's some way around that, I'd be interested to hear.However, that particular piece shouldn't actually be wrapped in
t()in the first place, as it's user input. Highly privileged user input (if the site admin is remotely sane), but nevertheless...user input. So really, the change that needs to happen there is escaping, and changing the ternary to callt()only on the static string if the first value isn't set.The original patch has been committed, alongside the changes I've just noted.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.