When trying to do the spanish translation of the pot file, I realiced several issues:
I was adviced about the following errors:
* The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At t(variable_get('login_security_host_hard_banned',LOGIN_SECURITY_HOST_HARD_BANNED),$variables) in login_security.module on line 370.
* The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At t(variable_get('login_security_user_blocked',LOGIN_SECURITY_USER_BLOCKED),$variables) in login_security.module on line 382.
And I saw strings that could be reformatted:
#: login_security.install:26
msgid "The ip address of the connection."
#: login_security.install:101
msgid "The IP address of the connection."
#: login_security.install:33
msgid "Username used in the login."
#: login_security.install:129
msgid "Username used in the login submission."
I'll use the same case and reduce the number of possible string combinations, as I do update the new .pot file.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 500740_strings_consolidation_and_t_issues_1.patch | 10.72 KB | ilo |
| #2 | 500740_strings_consolidation_and_t_issues.patch | 10.22 KB | ilo |
| #2 | 500740_new_pot_file.patch | 9.96 KB | ilo |
Comments
Comment #1
deekayen commentedI previously noticed and fixed some instances where t() was wrapped around variable_gets(). Those are now strtr() instead. Example:
Since there are so many, that might also benefit from a separate function so it'd turn into something like (untested):
Comment #2
ilo commentedAlthough the patch touches several files, the hard part was the login_security_t translator, now included is a replacement for t in the whole module. functionality test passes, and manual revision of the messages show correct strings.
Comment #3
deekayen commented500740_strings_consolidation_and_t_issues.patch no longer applies cleanly.
Comment #4
ilo commentedI rerolled the patch to current -dev status. I passed the tests and seems to work. I would like someone makes a quick review before committing. I just removed everything that has nothing to do with t() issues to clean the patch ewview a little bit. The rest of items (strings and .pot will go to another issue).
Comment #5
ilo commentedAll tests passed. No coder issues. Verified manually. Commited to 6.x-1.x-dev