Closed Bug 209097 Opened 21 years ago Closed 20 years ago

Default mailto form subject should be localizable

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla1.8alpha6

People

(Reporter: ansgar, Assigned: csthomas)

References

()

Details

(Keywords: l12y, Whiteboard: [good first bug])

Attachments

(3 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.4b) Gecko/20030507
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.4b) Gecko/20030507

When you use Mozilla to post a form via email, the subject line of the created
email has an English text: 'Form Post From Mozilla'
I suggest to replace it (if possible) with a German text. What about 'Formular
wurde über Mozilla versendet'.

Reproducible: Always

Steps to Reproduce:
1. Click on the send button of a form that is sent via Email
Kannst Du eine Beispiel-URL nennen, wo dieser Effekt auftritt?
An example page where this effect can be seen is here
http://www.atelier-scheuch.de/email_formular.html 
This is not localizable currently, it's a hardcoded subject string that is used
if there's no subject set in the mailto: form.

see
http://lxr.mozilla.org/mozilla/source/content/html/content/src/nsFormSubmission.cpp#428

(this was introduced by bug 61893)

If you think it's still important that the default subject should get
translated, then we should morph this bug into a "Default mailto form subject
should be localizable" bug in Browser / Form Submission component with l12y
keyword set.

Ansgar, what do you think (as you're the original poster)?
In my opinion this new bug should be created. It is not a big issue, but when a
complete translation is the goal, this should be part of it. Robert will you
create the new bug or should it done by me?
We don't need a new bug, we can just use this one, as it already holds all the
needed information, and localizations will adapt automatically when it's changed
in the main tree.

Moving per Comment #3
Component: German-Austria/de-AT → Form Submission
Keywords: l12y
Product: Mozilla Localizations → Browser
Summary: Form post via email creates a subject with an English text → Default mailto form subject should be localizable
Version: unspecified → Trunk
reassigning. see comments #3 to #5.
Assignee: kairo → form-submission
QA Contact: Sebastian → ashishbhatt
Whiteboard: [good first bug]
Note that layout/html/forms/src/HtmlForm.properties is probably a good place to
put the string...
Trying to fix this bug - my first. In my local tree, I added
the DefaultSubject string to layout/html/forms/src/HtmlForm.properties,
as Boris suggested. To retrieve the string where it is used
at: content/html/content/src/nsFormSubmission.cpp, I made a
call to nsFormControlHelper::GetLocalizedString method declared
in layout/html/forms/src/nsFormControlHelper.h after doing
a #include of this header. This is the same method used to
retrieve another string from HtmlForm.properties in the file
layout/html/forms/src/nsFileControlFrame.cpp

The code did not compile because the nsFormControlHelper.h
file is not found when compiling nsFormSubmission.cpp . This
file is in the same dir as nsFileControlFrame.cpp - the other
place where this method is called - which is why it might have
been found when that file is compiled.

Can the .h be accessed from the .cpp file mentioned above? Or
perhaps, I should look for another place to put the DefaultSubject
string?
Let's just add that I'm not convinced that putting a content string into layout.
But then bsmedberg might know where he's going to move files like this anyway.
I see good reasons for layout headers not working in content, so that'd be fine.
See what the called function does and mimic it. Or grep in the content sources
if there is an equivalent helper in content. (Can you smell somebody not wanting
content-layout to intermongle even further?)
While you're fixing this please remove the extra & at the end of the subject.
Thought I'd found a good place to put this string - in include/allxpstr.h
and then use XP_GetString() to fetch it, as specified in:
http://www.mozilla.org/docs/refList/i18n/allxpstr-h.html

Sadly, it looks like this is outdated documentation. Couldn't find this
file in the source tree.
Yes, that's very old documentation.

I don't see any good properties file under content for this either.

Logically, HTMLForm.properties makes sense, because this is form related...
Is this being worked on?  If not, I'll take it.
So... why should this be fixed? The language of the recipient may well not be
the language of the user's browser. This means that the recipient may not be
able to tell that a mail is indeed the result of a form post. It also means that
it is not possible to recognize a form post just by looking at its subject.
OS: Windows XP → All
Hardware: PC → All
What do IE, Opera, etc. do?
IE doesn't set any subject (empty subject line).
(In reply to comment #14)
> So... why should this be fixed? The language of the recipient may well not be
> the language of the user's browser. This means that the recipient may not be
> able to tell that a mail is indeed the result of a form post.
They could/should have set a subject.  The way it is right now, every browser is
going to produce a different subject (or in the case of MSIE, every user is
going to type a different subject)

> It also means that it is not possible to recognize a form post just by looking
at its subject.
We're apparently the only ones who set a default subject anyway, so it doesn't
seem like we'd be harming many people's heuristics.
->me, patch in a bit
Assignee: form-submission → cst
Whiteboard: [good first bug] → [good first bug] helpwanted
Whiteboard: [good first bug] helpwanted → [good first bug]
Comment on attachment 168193 [details] [diff] [review]
Patch

dom/locales/en-US/chrome/layout/HtmlForm.properties
\ No newline at end of file

please fix ;)
Whiteboard: [good first bug] → [good first bug] [cst: active, r?]
Target Milestone: --- → mozilla1.8alpha6
Comment on attachment 168193 [details] [diff] [review]
Patch

- In dom/locales/en-US/chrome/layout/HtmlForm.properties:

+DefaultFormSubject=Form Post from Mozilla
\ No newline at end of file

Add a newline at the end of the file.
Attachment #168193 - Flags: review?(jst) → review+
Comment on attachment 168235 [details] [diff] [review]
to check in

Err, sorry.
Attachment #168235 - Attachment is obsolete: true
Whiteboard: [good first bug] [cst: active, r?] → [good first bug]
Attachment #168236 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 168236 [details] [diff] [review]
to check in

>-    aPath.AppendLiteral("subject=Form%20Post%20From%20Mozilla&");
The old string was escaped. I don't see the new string being escaped...
Attachment #168193 - Attachment is obsolete: true
Attachment #168236 - Attachment is obsolete: true
Attachment #168551 - Flags: superreview?(roc)
Attachment #168551 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #168236 - Flags: superreview?(roc)
Attachment #168236 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 168551 [details] [diff] [review]
Patch that escapes the strings

>+    rv = bundleService->CreateBundle(
>+                                     "chrome://communicator/locale/layout/HtmlForm.properties",
>+                                     getter_AddRefs(bundle));
Nit: only needs to be two lines.
Attachment #168551 - Flags: review?(neil.parkwaycc.co.uk) → review+
Attachment #168551 - Flags: superreview?(roc) → superreview+
Attached patch to check inSplinter Review
Removed extra blank line
checked in by db48x
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Is there a reason that this didn't use the nsContentUtils methods for this sort of thing?
(In reply to comment #30)
> Is there a reason that this didn't use the nsContentUtils methods for this
sort of thing?

(In reply to comment #31)
> No. Ctho?

I'd never heard of it, and nobody mentioned it while I was writing the patch. 
I'm redoing it now.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
great, thanks!
Assignee: cst → form-submission
Status: REOPENED → NEW
QA Contact: ashshbhatt → ian
Assignee: form-submission → cst
Attachment #169469 - Flags: superreview?(roc)
Attachment #169469 - Flags: review?(neil.parkwaycc.co.uk)
Whiteboard: [good first bug] → [good first bug] [cst: active, r?]
Attachment #169469 - Flags: superreview?(roc)
Attachment #169469 - Flags: superreview+
Attachment #169469 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #169469 - Flags: review+
There's a case for making subjectStr an nsAutoString, and an IMHO better case
for making nsContentUtils::Get/FormatLocalizedString take an nsXPIDLString&
checked in by timeless
Status: NEW → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Whiteboard: [good first bug] [cst: active, r?] → [good first bug]
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: