Integrate with version control system

Note

Pootle FS will work out of the box when synchronizing with the local file system. If this is the case you can safely skip the integration with version control.

If the translations for your project are stored in a version control system (VCS in short), then might be a good idea to directly integrate with the VCS. The following instructions work either if you project is already setup to use the localfs Pootle FS backend, or if you are creating and setting a new project to directly work with the VCS.

Install Pootle FS plugins for VCS

Pootle FS provides support for different VCS systems through plugins, so in order for Pootle to work with a specific VCS it is necessary to install its plugin. For example for Git:

  • Install the plugin:

    (env) $ pip install --pre --process-dependency-links Pootle[git]
    
  • Add the plugin to INSTALLED_APPS in your custom Pootle settings:

    INSTALLED_APPS += ['pootle_fs_git']
    

This is done once for the whole Pootle server.

Connect Pootle FS with VCS repository

The version control system also must provide access for Pootle FS to synchronize:

  • Create a SSH key:

    $ sudo -u USER-RUNNING-POOTLE ssh-keygen -b 4096
    
  • Tell your upstream repository about the public key, allowing Pootle to be able to push to the repository. For example for GitHub:

    • Either use the public key as a Deploy key for the repository on GitHub,
    • Or (preferred) add the public key to a GitHub user’s SSH and GPG Keys. In most cases you want to create a specific user in GitHub for Pootle.

Configure the project to use VCS

After installing the necessary Pootle FS plugin and connecting Pootle FS with the VCS repository, it is now necessary to alter the project configuration:

  • Deactivate any existing automatic synchronization (like cron entries).

  • Disable the project to prevent changes from translators.

  • Ensure you have synchronized all the translation files to disk.

  • Ensure you have committed all the translation files to your version control system.

  • Set the project’s Filesystem backend to the appropriate VCS backend.

  • Set the URL to your version control repository in the project’s Path or URL, e.g. git@github.com:user/repo.git.

  • Synchronize as follows:

    (env) $ pootle fs fetch $MYPROJECT
    (env) $ pootle fs sync $MYPROJECT
    
  • Enable the project again.

  • Enable automatic synchronization again.

Your project is now ready to synchronize with the configured repository using Pootle FS. You might want to learn more about how to use Pootle FS.