Closed Bug 16999 Opened 25 years ago Closed 25 years ago

[I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: bugs, Assigned: pollmann)

References

()

Details

(Whiteboard: [PDT+] Cannot verify until 28900 is fixed (28900 now fixed))

Attachments

(8 files)

The file that contains presentation information for HTML elements in the content
window, html.css, has default caption values for Input type="submit" and
type="reset" hard-coded into them:

content: "Submit Query";
..
content: "Reset";
I really don't think putting "Submit Query" and "Reset" into a CSS file is "HARD
CODED", after all, you need to store these string somewhere. But I do agree that
these string probably should store in some other kind of text file, say a string
bundle (locale sensitive property file)

Reassign this to hyatt since he is the one show in cvs blame for that two line.
Ray Chen and Tao could help you to make the right decision and provide the right
tool to do the right thing.

Hyatt, please talk to Ray or Tao, I know you are pretty busy. I think they could
help you to solve this issue if you can tell them where to look at this issue.
Hyatt, please reassign this to the right person who OWN this CSS (and in
particular the code which look at the content of this CSS) if you are not the
right person. Thanks.
Assignee: hyatt → rickg
not my bug. rickg gets it.
Assignee: rickg → pollmann
Eric -- can you please resolve this. Thanks.
Frank, you are the i18n expert.  Where is it customary to store localized
strings like this?  How can I get access to them from, say:

layout/html/forms/src/nsFormControlFrame::GetValue() ?

When we change languages, as in the demo we saw a few weeks back during the
seamonkey all-hands meeting, how are all of the other button labels getting
updated?  Can't we use this same mechanism to explicitly set a value for the
submit button?
Component: Internationalization → Layout
Static UI strings in XULed UI are defined in the *.dtd associated with the
 *.xul. Dynamic resource strings are defined in *.properties files and can be
retrieved via StringBundleService in C++ or JS code. Look at this doc below
for XUL & DTD issues:

	http://www.mozilla.org/projects/intl/xul-styleguide.html#l10nhow

And, this doc for StringBundle:

	http://www.mozilla.org/projects/intl/string-resources.html

Sample usage can be found here for C++ code:

http://lxr.mozilla.org/mozilla/source/exte nsions/cookie/nsCookie.cpp#234

and here for JS code:

http://lxr.mozilla.org/mozilla/source/intl/strres/tests/strres-test.js#104


Also the "Components" field of this bug shall be "Layout" instead of "I18n".



Thanks
After careful consideration, I've decided that I probably won't get this bug in
for M12.  Currently I have nearly 50 bugs scheduled for M13, so there is a
possibility that this bug may need to be moved out farther still.
CC msanz. We shall try to resolve this no latter than M13. Otherwise, there
is a great possiblity that you're gonna see English UI in a localized product...
Any bug that impacts localization needs to be fixed by M13 because we are
localizing beta. And we need it before M14 because we need to work on the files
a month prior to beta.
Summary: "Submit Query"/"Reset"/"Browse..." hard coded into html.css → [I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css
Marking [I18N].
Summary: [I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css → [BETA][I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css
resources have to be localizable by beta1 at most, marking BETA
Blocks: 24206
Target Milestone: M13 → M14
Due to regressions caused by my fix to bug 20315, I will probably not be able to
get to this today.  Marking M14 and I'll try to get it in early M14 if possible.
Keywords: beta1
Laura, is this a beta stopper?
Putting on PDT+ radar for beta1.
Whiteboard: [PDT+]
Summary: [BETA][I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css → [I18N] "Submit Query"/"Reset"/"Browse..." hard coded into html.css
Whiteboard: [PDT+] → [PDT+] 11-Feb-2000
The more time I spend with this bug, the more I think creating localized
versions of html.css is an easier and possibly better solution to this bug...

I've made some progress here, but am currently stuck.  Rod, this seems like an
area you might be familiar with, can you help me out?


What I have done:
 - nsGfxButtonControlFrame to grab a string bundle and gets localized default
   labels for submit and reset buttons
 - these strings are used to compute the button size
 - created a properties file, and modified makefiles to export this


What I need help with:
 - Determining if a button is a file input ("Browse...")
 - Generate a text frame with the localized string as the child of the button.
   (I've tried setting the style content but it doesn't work reliably)

Right now the buttons get their text from a .properties file and appear the
right size, but currently just appear as gray boxes (except when they
occasionally appear with text, which I can't explain).

I'll try to scrape together the diffs.
Whiteboard: [PDT+] 11-Feb-2000 → [PDT+] Help wanted
To add the diffs to your tree (and build)
(Works on un*x and Windows if you change / to \ :)  )

save the attachment as diffs.zip
cd $MOZROOT/mozilla
unzip diffs.zip
cd layout/html/document/src
patch < DIFF
make
cd ../../forms/src
patch < DIFF
make
cd ../../../build
make

I added the changes needed to create a text frame, and they seem to work.
The only thing lacking from a solution here is to determine if a button frame is
a part of a file input frame.  This should be done in
nsGfxButtonControlFrame::GetDefaultLabel() in place of the if (NS_FORM_BROWSE ==
type) which doesn't work.
Whiteboard: [PDT+] Help wanted → [PDT+] Help wanted (Partial fix attached)
Whiteboard: [PDT+] Help wanted (Partial fix attached) → [PDT+] (Partial fix)
Perhaps the lack of sleep is getting to me.  I'll add a check - get the button
frame's parent, and if it is a file input use the "browse..." localized string. 
Of course, any other suggestions are appreciated, thanks!  :)
Whiteboard: [PDT+] (Partial fix) → [PDT+] 15-Feb-2000
Hi, Erik:

Are you still seeing the grey button without text? Have you checked that if the
retrieval of the string was successful?
I solved the grey buttons problem but have caused a new one now.  Will be
working on this tonight.  (Yes, the retrieval of the localized text is
successful.)
Attached file New properties file
The above four attachments are a complete fix for this bug.  I need to get this
code reviewed and approved.
Whiteboard: [PDT+] 15-Feb-2000 → [PDT+] Fix in hand, need review/approval
Reviewed by Rod (Thanks!)  Making a few small changes before seeking approval.
Whiteboard: [PDT+] Fix in hand, need review/approval → [PDT+] Fix in hand, need approval
Getting review on changes to NGLayoutBuildList.pm (for Mac build)
Just checked in the fix.

If you have a build compiled on your machine, you can verify like this:

Open the file I'm about to attach in the browser.
Open up the HtmlForm.properties file in a text editor. 
  mozilla/dist/bin/chrome/layout/locale/en-US/HtmlForm.properties on Linux
  mozilla\dist\Win32_D.OBJ\bin\chrome\layout\locale\en-US\ on Win
  mozilla:dist:viewer_debug:Chrome:Layout:locale:en-US: on Mac

Edit the contents of HtmlForm.properties to something like:
Reset=Esetray
Submit=Ubmitsay Eryquay
Browse=Rowsebay...

Click reload

The buttons with default labels should show the new 'localized' labels that you
saved.  Thanks!
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Attached file test case
Hi, Teruko:

Would you please alos test languages in double byte charsets such as CJK?


Thanks
See bug 28691, leaks/bloat caused by this checkin. :(
I cannot verify this until 28900 is fixed.
Whiteboard: [PDT+] Fix in hand, need approval → [PDT+] Cannot verify until 28900 is fixed
I just checked in a fix for 28900, thanks for noticing that important omission!
Whiteboard: [PDT+] Cannot verify until 28900 is fixed → [PDT+] Cannot verify until 28900 is fixed (28900 now fixed)
I tested this in 2000022909 Win32 build.  I changed the HTML 
elements to Japanese in HtmlForm.properties, but the Japanese buttons do not 
show correctly.



Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Hi, Teruko:

The properties file needs to be in escape-unicode instead of native encoding.
Is this what it is now?
Tao,  thank you for remind me.  I change back to Resolved as Fixed.  
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
I verified this in 2000022909 Win32, Linux, and 2000030108 Mac build.
Status: RESOLVED → VERIFIED
No longer blocks: 24206
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: