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

CommentFileSizeAuthor
#7 date_url.patch927 bytesstella
#4 date_i18n_3.patch844 bytesstella
date_i18n_2.patch4.13 KBstella
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

KarenS’s picture

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

stella’s picture

Yeah 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().

stella’s picture

I should mention, in case it's not clear, the changes in the patch do not include anything for the potx reviews mentioned above.

stella’s picture

FileSize
844 bytes

Oh here's another patch for another i18n fix.

catch’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #4 applies cleanly and looks RTBC. As noted, date_i18n2.patch could do with double quotes and no escape characters.

KarenS’s picture

Status: Reviewed & tested by the community » Fixed

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

stella’s picture

Status: Fixed » Needs review
FileSize
927 bytes

Here's a patch for an un-needed url() I introduced in one of the i18n patches, sorry.

KarenS’s picture

Status: Needs review » Fixed

Fixed, thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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