You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Packaging Instructions: Firefox for Mac OS X

newsgroup discussion / mailing list
Mozilla Localization Project Staff


MLP [Localization Project home] | [Localization docs] | [Packaging] | [Firefox for Mac OS X]


Martin Creutziger (2004-02-16) ver0.3
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.
  1. Prerequisites


    What you need to get started. You should also know the locale code used for this localized version of Mozilla Firefox. It usually looks like a 2/3 lower case letters, minus, 2 capital letters string. E.g.: fr-FR, zh-TW, wen-DE
  2. 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.

    1. Extract the English build and mount the diskimage. Copy the content (Firefox) in a new folder.
    2. Launch Firefox from the copied build (with a fresh profile)
    3. Install the language.xpi using the "Install new extension" button in the "Extensions" preference panel
    4. Exit Firefox

    5. Open a Terminal (e.g. /Applications/Utilities/Terminal)
    6. 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)
    7. Exit Firefox again

    8. Rename the language.xpi to language.zip and extract it into a folder called "lpcontents/"

    9. Open the Firefox package using a right-click (Ctrl-click) and "Show package contents"
    10. Dive into "Contents/MacOS/chrome/" and copy "installed-chrome.txt" to your Desktop
    11. 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)
    12. Extract the original Firefox again into a folder called "FFbuild", but keep the copy you just launched (just in case...).

    13. Dive into FFbuild/Contents/MacOS/chrome/
    14. Delete "chrome.rdf", "installed-chrome.txt" and "chromelist.txt" as well as "en-*.jar" and "US.jar"
    15. Copy the "installed-chrome.txt" we saved in your Desktop, into FFbuild/Contents/MacOS/chrome
    16. Copy the contents of "lpcontents/chrome/" folder into FFbuild/Contents/MacOS/chrome

    17. Switch to FFbuild/Contents/MacOS/defaults/
    18. Copy the content of lpcontents/defaults/profile/[region code]/ into "profile"
    19. Copy lpcontents/defaults/profile/[region code]/ itself into "profile/". (right, you now got the files duplicate in there)
    20. Copy the remaining contents of lpcontents/ into the appropriate folders

    21. Change to FFbuild/Contents/Resources/ and copy English.lproj to [YourNameLanguageInEnglish].lproj or [languagecode].lproj

    22. 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.

    23. Now you should create a read-only diskimage (not compressed) with the contents of FFbuild/ you just edited.
    24. 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)
    25. Once you're sure everything works as wanted, you can continue, otherwise you have to fix it or start over again.
    26. You are almost done. Now open the Terminal and change to the location of the disk image
      (using the command: cd [path]).
    27. In this directory, type the command "bzip2 -kv9 [diskimg_filename].dmg"
    28. After compression finished, you should have a new ".dmg.bz2" file along the old ".dmg" one. You are done then.
  3. Steps to perform if you have the language files
    (got from a Windows or a Linux build)


    1. 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.

    2. Extract the English Firefox build to mount the disk image.

    3. Look inside the English Firefox package with a right click (Ctrl-click) and selecting "Show package contents".
    4. Dive into Contents/MacOS/chrome.
    5. Copy the "installed-chrome.txt" file in your Desktop.
    6. Delete the following files: "chrome.rdf", "installed-chrome.txt", "chromelist.txt", "en-mac.jar", "en-win.jar", "en-unix.jar", "US.jar".
    7. 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.

    8. 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)
    9. Copy the edited version of "installed-chrome.txt" in you Desktop in this folder.

    10. Copy the !contents! of FFLocalized/bin/defaults/profile/[region code]/ inside the Contents/MacOS/defaults/profile/ folder of the Firebird package.
    11. 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/.

    12. In the Firefox package go to Contents/Resources/ and copy English.lproj to either [YourLanguageNameInEnglish].lproj or [languagecode].lproj

    13. Similarly copy any remaining language specific file in the appropriate folders.

    14. Create a read-only diskimage (not compressed) of the Firefox package you just edited.
    15. 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.

    16. 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).
    17. You're almost done. Open the Terminal and change to the location to the folder containing the disk image (using the command cd path).
    18. In this directory, type the command "bzip2 -kv9 [filename].dmg"
    19. After compression has completed, you should have a new ".dmg.bz2" file along the old ".dmg" one. You are done then.
Feel free to send a mail in case you have problems. (Use the link at the top of this page)
Have fun building and testing!