A minimalist approach
Note: There may be cases where a new build is unable to load the plugins that used to work with previous builds — depending on the operating system that you use, the default plugin search path may or may not work. If it doesn't, you'll have to check the source files. You can also set the MOZ_PLUGIN_PATH environment variable at runtime to override the default value, e.g., MOZ_PLUGIN_PATH=/usr/lib64/mozilla/plugins if running Bourne Shell.
For starters, download the source code and a matching L10N package for Japanese:
(hoge)% wget ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/4.0.1/source/\
firefox-4.0.1.source.tar.bz2
(hoge)% tar xf firefox-4.0.1.source.tar.bz2
Note that I don't use hg or sudo.
(hoge)% wget http://hg.mozilla.org/l10n-central/ja/archive/\
4d62a59c5127.tar.bz2
Set up the source and optionally download a fix:
(hoge)% tar xf 4d62a59c5127.tar.bz2
(hoge)% ln -s ja-4d62a59c5127 ja
(hoge)% wget \
http://dvoi.com/hhasebe/mozilla/firefox/4.0/build/ja/ja-browser.properties.diff
Again, the fix is optional.
(hoge)$ patch -p0 < ja-browser.properties.diff
It just changes the message in the "Bookmark This Page" dialog. With versions up to 4.0, past tense is used in ja which may give you an impression that a new entry has just been added, but in fact it won't happen until you explicitly press the "Done" button in the dialog (or the Enter or Return key).
(hoge)% setenv MOZCONFIG `pwd`/mozconfig
(hoge)% vi mozconfig
Note: This procedure should work with x86_64 systems[1] as well — check to see if your mozconfig file has to include something like:
ac_add_options --enable-64bit
ac_add_options --libdir=/usr/lib64
For further details, see the Configuring Build Options document. Be sure to adjust build arguments and shell command lines to match your system and preference. You might want to try profile guided optimization.[2]
(hoge)% grep -i 'prefix\|locale\|l10n\|browser' mozconfig
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_CO_LOCALES=ja
ac_add_options --prefix=/opt/local
ac_add_options --enable-application=browser
ac_add_options --with-l10n-base=..
ac_add_options --enable-ui-locale=ja
(hoge)% cd mozilla-2.0
(hoge)% make -j 2 -f client.mk build
Be patient until everything complies ok...
If you're safely returned to the command prompt, install the lot:
(hoge)% su root
Password:
# setenv MOZCONFIG `pwd`/mozconfig
# make -f client.mk install
Save your keystrokes & time. Have lots of RAM & enjoy.