Mozilla's Localization Platform
Перейти к файлу
Matjaž Horvat 8875b879cb Merge 2012-08-30 16:59:31 +02:00
bin changed all static use to use django-compressor instead, r=kumar 2012-06-12 17:08:44 -07:00
clients Move bookmarklet and jetpack inside clients folder 2012-04-12 01:27:27 +02:00
docs Update copyright in docs/conf.py 2012-07-27 09:18:41 -04:00
hooks Remove Pontoon meta tag 2012-08-18 16:57:41 +02:00
lib/product_details_json Add server contents to / 2012-04-11 23:34:02 +02:00
media Updates related to Playdoh update (media -> static, django-compressor) 2012-06-20 21:39:02 +02:00
migrations Add server contents to / 2012-04-11 23:34:02 +02:00
pontoon Merge 2012-08-30 16:59:31 +02:00
puppet Rename /apps to /pontoon and move /apps/pontoon contents to /pontoon/base 2012-06-21 10:55:46 +02:00
requirements Add server contents to / 2012-04-11 23:34:02 +02:00
vendor@1c485522ec upgrade to playdoh-lib for django-1.4.1 2012-08-02 08:45:22 -07:00
vendor-local Add pysvn 2012-08-14 17:08:31 +02:00
wsgi Add server contents to / 2012-04-11 23:34:02 +02:00
.gitignore Do not break if no Microsoft Translator API provided. Move all local settings to Django. 2012-06-04 23:07:25 +02:00
.gitmodules Add pysvn 2012-08-14 17:08:31 +02:00
LICENSE Fix license 2012-07-27 09:17:04 -04:00
MANIFEST.in Add server contents to / 2012-04-11 23:34:02 +02:00
README.md Shorten pontoon.js URL 2012-07-19 00:46:09 +02:00
Vagrantfile Add server contents to / 2012-04-11 23:34:02 +02:00
manage.py Merge 2012-08-30 16:59:31 +02:00
setup.py Add server contents to / 2012-04-11 23:34:02 +02:00
vagrantconfig.yaml Add server contents to / 2012-04-11 23:34:02 +02:00
vagrantconfig_local.yaml-dist Add server contents to / 2012-04-11 23:34:02 +02:00

README.md

Pontoon

Pontoon is a live website localization tool. Instead of extracting original strings and then merging translated strings back, Pontoon can turn any website into editable mode using the contentEditable attribute.

This enables localizers to translate websites in-place with context and spatial limitations right in front of them. A full list of extracted strings is also available, to help with strings that are hard to reach, e.g. error messages and the <title> tag.

To enable localization of your site with Pontoon, simply include the script located at /static/pontoon.js to overcome cross frame scripting, and Pontoon will autodetect strings. Or, to make the best out of Pontoon, fully prepare your site with hooks that will mark strings for localization and include all the neccessary tags.

Installation

Pontoon uses Playdoh, which supports running web apps in virtual machines. This is an ideal way to get started developing Pontoon quickly without dealing with dependancies, compiling things and polluting your development system.

  1. Install VirtualBox by Oracle to run our VM.
  2. Install Vagrant to easily customize and access our VM:
  • gem install vagrant (requires Ruby and gem, but most modern *NIX systems already have them)
  1. Clone Pontoon or your fork:
  • git clone --recursive git://github.com/mathjazz/pontoon.git
  1. Run a virtual development environment from your working copy directory:
  • cd pontoon
  • vagrant up

If youre running it for the first time, vagrant up will take a few minutes to download base VM image, boot Ubuntu VM, install all the necessary packages and run initialization scripts.

Usage

You can edit files in your working copy directory (/pontoon) locally and they will automatically show up under /home/vagrant/pontoon in the VM without any weird FTPing.

  1. In not running yet, start the VM from your working copy directory:
  • vagrant up
  1. Enter VM:
  • vagrant ssh
  1. Run the development web server (in VM):
  • cd pontoon
  • python manage.py runserver 0.0.0.0:8000
  1. Point your web browser to http://localhost:8000.

Note that youll need to explicitly set the host and port for runserver to be accessible from outside the VM. Vagrant setup already forwards port 8000 (the usual Django development port).

Local settings

Django local settings file should be stored at /pontoon/settings/local.py. Copy contents from /pontoon/settings/local.py-dist.

  • SITE_URL: required for BrowserID, set if different from http://127.0.0.1:8000.
  • SESSION_COOKIE_SECURE = False: uncomment if running a local development install without HTTPS to disable HTTPS-only cookies.
  • MICROSOFT_TRANSLATOR_API_KEY: set to a valid Microsoft Translator API key to use machine translation.

Hooks

To use PHP hooks:

  • Link /hooks/ to your web server's document root.
  • Store Pontoon application path in the $path variable in /hooks/php/local-settings.php if different from http://localhost:8000.

To extract strings, run:

  • xgettext -L PHP --keyword=_w --from-code=UTF-8 --output=messages.pot *.php

Updates

To sync your repository with upstream changes, just update the code using git:

git pull && git submodule sync --quiet && git submodule update --init --recursive

To only update Playdoh and submodules, do:

git pull playdoh master && git submodule foreach git pull origin master

Get involved

License

This software is licensed under the New BSD License. For more information, read the file LICENSE.