Commit 4893ca29 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[TASK][DOC] How to download custom l10n packages in TYPO3

Change-Id: I9725d10853c993d81985d06e48877b4398396f10
Reviewed-on: http://review.typo3.org/41569

Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent ffbf87d8
......@@ -7,18 +7,22 @@ This document describes how to install a personal Pootle translation server.
Requirements
============
* `Ansible <http://docs.ansible.com/>`_. We use Ansible to easily deploy Pootle and scripts to the server. The deployment receipes and scripts are found in this Git project.
* Linux server. We will use a blank `Debian AMD64 <https://www.debian.org/CD/netinst/>`_ virtual machine to start with. Installation was done with only a SSH server running and command :command:`sudo` being available.
- `Ansible <http://docs.ansible.com/>`_. We use Ansible to easily deploy Pootle and scripts to the server.
The deployment receipes and scripts are found in this Git project.
- Linux server. We will use a blank `Debian AMD64 <https://www.debian.org/CD/netinst/>`_ virtual
machine to start with. Installation was done with only a SSH server running and command :command:`sudo`
being available.
Installing Ansible
------------------
Ansible is needed on a so-called "Control Machine"; that is, a computer that will control the Pootle server. This is typically your personal computer.
We will install Ansible from source since this is the recommended method. Just pick your preferred user directory and:
Ansible is needed on a so-called "Control Machine"; that is, a computer that will control the Pootle
server. This is typically your personal computer.
::
We will install Ansible from source since this is the recommended method. Just pick your preferred
user directory and::
$ sudo easy_install pip
$ sudo pip install paramiko PyYAML Jinja2 httplib2 six
......@@ -44,16 +48,57 @@ Run::
Administrating Pootle
---------------------
In default Pootle installations, an admin account (the password matches the username) is created with superuser privileges which can be used to administer the whole site.
In default Pootle installations, an admin account (the password matches the username) is created with
superuser privileges which can be used to administer the whole site.
.. note::
It's highly recommended that you change the password for the default admin account on your first login, or even delete the account
and assign superuser rights to another user.
.. caution::
It's highly recommended that you change the password for the default admin account on your first
login, or even delete the account and assign superuser rights to another user.
When logging onto your server, you are encouraged to work as user "pootle" and follow the guide::
$ sudo su - pootle
Fetching private localisation packages within TYPO3
---------------------------------------------------
Once you have your private Pootle server, and use the scripts to regularly (e.g., daily) prepare
localisation packages, you will need to hook into TYPO3 to automatically change the mirror URL it
uses to fetch localisation packages so that your own server is used instead.
To do that, take your extension, and within :file:`ext_localconf.php`, add::
/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class);
$signalSlotDispatcher->connect(
version_compare(TYPO3_version, '7.0', '<')
? 'TYPO3\\CMS\\Lang\\Service\\UpdateTranslationService'
: 'TYPO3\\CMS\\Lang\\Service\\TranslationService',
'postProcessMirrorUrl',
'MyCompany\\MyExtension\\Slots\\CustomMirror',
'postProcessMirrorUrl'
);
then, create file:`my_extension/Classes/Slots/CustomMirror.php`::
<?php
namespace MyCompany\MyExtension\Slots;
class CustomMirror {
/**
* Post-processes the mirror URL for a given extension key.
*
* @param string $extensionKey
* @param string &$mirrorUrl
*/
public function postProcessMirrorUrl($extensionKey, &$mirrorUrl) {
if ($extensionKey === 'my_extension') {
$mirrorUrl = 'http://my-custom-server.example.com/l10n_ter';
}
}
}
Migrating data from production
------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment