Closed Bug 475113 Opened 11 years ago Closed 11 years ago

make profile info easier to localize

Categories

(SeaMonkey :: Build Config, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.0b1

People

(Reporter: kairo, Assigned: kairo)

References

Details

Attachments

(4 files, 2 obsolete files)

Bug 461979 - make profile info easier to localize

We should port as much of this as we can to suite/ but we need some good idea what to do about the bookmarks file.
Here is a patch that should move most awkward stuff out of the area localizers need to touch but still leaves a number of points where they can customize the localized builds.

Axel, please review this from the POV of L10n and build system usage, I hope it's somewhat sane what I'm doing here.

Neil, the files coming out of this process for default en-US builds are the same with the exception of changed bookmarks (not sure if your OK is enough or if we should raise those changes with the Council or so) and another exception is that the one left-over search category description went into a .dtd.

The patch needs thorough testing with an actual L10n, but I have already tested that the include stuff works with files I intend to use in the de L10n (e.g. adding an additional sidebar panel with stuff from the SeaMonkey SeaMonkey site).
Assignee: build-config → kairo
Status: NEW → ASSIGNED
Attachment #358615 - Flags: superreview?(neil)
Attachment #358615 - Flags: review?(l10n)
As those are all new files on the L10n side and l10n-central isn't actively used for SeaMonkey anyway right now, I added files there for testing, see http://hg.mozilla.org/l10n-central/de/rev/daa89ff60bc3 - I tested a new profile in a build with the patch and those files, and everything checks out as it should.
Comment on attachment 358615 [details] [diff] [review]
move most awkward-for-localizers stuff out of L10n

>+%/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
>+	$(SYSINSTALL) -D $(dir $@)
>+	$(RM) ./more-bookmarks.inc bookmarks.html.in
Why the ./ (if you needed it, each file would need it)

>+	cp $(srcdir)/generic/profile/bookmarks.html.in .
>+	cp $(LOCALE_SRCDIR)/profile/more-bookmarks.inc .
Would it be easier to use $^ ? (What are the vpaths for anyway?)

>+	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py \
>+	  -I $< \
I think an explicit #include in bookmarks.html.in would be more obvious.

>+	cp $(srcdir)/generic/profile/panels.rdf.in .
>+	cp $< .
$< only gives you the first file... $^ would be better?

>+	grep "<RDF:Description about=" panels.inc | \
>+	  $(PERL) -pe 's/.*<RDF:Description about="(.*)">.*/        <RDF:li resource="\1"\/>/g;' \
>+	  > panels-urn.inc
If you can't do it all in Perl then you're doing something wrong ;-)
As I see it you have two choices:
> sed -n 's/.*<RDF:Description about="\(.*\)">.*/        <RDF:li resource="\1"\/>/p'
> $(PERL) -ne 'print if s/.*<RDF:Description about="(.*)">.*/        <RDF:li resource="\1"\/>/g;'

>+libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
>+libs:: $(FINAL_TARGET)/defaults/profile/search.rdf ;
>+libs:: $(FINAL_TARGET)/defaults/profile/panels.rdf ;
Are those semicolons correct?

>+# LOCALIZATION NOTE: The 'en-US' strings in somee URLs will be replaced with
Typo: some(e)

>+# LOCALIZATION NOTE (seamonkey_l10n):
>+# insert full bookmark line for localized SeaMonkey page (personal toolbar)
>+# e.g. #define seamonkey_l10n <DT><A HREF="http://www.seamonkey.tlh/">SeaMonkey tlhIngan</a>
I take it this example is from your Klingon langpack? It might be an idea to use a working example ;-)
(In reply to comment #3)
> (From update of attachment 358615 [details] [diff] [review])
> >+%/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
> >+	$(SYSINSTALL) -D $(dir $@)
> >+	$(RM) ./more-bookmarks.inc bookmarks.html.in
> Why the ./ (if you needed it, each file would need it)

Without it, it came around to delete the file in $(LOCALE_SRCDIR)/profile/ which is not what we want, I guess...
This is a bit whacky though, and I think we probably should place the copied files in a subdir and clean up that subdir.

> >+	cp $(srcdir)/generic/profile/bookmarks.html.in .
> >+	cp $(LOCALE_SRCDIR)/profile/more-bookmarks.inc .
> Would it be easier to use $^ ? (What are the vpaths for anyway?)

The vpaths are for making locale-merge work. How that works is pretty undocumented though, I hope Axel can tell if I'm doing the right thing for it.

> >+	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py \
> >+	  -I $< \
> I think an explicit #include in bookmarks.html.in would be more obvious.

In that case, I need to copy this file file as well, as includes are relative to the file it's included in and therefore cannot cross the srcdir/objdir "barrier".
 
> If you can't do it all in Perl then you're doing something wrong ;-)

No, in that case I just know too little what I'm doing ;-)

> As I see it you have two choices:

Thanks for those, I guess I'll go with the sed one (given it works out) to not make us depend on perl more.

> >+libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
> >+libs:: $(FINAL_TARGET)/defaults/profile/search.rdf ;
> >+libs:: $(FINAL_TARGET)/defaults/profile/panels.rdf ;
> Are those semicolons correct?

I copied them from what Axel did for Firefox but I don't know why they are there.

> >+# LOCALIZATION NOTE (seamonkey_l10n):
> >+# insert full bookmark line for localized SeaMonkey page (personal toolbar)
> >+# e.g. #define seamonkey_l10n <DT><A HREF="http://www.seamonkey.tlh/">SeaMonkey tlhIngan</a>
> I take it this example is from your Klingon langpack? It might be an idea to
> use a working example ;-)

I intentionally used something as an example that isn't in any real langpack we have and that clearly doesn't exist...
(In reply to comment #4)
> (In reply to comment #3)
> > (From update of attachment 358615 [details] [diff] [review])
> > >+%/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
> > >+	$(SYSINSTALL) -D $(dir $@)
> > >+	$(RM) ./more-bookmarks.inc bookmarks.html.in
> > Why the ./ (if you needed it, each file would need it)
> Without it, it came around to delete the file in $(LOCALE_SRCDIR)/profile/
> which is not what we want, I guess...
Weird, I didn't expect that.

> > >+	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py \
> > >+	  -I $< \
> > I think an explicit #include in bookmarks.html.in would be more obvious.
> In that case, I need to copy this file file as well, as includes are relative
> to the file it's included in and therefore cannot cross the srcdir/objdir
> "barrier".
Well, you're already copying everything else, so it would look more consistent.
Comment on attachment 358615 [details] [diff] [review]
move most awkward-for-localizers stuff out of L10n

OK, so the idea is sound, but do anything you can to clean up the Makefile.in!
Attachment #358615 - Flags: superreview?(neil) → superreview+
This patch addresses Neil's comments and makes things cleaner and more reliable by putting all the copied/included files in a profile/ subdir.
Attachment #358615 - Attachment is obsolete: true
Attachment #359619 - Flags: superreview+
Attachment #359619 - Flags: review?(l10n)
Attachment #358615 - Flags: review?(l10n)
Attachment #359619 - Flags: review?(l10n) → review-
Comment on attachment 359619 [details] [diff] [review]
address Neil's comments, make things cleaner

Chatted with KaiRo, I've gotten better since I did the Firefox part.

In particular for individual files, going with $(firstword $(wildcard ) ) should be better than vpath, see http://mxr.mozilla.org/mobile-browser/source/locales/Makefile.in for examples.
This patch uses firstword instead of vpath, as Axel requested, hopefully making the path even cleaner :)
Attachment #359619 - Attachment is obsolete: true
Attachment #371855 - Flags: superreview+
Attachment #371855 - Flags: review?(l10n)
Comment on attachment 371855 [details] [diff] [review]
use firstword instead of vpath

r=me, too. Sorry for the lag.
Attachment #371855 - Flags: review?(l10n) → review+
Pushed as http://hg.mozilla.org/comm-central/rev/82c4914ad8ea
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → seamonkey2.0b1
This small followup is needed so that checks don't fail on locales actually using the more-bookmarks.inc and panels.inc files as intended.

Neil, can you at least rs this one? It doesn't influence the actual building process, just the output of compare-locales, which localizers use for checking if everything is alright (and which drives http://l10n.mozilla.org/dashboard/ output).
Attachment #375334 - Flags: review?(neil)
Comment on attachment 375334 [details] [diff] [review]
Also adjust filter.py

rs=me
Attachment #375334 - Flags: review?(neil) → review+
filter.py fixup pushed as http://hg.mozilla.org/comm-central/rev/84d75e481b54
Axel, the filter.py fixup makes compare-locales not generate a "missing string" not, but it still comes up with an "Unparsed content" error in dashboard... Is there a way to make compare-locales ignore those two files completely?
This slipped my review, I have a grammar in compare-locales that makes sure that doing something like

PreProcessor.py -I defines.inc install.rdf.in > install.rdf

is more or less safe, by erroring on random content that's not a blank line. Not really  fool proof, but better than nothing, catching stuff like

define FOO "This is broken due to the missing leading #"

The way to not run into this is to rename the included files that don't follow this scheme to have a different extension. Not nice, but I think the best compromise.
OK, so renaming the files that allow arbitrary content away from .inc should fix the choking of compare-locales. With moving to .extra, the additional bookmarks file can also drop the more- prefix.
Attachment #375403 - Flags: review?(l10n)
Attachment #375403 - Flags: review?(l10n) → review+
Pushed additional fix as http://hg.mozilla.org/comm-central/rev/c710b0fa3b57
Missed file removes in last checkin, corrected with http://hg.mozilla.org/comm-central/rev/30b786110f58
The only other usage of this strange style is in browser/locales/Makefile.in which is presumably where you copied it from, but everywhere else seems to prefer $(NSINSTALL) which works just as well (or better, in my case!)
Attachment #377967 - Flags: review?(kairo)
Attachment #377967 - Flags: review?(kairo) → review+
Comment on attachment 377967 [details] [diff] [review]
I don't like $(SYSINSTALL) -D

Pushed changeset eefe315765e2 to comm-central.
You need to log in before you can comment on or make changes to this bug.