In a multi-language environment, one needs to give variable instructions about entering the message. At the site I'm working on, I have to be able to switch during the session.
Therefore, I cannot work with only a t() for feedback_instructions in the function feedback_settings.
I need the t() at the moment of display, for me at line 199
t("Enter your message below:")
Also
At line 271, you are translating a text containing SMTP error information. But we cannot expect the translators to foresee every possible message at that point. I think it should be changed into
t("Error: E-Mail address error:<br> SMTP Info: ") . $smtp_err . "<br>"
, as the final <br> is fixed.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | feedback.patch1 | 595 bytes | adschar |
| #6 | feedback.patch3 | 3 KB | adschar |
| #5 | feedback.module.patch2 | 12.85 KB | adschar |
Comments
Comment #1
kbahey commentedHello adschar, thanks for your comments.
You say:
I don't understand what is meant by "variable instructions". How variable?
Also, what is "switch during the session"?
Therefore, I cannot work with only a t() for feedback_instructions in the function feedback_settings.
You say:
What do you mean at the moment of display?
What conditions are to be met before displaying it?
For other issue you mentioned, I understand it, and you are right. I fixed it in the cvs HEAD in the repository.
Comment #2
adschar commentedKbahey,
Variable instructions : the instructions should be either in French or in English, depending on what language the user is using at this point in the session.
Switch during session : The anonymous user enters the site. At that point I've no knowledge about him, he can be either French or English speaking. I start out giving him/her a French page. In the header of the page there's an English flag, which allows him to choose the other language. If he makes that choice, the site should serve all future pages in the session in English.
t() at moment of display : As administrator I can use the option to change the instruction "Enter your message below" into (example) "Use the textbox to create your message" or "Saisissez votre message". But once I've entered as administrator "use the textbox...", I've got no chance to change it into French. So I need a call to t() to find the translation.
Hope it helps
Comment #3
kbahey commentedHello Adschar
Now I understand the problem.
However, I do not have a solution for this. The module was not designed to have this split personality in a dynamic multi-lingual environment.
But, if you have suggestions on how to address this, I will be happy to discuss them.
Also, if anyone else reading this has suggested solutions that has been applied to other modules, they are welcome to share their views.
Comment #4
kbahey commentedAdschar,
He is a work around for one of the issues (instructions at the top of the feedback page).
You could include both English and French instructions, and have a small icon beside each with the appropriate flag.
This may or may not be acceptable to your visitors depending on what they are used to, ...etc.
Comment #5
adschar commentedI downloaded your last feedback.module, v1.23. And I tried to use it. The first thing that happened was that my intranet address wasn't accepted, so I decided to jump and create patches.
As I've no status as contributor or whatever, I attach, so you can approve or not. I you approve, please put them in CVS.
Hereby I propose three patch files
Patch 1 - The translation things I would like to see
Patch 2 - Change the regular expression you're using to validate an email address, into a call to a validator defined in common.inc. I know that that function does have an issue, and I have a modified version of that routine too.
Patch 3 - PHP prefers $edit['field_name'] over $edit[fieldname], so I changed that. And also, in the menu, I added the MENU_CALLBACK in feedback_menu()
Arie Dirk Schenkeveld
Comment #6
adschar commentedPatch 3
Comment #7
adschar commentedAnd patch 1
Comment #8
kbahey commentedAdschar
I did not know what you wanted was as simple as adding a t() around three strings! That was easy.
All your patches have been applied to the repository version.
Please make a patch for the common.inc e-mail validator routine as well, and submit it against the drupal core. Make sure you set the set to "patch" (not active or anything else), so it will make it to the developers' mailing list and hopefully someone will apply it.
If you want to checkout the latest version from the repository and give it a try, checking that it does what you want it to do, that would be a great help.
Thanks a lot for your patches and assistance.
Comment #9
adschar commentedNo thanks,
Patch to common.inc is patch to issue 12274
Comment #10
(not verified) commented