Bug 268309 (MacPrint_l10n)

[Mac OS X] Make the print dialog localizable

RESOLVED FIXED in mozilla1.9.3a1

Status

defect
RESOLVED FIXED
15 years ago
2 years ago

People

(Reporter: slicedlime, Assigned: zbraniecki)

Tracking

(Blocks 1 bug, {l12y})

Trunk
mozilla1.9.3a1
All
macOS
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed by bug 456646])

Attachments

(13 attachments, 2 obsolete attachments)

26.76 KB, image/png
Details
1.93 KB, text/plain
Details
988 bytes, text/plain
Details
4.60 KB, text/plain
Details
461 bytes, text/plain
Details
1.58 KB, text/plain
Details
1.60 KB, text/plain
Details
2.50 KB, text/plain
Details
619 bytes, text/plain
Details
665 bytes, text/plain
Details
1.32 KB, text/plain
Details
40.35 KB, image/jpeg
Details
5.16 KB, application/zip
Details
The PrintPDE.plugin introduced by bug 205974 contains strings that can't
currently be localized. The strings turn up in english even in localized builds.
OS: All → MacOS X
Blocks: 259167
(In reply to comment #0)
> The PrintPDE.plugin introduced by bug 205974 contains strings that can't
> currently be localized. The strings turn up in english even in localized builds.

I don't know too much about Mac-resources, but shouldn't that be done in a new
'lproj' folder ? And all localizable strings (the one visible in the print
dialog) should normally be in the file Localizable.strings . But when I tried to
modify directly, it had only influence on the 'Summary' tab, not on the Firefox
tab itself.
Possibly, but the whole tree's in a place where localizers normally don't have
access, and so on. I think preferably the build process should generate the
correct files from some files in the l10n tree.
Unfortunately, not all strings are in Localizable.strings, most of them are in
PrintPDE.nib/objects.xib.
The good news is: Camino uses the PrintPDE.plugin, too, and they translated it
in many languages for their multilang version already. As I subscribe to the
CaminoL10N mailing list, I will ask there how it is done and if this could be
automated.
Perhaps we can provide an <language>.lproj folder that can automatically be
included in the locale build? That would still require that someone with a mac
does the localization, though. AFAIK the only way to localize the plugin to 100%
is to hack the .nib file.
It's still just text strings in files. It should be possible to generate the
needed files from l10n metadefinitions of some kind, just as installers and
other 'additional' materials currently are.
I talked to some people about this problem at FOSDEM and we have come up with a
plan to make this localizable. This bug will be the first step, in which the
plugin can only be localized with the help of a Mac user, the second step should
include some server-side stuff which is IMHO not necessary immidiately.
I want to push this step out before Firefox 1.1, and hopefully the next one for
Fx 1.5.

Stay tuned, I will post the plan here as soon as I took a detailed look at the
work needed.
Assignee: bugs → cmp
Component: OS Integration → Build Config
Keywords: helpwanted
QA Contact: os-integration → bryner
Summary: PrintPDE.plugin (mac) strings are not localizable → Make PrintPDE.plugin (mac) localizable (Part 1)
Version: 1.0 Branch → Trunk
I took a closer look and found out:

currently the English files live in
/mozilla/embedding/components/printingui/src/mac/printpde/res/English.lproj/
to be consistent, we would need a directory like
/l10n/ab-CD/embedding/components/printingui/src/mac/printpde/ab.lproj/
or something shorter like 
/l10n/ab-CD/embedding/components/printingui/printpde/ab.lproj/
(for languages needing the locale code, like Chinese or Portugese, "ab_CD.lproj"
is possible, too.)

The plan then is:
1. create the directory in the locales, copying the contents of "English.lproj"
in "ab.lproj"
2. patch the build process, so that, when creating the jars etc., the "ab.lproj"
is copied in the right place, leaving "English.lproj" there as fallback.
3. Translate the contents of "ab.lproj". At least the .nib file in there has to
be created by a Mac user, I will provide instructions and/or do it myself for
Firefox 1.1 if we do not get Part2 (yet to be defined) flying 'til then.

(4. integrate step 2 in Thunderbird as well, as it uses the same plugin.)

That should be it!

Suggestions|Comments|etc. welcome.
Summary: Make PrintPDE.plugin (mac) localizable (Part 1) → [Mac OS X] Make PrintPDE.plugin localizable (Part 1)
This is how the PrintPDE dialog looks like in _all_ languages of Firefox right
now.
Localizers: when you translate the strings later on, please use this screenshot
as context reference.
Attachment #176130 - Attachment filename: Localizable.strings → Localizable.strings (UTF-16)
Attachment #176130 - Attachment description: original Localizable.strings → original Localizable.strings (UTF-16)
Attachment #176130 - Attachment filename: Localizable.strings (UTF-16) → Localizable.strings
Alias: PrintPDE_l10n
Summary: [Mac OS X] Make PrintPDE.plugin localizable (Part 1) → [Mac OS X] Make PrintPDE.plugin localizable
Assignee: chase → gandalf
Product: Firefox → Core
Keywords: helpwanted
Summary: [Mac OS X] Make PrintPDE.plugin localizable → [Mac OS X] Make PrintPDE.plugin source-localizable
### first draft ###
This file contains all the strings and values of objects.xib that can be
localized in a .dtd format, so that Mozilla Translator e.g. can cope with it.
This file has to be parsed and the values reinserted in objects.xib.
### first draft ###
This file contains all the localizable strings of Localizable.strings in a .dtd
format.
It has to be parsed and the strings reinserted into the original file.
To make this easier, the original copy of *this* file should be placed in a
common directory like l10n/generic/.
### first draft ###
This file maps the "pretty names" of the entities in objects.dtd to the Carbon
IDs needed for inserting the values in objects.xib.
This file should be placed in a common directory like l10n/generic/ not to
confuse localizers and also to be more flexible in case the IDs change in the
future. (no need to change the "pretty names" then).
Attachment #181259 - Attachment description: Draft of the first of the files to be translated → Draft of the first of the files to be translated (objects.dtd)
Attachment #181260 - Attachment description: Draft of the second of the files to be translated → Draft of the second of the files to be translated (strings.dtd)
Attachment #181261 - Attachment description: Draft of the helper file → Draft of the helper file (objectsIDs.dtd)
added sizes to objects.dtd that _should_ work for most locales, testing this
again soon. 
If a translator of a language that usually takes up more space could translate
this file - I would be glad to have some "real world" testcase.
Attachment #181259 - Attachment is obsolete: true
Example for testing the script. I used the German strings from the German
Camino, which already translates this plugin.
This is a draft of the script to create the translated objects.xib
For testing purposes, it expects all files to be in the same directory. The
original objects.xib (attachment 176133 [details]) has to be renamed objects_en.xib, the
translated objects.dtd and the (unchanged) objectsIDs.dtd are also needed,
output is written to objects.xib.

Feel free to comment on the script and make optimizations, I am still learning
Perl so I expect it to be far from perfect. (But it works ;))
renamed file to work with draft of the script
Attachment #181260 - Attachment is obsolete: true
Example for a translated localizable_strings.dtd to test the script.
I used some of the strings that the German Camino uses.
draft of Perl script to create the translated Localizable.strings from
localizable_strings.dtd (original and translated)
For testing purposes, the script expects all files to be in the same directory
and the original file being named localizable_strings_en.dtd. 
Output is Localizable.strings.utf8 - this has to be converted to UTF-16 using
iconv later on.

