Language packs are restartless now

Language packs are add-ons that you can install to add additional localizations to our desktop applications.

Starting with tomorrow’s nightly, and thus following the Firefox 18 train, language packs will be restartless. That was bug 677092, landed as 812d0ba83175.

To change your UI language, you just need to install a language pack, set your language (*), and open a new window. This also works for updates to an installed language pack. Opening a new window is the workaround for not having a reload button on the chrome window.

The actual patch turned out to be one line to make language packs restartless, and one line so that they don’t try to call in to bootstrap.js. I was optimistic that the chrome registry was already working, and rightfully so. There are no changes to the language packs themselves.

Tests were tricky, but Blair talked me through most of it, thanks for that.

(*) Language switching UI is bug 377881, which has a mock-up for those interested. Do not be scared, it only shows if you have language packs installed.

The Conversation {12 comments}

  1. Wim {Thursday September 27, 2012 @ 5:10 am}

    Hi Axel,
    Does this mean that languagepacks are finally upgradeable with each new release of Firefox?

  2. Axel Hecht {Thursday September 27, 2012 @ 5:20 am}

    Language packs will continue to be incompatible by default, just because they are.

    I don’t know what the update experience is right now, to be honest. If this changed that at all, it would only change it in the way that you’d get an addon update that is now compatible and you don’t need to restart your browser. You’d still have to do the new window dance, though.

  3. Ben Hearsum {Thursday September 27, 2012 @ 5:34 am}

    This is cool, thanks!

  4. And {Thursday September 27, 2012 @ 6:16 am}

    Does this mean that only one global installer need to be offered for download and the localization just be handled by choosing the language on the first run page?

  5. Axel Hecht {Thursday September 27, 2012 @ 7:11 am}

    And, what problem would that fix?

    Note, we’re using some localized files at profile creation time, notably the default bookmarks.

    Also, I don’t know exactly how convenient the update story will be.

  6. And {Thursday September 27, 2012 @ 9:24 am}

    - Fewer installer packages to generate and host.
    - No need to guess the users preferred locale, so no risk of guessing wrong, and no need for an alternative languages page, so a simpler download page.
    - Fewer partial update files to generate
    http://hearsum.ca/blog/smaller-faster-updates-now-accessible-to-more-firefox-users/

  7. loe {Thursday September 27, 2012 @ 11:09 am}

    How about restartless dictionaries? I really dislike writing a lengthy comment in a textarea that does not autosave, just to find out that I don’t have the dictionary for a given language installed.

  8. Axel Hecht {Thursday September 27, 2012 @ 2:36 pm}

    Dictionaries are restartless for a while now. I actually used their tests as basis for the langpack tests.

  9. loe {Thursday September 27, 2012 @ 10:58 pm}

    Strange, which ones? I just tried the latest nightly 18.0a1 (2012-09-27) on this page: https://addons.mozilla.org/en-US/firefox/language-tools/ Clicking around I didn’t find any dictionaries that were compatible, used the “install anyway” option and got a notice about restart being needed after each one of them.

  10. Axel Hecht {Friday September 28, 2012 @ 6:02 am}

    loe, I filed https://bugzilla.mozilla.org/show_bug.cgi?id=795294, many dictionaries just don’t set their addon type.

  11. Tomer Cohen {Friday September 28, 2012 @ 6:25 pm}

    That’s cool. Let’s change the build scripts to generate langpacks automatically and publish them on AMO.

  12. Axel Hecht {Sunday September 30, 2012 @ 10:17 am}

    And, I wouldn’t care about generation and hosting.

    As for the locale selection experience, I’d need mockups to gauge. Right now, I can only see us moving the language-guessing from the web into the installer.

    Also, langpacks being restartless would only be a small step between today and a scenario in which we can do one binary plus all localization in dynamic packages.

Sorry, comments for this entry are closed at this time.