superreview denied: [Bug 392918] Convert all . strings files to UTF-8 for diff-friendliness and iconv them to UTF-16 during build

Mark Mentovai <> has denied Smokey Ardisson (no bugmail - =
not email) <>'s request for superreview:
Bug 392918: Convert all .strings files to UTF-8 for diff-friendliness and i=
them to UTF-16 during build

Attachment 284885: trunk patch

------- Additional Comments from Mark Mentovai <>
In the Makefile:=0D
When you find yourself writing the same thing over and over again, there's
probably a better solution.  In this case, we can add a fragment of this fo=
to the Makefile:=0D
STRINGS_FILES =3D x.strings y.strings z/z.strings=0D
GENERATED_STRINGS_FILES =3D $(patsubst %,generated/%,$(STRINGSFILES))=0D
$(GENERATED_STRINGS_FILES): generated/%.strings: $(srcdir)/
	mkdir -p $(dir $@)=0D
	iconv -f UTF-8 -t UTF-16 $< > $@=0D
GENERATED_STRINGS_FILES expands to include generated/x.strings,
generated/y.strings, and generated/z/z.strings.  The rule to build those has
been made generic.  The substitution form of the prerequisites says that to
build, for example, generated/z/z.strings (which becomes $@), use
z/ (which becomes $<).  We do the mkdir directly here (in addit=
to relying on generated, which is now optional) because we need something to
create arbitrary directories, like generated/z.=0D
This also helps out your libs:: line, to answer your question, because all =
the stuff you need is in $(GENERATED_STRINGS_FILES).  You need only add
$(GENERATED_STRINGS_FILES) to your libs:: line.  Also, with the double-colon
variety, you can have multiple libs:: lines, each specifying different
What I've given you here will require a minor reworking of the paths in your
patch (or some tweaking to what I've offered - the tweaking, frankly, is
probably excessive, so it's probably easier to just change the paths.)	As an
example, your patch used
PreferencePanes/Downloads/English.lproj/ to build
generated/Downloads/English.lproj/Localizable.strings.	With my patch, you'll
instead build
generated/PreferencePanes/Downloads/English.lproj/Localizable.strings.	Note
the presence of generated/PreferencePanes.  No biggie.=0D
Since this pretty much requires us to have a full "shadow" directory struct=
in generated, we should move generated/English.lproj/InfoPlist.strings to
generated/resources/localized/English.lproj/InfoPlist.strings, too.  See wh=
I'm saying?  You can whack the generated/English.lproj rule as a result, and
move InfoPlist.strings to use the mkdir pattern from above for convenience =
Looking in the project file at .strings files not named Localizable.strings:
CertificateDialogs.strings is named English in the project, but
RegionNames.strings has its own name.  Intentional?=0D
Nits in the existing strings files: has a lea=
newline, whack it.  The tabs in look awful.=
10/15/2007 5:29:07 PM 29307 articles. 3 followers. Post Follow

0 Replies

Similar Articles

[PageSpeed] 8
Get it on Google Play
Get it on Apple App Store