Packaging Instructions: Firefox for Mac OS X
newsgroup discussion / mailing listMozilla Localization Project Staff
If you want to make your own localized build of Mozilla Firefox for OS X you might find the following steps helpful. If you are looking for current instructions how to package Thunderbird 1.0.x, check out this version.
Prerequisites
What you need to get started.- A Firefox English build
- A yourlanguage.xpi installable language package or the language files alone
- A plain text editor (e.g. TextEdit)
- An Unix Shell, preferably the Apple Terminal
Steps to perform when you have a Mozilla Firefox language package
(yourlanguage.xpi)
A forenote: Always get in touch with the authors of the localized material, an let them know what you're going to do with their work.
- Extract the English build and mount the diskimage. Copy the content (Firefox) in a new folder.
- Launch Firefox from the copied build (with a fresh profile)
- Install the language.xpi using the "Install new extension" button in the "Extensions" preference panel
- Exit Firefox
- Open a Terminal (e.g. /Applications/Utilities/Terminal)
- Launch again Firefox using the command
"[path to Firefox]/"Firefox.app"/Contents/MacOS/firefox-bin -contentLocale [RegionCode] -UILocale [LocaleCode] &".
Firefox should launch in your language now. If not, try the steps in part (III) - Exit Firefox again
- Rename the language.xpi to language.zip and extract it into a folder called "lpcontents/"
- Open the Firefox package using a right-click (Ctrl-click) and "Show package contents"
- Dive into "Contents/MacOS/chrome/" and copy "installed-chrome.txt" to your Desktop
- Modify this copy of "installed-chrome.txt" with a text editor. Each occurrence of "en-US.jar", "US.jar" or "en-mac.jar", should be replaced with the name of the corresponding jar file in lpcontents/
(e.g.: en-US.jar -> pt-BR.jar, en-mac.jar -> pt-BR-mac.jar, US.jar -> reg-pt-BR.jar) - Extract the original Firefox again into a folder called "FFbuild", but keep the copy you just launched (just in case...).
- Dive into FFbuild/Contents/MacOS/chrome/
- Delete "chrome.rdf", "installed-chrome.txt" and "chromelist.txt" as well as "en-*.jar" and "US.jar"
- Copy the "installed-chrome.txt" we saved in your Desktop, into FFbuild/Contents/MacOS/chrome
- Copy the contents of "lpcontents/chrome/" folder into FFbuild/Contents/MacOS/chrome
- Switch to FFbuild/Contents/MacOS/defaults/
- Copy the content of lpcontents/defaults/profile/[region code]/ into "profile"
- Copy lpcontents/defaults/profile/[region code]/ itself into "profile/". (right, you now got the files duplicate in there)
- Copy the remaining contents of lpcontents/ into the appropriate folders
- Change to FFbuild/Contents/Resources/ and copy English.lproj to [YourNameLanguageInEnglish].lproj or [languagecode].lproj
- Now you should create a read-only diskimage (not compressed) with the contents of FFbuild/ you just edited.
- After you're done creating the diskimage (or you copied the localized Firefox to a different location) you should test it with a fresh profile (delete ˜/Library/Phoenix and/or use different login)
- Once you're sure everything works as wanted, you can continue, otherwise you have to fix it or start over again.
- You are almost done. Now open the Terminal and change to the location of the disk image
(using the command: cd [path]). - In this directory, type the command "bzip2 -kv9 [diskimg_filename].dmg"
- After compression finished, you should have a new ".dmg.bz2" file along the old ".dmg" one. You are done then.
Note: NEVER launch the Firefox you want to package up, always use copies for testing. If you launched it once, you'll HAVE TO start all over again.
Steps to perform if you have the language files
(got from a Windows or a Linux build)
- Get a Windows or Linux build localized in your language and extract it inside a folder named FFLocalized. A chrome folder contained in FFLocalized should contain the Firefox user interface resources localized in your language (e.g. FFLocalized/Firefox/chrome/).
The files you're interested in are named accordingly the locale code of your build. - Extract the English Firefox build to mount the disk image.
- Look inside the English Firefox package with a right click (Ctrl-click) and selecting "Show package contents".
- Dive into Contents/MacOS/chrome.
- Copy the "installed-chrome.txt" file in your Desktop.
- Delete the following files: "chrome.rdf", "installed-chrome.txt", "chromelist.txt", "en-mac.jar", "en-win.jar", "en-unix.jar", "US.jar".
- Copy the language specific .jar files from the Win/Linux localized build, in here. The source and the destination of these files has to be the chrome/ folder of the two builds.
- Modify the copy of "installed-chrome.txt" in your Desktop with a text editor. Each occurrence of "en-US.jar", "US.jar" or "en-mac.jar", should be replaced with the name of the corresponding localized jar file just copied in Contents/MacOS/chrome/
(e.g.: en-US.jar -> pt-BR.jar, en-mac.jar -> pt-BR-mac.jar, US.jar -> reg-pt-BR.jar) - Copy the edited version of "installed-chrome.txt" in you Desktop in this folder.
- Copy the !contents! of FFLocalized/bin/defaults/profile/[region code]/ inside the Contents/MacOS/defaults/profile/ folder of the Firebird package.
- Copy the !folder! FFLocalized/bin/defaults/profile/[region code] inside Contents/MacOS/defaults/profile/ folder of the Firebird package. This means you'll end up with a new "[region code]" folder in Contents/MacOS/defaults/profile/.
- In the Firefox package go to Contents/Resources/ and copy English.lproj to either [YourLanguageNameInEnglish].lproj or [languagecode].lproj
- Similarly copy any remaining language specific file in the appropriate folders.
- Create a read-only diskimage (not compressed) of the Firefox package you just edited.
- Now the diskimage is ready for testing. Alternatively you can test a copy these contents inside a different folder. Remember of testing using a fresh profile (delete ˜/Library/Phoenix and/or use different login).
- You're almost done. Open the Terminal and change to the location to the folder containing the disk image (using the command cd path).
- In this directory, type the command "bzip2 -kv9 [filename].dmg"
- After compression has completed, you should have a new ".dmg.bz2" file along the old ".dmg" one. You are done then.
Note: NEVER launch the Firefox build you want to distribute, always use copies for testing. If you launched it once, you'll HAVE TO start all over again.
- Get a Windows or Linux build localized in your language and extract it inside a folder named FFLocalized. A chrome folder contained in FFLocalized should contain the Firefox user interface resources localized in your language (e.g. FFLocalized/Firefox/chrome/).
Have fun building and testing!