Feature #50467

Support custom translation servers for extensions

Added by Xavier Perseguers over 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Category:
Localization
Target version:
Start date:
2013-07-26
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.4
Tags:
Complexity:
easy
Sprint Focus:

Description

With the use of XLIFF and the freely available Pootle [1] translation server, companies and individuals may easily set up a custom translation server for their extensions.

TYPO3 should be able to fetch localization packages from those custom translation servers.

The proposed implementation will provide a signal that may be implemented like this to override the mirror URL to be used to fetch localization packages for a given extension:

EXT:myext/localconf.php:

/** @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher $signalSlotDispatcher */
$signalSlotDispatcher = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher');

$signalSlotDispatcher->connect(
    version_compare(TYPO3_version, '7.0', '<')
        ? 'TYPO3\\CMS\\Lang\\Service\\UpdateTranslationService'
        : 'TYPO3\\CMS\\Lang\\Service\\TranslationService',
    'postProcessMirrorUrl',
    'Company\\Extension\Slots\\CustomMirror',
    'postProcessMirrorUrl'
);

EXT:myext/Classes/Slots/CustomMirror.php:

<?php
namespace Company\Extensions\Slots;
class CustomMirror {

    /** @var string */
    protected static $extKey = 'myext';

    public function postProcessMirrorUrl($extensionKey, &$mirrorUrl) {
        if ($extensionKey === self::$extKey) {
            $mirrorUrl = 'http://mycompany.tld/typo3-packages/';
        }
    }

}


Related issues

Related to TYPO3 Core - Bug #66928: Cannot use custom mirror URL anymore for XLIFFClosed2015-05-13

Actions
Related to Translation Team - Bug #78233: Bug in the french translation file for Powermail extensionRejectedXavier Perseguers2016-10-11

Actions
Related to TYPO3 Core - Bug #93889: Cannot modify language pack remote base URLClosedChristian Kuhn2021-04-09

Actions
#1

Updated by Xavier Perseguers over 8 years ago

Expected file structure on server:

https://mycompany.tld/typo3-packages/
 `-- <first-letter-of-extension-key>
     `-- <second-letter-of-extension-key>
         `-- <extension-key>-l10n
             |-- <extension-key>-l10n-de.zip
             |-- <extension-key>-l10n-fr.zip
             |-- <extension-key>-l10n-it.zip
             `-- <extension-key>-l10n.xml

in our example:

https://mycompany.tld/typo3-packages/
 `-- m
     `-- y
         `-- myext-l10n
             |-- myext-l10n-de.zip
             |-- myext-l10n-fr.zip
             |-- myext-l10n-it.zip
             `-- myext-l10n.xml

Example of myext-l10n.xml:

<?xml version="1.0" standalone="yes" ?>
<TERlanguagePackIndex>
    <meta>
        <timestamp>1374841386</timestamp>
        <date>2013-07-26 14:23:06</date>
    </meta>
    <languagePackIndex>
        <languagepack language="de">
            <md5>1cc7046c3b624ba1fb1ef565343b84a1</md5>
        </languagepack>
        <languagepack language="fr">
            <md5>f00f73ae5c43cb68392e6c508b65de7a</md5>
        </languagepack>
        <languagepack language="it">
            <md5>cd59530ce1ee0a38e6309544be6bcb3d</md5>
        </languagepack>
    </languagePackIndex>
</TERlanguagePackIndex>

#2

Updated by Gerrit Code Review over 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22587

#3

Updated by Xavier Perseguers over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#4

Updated by Markus Klein about 8 years ago

Can we add this to the official documentation somewhere?

I find it a bit odd that the news article for 6.2alpha3 refers to this place on how to use this feature.

#5

Updated by Xavier Perseguers about 8 years ago

Markus, please see the related task for this ticket: #50505

#6

Updated by Xavier Perseguers over 6 years ago

  • Description updated (diff)

Adapted sample code when using TYPO3 7.x

#7

Updated by Riccardo De Contardi about 4 years ago

  • Status changed from Resolved to Closed
#8

Updated by Xavier Perseguers 8 months ago

  • Related to Bug #93889: Cannot modify language pack remote base URL added

Also available in: Atom PDF