For this script my comment for the other one holds, too: Comments and
optimizations welcome.
Comment on attachment 182473 [details]
Perl script to create translated Localizable.strings (RFC)

one comment on the script I forgot:
I create Localizable.strings from scratch, as this is easier.
The comments in the original file get lost because of this.
OK, this one missed the 1.5 train. :|
As a bandaid, I created a "language pack" that can be installed like an
extension (script ripped from the myspell dictionary installers). 
This one is the German one and works fine in Firefox and Thunderbird 1.0:
http://tesla.afthd.tu-darmstadt.de/~mmx/extensions/PrintPDE1.0.de.langpack.xpi
(current 1_8_BRANCH and trunk builds need an updated translation because of more
options in the dialog)
*** Bug 303851 has been marked as a duplicate of this bug. ***
Martin, is there a PrintPDE extension for 1.5 rc/final?
(In reply to comment #24)
> Martin, is there a PrintPDE extension for 1.5 rc/final?
> 

I am working on that. Because there are new strings in the new plugin, and these strings are used multiple times, I have to adapt the scripts a little.
I will post as soon as I have something to show, but my time is very limited atm. (Some have noticed already, sorry for that :( )
Duplicate of this bug: 373943
This issue also exists in the current build of Firefox, Thunderbird and so on. Is there a solution for this? This is also the reason for Bug 418488.
You can localize it on a Mac with Xcode. The nib can be localized with Apples Interface Builder, the Localizable.strings with Xcode or every Text editor. I's very easy to do this (on a Mac). I've created myself a German.lproj for my german Thunderbird. You can see the differences to the normal behaviour in the screenshot.
This is my own German.lproj for the PrintPDE.plugin, for testing purpose. You can try, modify it if you want. It's a revised version of that in my above screenshot. I've tested this with german versions of Firefox 3.0.10, Firefox 3.1b3, Firefox 3.5b4, Thunderbird 3.0b2, Thunderbird 3.0b3pre and Thunderbird 3.1a1pre (own german version). Should also work in Thunderbird 2.0.0.21.
You can install it by moving the attached folder "German.lproj" into Application.app/Contents/Plug-Ins/PrintPDE.plugin/Contents/Resources (whereby "Application" is Thunderbird, Firefox...).

If you build your own (non en-US) version, you can include it in your own build by doing the following. First you need to put your lproj folder (e.g. German.lproj) into /mozilla/embedding/components/printingui/src/mac/printpde/res. Next you need to modify the Xcode Project, you can do this withinside Xcode and add your new lproj. I've done this in another way, by opening the file /mozilla/embedding/components/printingui/src/mac/printpde/PrintPDE.xcode/project.pbxproj in a text editor. Than I changed the "English" at Line 345, 346, 363 and 364 into "German". You can do this in the same way with every language that is supported through the lproj system (http://developer.apple.com/documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html#//apple_ref/doc/uid/20002144). If you now build your application, your own lproj for the PrintPDE will be included in your own application.
QA Contact: bryner → build-config
I'm currently rewriting the print dialog in Cocoa (bug 456646) and will get rid of the PrintPDE plugin. I think the GTK print dialog is localizable, so I'll probably use a similar approach.
Depends on: 456646
This is now fixed by bug 456646. This is the file that needs to be localized:
toolkit/locales/en-US/chrome/global/printdialog.properties
Alias: PrintPDE_l10n → MacPrint_l10n
Status: NEW → RESOLVED
Closed: 10 years ago
Hardware: PowerPC → All
Resolution: --- → FIXED
Summary: [Mac OS X] Make PrintPDE.plugin source-localizable → [Mac OS X] Make the print dialog localizable
Whiteboard: [fixed by bug 456646]
Target Milestone: --- → mozilla1.9.3a1
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.