Skip to content

Commit 1a6fe25

Browse files
committed
Media Player - Allow to set language translation file in Extension configuration
1 parent 6360928 commit 1a6fe25

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Classes/ViewHelpers/MediaPlayerConfigViewHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public static function renderStatic(
3939
$id = $arguments['id'];
4040
$inputSettings = $arguments['settings'];
4141

42-
// Whitelist keys to keep out keys from settings array
42+
// Whitelist keys to keep out stuff such as playerTranslationsFile
4343
$allowedKeys = ['shareButtons', 'screenshotCaptions', 'constants', 'equalizer'];
4444
$result = array_intersect_key($inputSettings, array_flip($allowedKeys));
4545

4646
// Add translations
47-
$result['lang'] = self::getTranslations('EXT:dlf/Resources/Private/Language/locallang_media.xlf');
47+
$result['lang'] = self::getTranslations($inputSettings['playerTranslations']['baseFile'] ?? 'EXT:dlf/Resources/Private/Language/locallang_media.xlf');
4848

4949
// Resolve paths
5050
foreach ($result['shareButtons'] ?? [] as $key => $button) {

Documentation/Features/MediaPlayer/Configuration.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ For information on equalizer configuration, see :ref:`the equalizer subpage <eq_
6161
.. code-block:: typoscript
6262
6363
plugin.tx_dlf_mediaplayer {
64+
settings {
65+
playerTranslations {
66+
// Language file of player localization strings without language prefix
67+
baseFile = EXT:dlf/Resources/Private/Language/locallang_media.xlf
68+
}
6469
6570
// Share buttons to be shown in bookmark modal
6671
// Both numeric and non-numeric keys may be used

0 commit comments

Comments
 (0)