diff options
Diffstat (limited to 'plugins/Realtime/RealtimePlugin.php')
-rw-r--r-- | plugins/Realtime/RealtimePlugin.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 352afcf78..7a40cdca3 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -106,7 +106,9 @@ class RealtimePlugin extends Plugin $realtimeUI = ' RealtimeUpdate.initActions("'.$url.'", "'.$timeline.'", "'. $pluginPath .'");'; } + $i18n = $this->_getMessages(); $script = ' $(document).ready(function() { '. + 'RealtimeUpdate._messages=' . json_encode($i18n) . ';' . $realtimeUI. $this->_updateInitialize($timeline, $user_id). '}); '; @@ -326,6 +328,28 @@ class RealtimePlugin extends Plugin return array('plugins/Realtime/realtimeupdate.js'); } + /** + * Any i18n messages that need to be loaded at runtime. + * @return array of string key to output text string pairs + */ + function _getMessages() + { + return array( + // TRANS: Text label for realtime view "play" button, usually replaced by an icon. + 'play' => _m('BUTTON', 'Play'), + // TRANS: Tooltip for realtime view "play" button. + 'play_tooltip' => _m('TOOLTIP', 'Play'), + // TRANS: Text label for realtime view "pause" button + 'pause' => _m('BUTTON', 'Pause'), + // TRANS: Tooltip for realtime view "pause" button + 'pause_tooltip' => _m('TOOLTIP', 'Pause'), + // TRANS: Text label for realtime view "popup" button, usually replaced by an icon. + 'popup' => _m('BUTTON', 'Pop up'), + // TRANS: Tooltip for realtime view "popup" button. + 'popup_tooltip' => _m('TOOLTIP', 'Pop up in a window'), + ); + } + function _updateInitialize($timeline, $user_id) { return "RealtimeUpdate.init($user_id, \"$this->replyurl\", \"$this->favorurl\", \"$this->repeaturl\", \"$this->deleteurl\"); "; |