Hi,
I found a few more internationalization issues that I missed in my last patch. See attached.
However, there are more that are a bit more complex and were found by running the "interface text translatability" coder review provided by the potx module. The problem for all of these are the same. The t()
function is not intended for use on $variables, constants, strings that have already been passed through t() or strings which have variables concatenated onto them. Running t() on $variables also prevents these strings from being extracted by the potx module for translation. This is why the i18nstrings module provides the tt()
module, which you should consider using instead.
ites/sony/modules/contrib-6--2/date/date/date_admin.inc:
+287: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+287: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+288: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+288: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
sites/sony/modules/contrib-6--2/date/date/date_elements.inc:
+28: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+34: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+281: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+295: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+325: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+327: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
sites/sony/modules/contrib-6--2/date/date_api.module:
+98: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
sites/sony/modules/contrib-6--2/date/date_copy/date_copy.module:
+415: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+673: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
+683: The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there.
Cheers,
Stella
Comment | File | Size | Author |
---|---|---|---|
#7 | date_url.patch | 927 bytes | stella |
#4 | date_i18n_3.patch | 844 bytes | stella |
date_i18n_2.patch | 4.13 KB | stella | |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedHass also told me to get rid of escape characters in text that is going to be translated by using double quotes instead of single quotes around the text so I can get rid of the escape characters before the embedded single quotes, so I'm looking for those in addition to what you found.
Most of the error messages above are from places where we use t($field['widget']['label']), which CCK has consistently done everywhere (and it's still in the current CCK code). I've been trying to find out what the suggested best practice is to do with this but I've never really gotten any answers. Hass has been cleaning up the translations in CCK, but hasn't mentioned that one.
Comment #2
stella CreditAttribution: stella commentedYeah escape characters should be removed. I even missed one in the attached patch, oops.
See http://groups.drupal.org/node/15177 for a discussion on $variables in t().
Comment #3
stella CreditAttribution: stella commentedI should mention, in case it's not clear, the changes in the patch do not include anything for the potx reviews mentioned above.
Comment #4
stella CreditAttribution: stella commentedOh here's another patch for another i18n fix.
Comment #5
catchThe patch in #4 applies cleanly and looks RTBC. As noted, date_i18n2.patch could do with double quotes and no escape characters.
Comment #6
KarenS CreditAttribution: KarenS commentedOK, all of this is now committed except for handling the variable values. I can't decide what to do with them and it looks like there is no consensus on that anyway. The current handling is consistent with the way CCK is doing it, so I'll leave it alone for now, but I'm certainly open to a patch if anyone wants to provide one.
Comment #7
stella CreditAttribution: stella commentedHere's a patch for an un-needed url() I introduced in one of the i18n patches, sorry.
Comment #8
KarenS CreditAttribution: KarenS commentedFixed, thanks!
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.