Implementing Pontoon in a Mozilla project

Pontoon 是一个基于 web 的所见即所得(WYSIWYG)的本地化(l10n)工具。在 Mozilla ,我们都是使用 Pontoon 去本地化众多的 Mozilla 项目和被称为 Gaia 的 Firefox OS app 接口。Pontoon 是一个非常简单、直接的工具,本地化人员只需要很少甚至没有技术能力就可以使用它,这将减少项目本地化版本的发布时间。下面我们来谈谈怎么将 Pontoon 加入到你的 Mozilla 项目里。

Would you like to improve Pontoon? Learn how to get involved on GitHub.

Just getting started with your project l10n? Check out the wiki on getting your project localized.

A. Make your project localizable

We realize that these are already considered to be standard best practices for localizing projects at Mozilla, but we feel it's good to add them here as a little reminder.

  1. Ensure that your project supports one of the l10n frameworks (gettext, XLIFF, L20n, lang, properties, etc.).
  2. Extract localizable strings into resource files.
  3. Push resource files to a repository (SVN, HG, Git).
    • Individual locale folders must be located at the same nesting level of the directory tree. Source locale needs to be called templates, en-US, en-us or en. If multiple folders with such name exist in the repository and contain files in a supported file format, the first one will be used. You may want to put all locale folders in a dedicated locales folder for this purpose. Locale code must not be part of the file name.
    • Correct pattern:
    • Incorrect pattern:
  4. Make sure Pontoon has write access to the repository.

B. (optional) Enable in-page localization of your web project

  1. Link a script from your HTML <body> element, so Pontoon can talk to your site, detect content and make it localizable in place. You only need to do this in the environment that will be used for in-page localization, e.g. staging server:
  2. If your site uses CSP, please make sure that the following is permitted for domain
    1. loading inside iframe
    2. loading remote CSS
    3. loading remote images
  3. If your site uses the X-Frame-Options header, please make sure loading inside iframe is permitted for domain
  4. Make sure your site supports HTTPS. It's free, automated and open. Let's encrypt!

C. Add your project to Pontoon

Your project is now ready to be set up in Pontoon. Please file a bug in Localization Infrastructure and Tools :: Administration / Setup and provide the following information:

  • Project name
  • Repository URL
  • List of requested locales
  • Website URL, including all subpage URLs (only if using in-page localization)

For more details, please get in touch with the Project Management Team.