[44] | 1 | <?php
|
---|
| 2 | /**
|
---|
| 3 | * Copyright 2006, 2007, 2008, 2009 Eric D. Hough (http://ehough.com)
|
---|
| 4 | *
|
---|
| 5 | * This file is part of TubePress (http://tubepress.org)
|
---|
| 6 | *
|
---|
| 7 | * TubePress is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * TubePress is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with TubePress. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | *
|
---|
| 20 | */
|
---|
| 21 |
|
---|
| 22 | function_exists('tubepress_load_classes')
|
---|
| 23 | || require(dirname(__FILE__) . '/../../../tubepress_classloader.php');
|
---|
| 24 | tubepress_load_classes(array('org_tubepress_message_MessageService'));
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * Shared message functionality for org_tubepress_message_MessageService implementations.
|
---|
| 28 | * This class basically provides one additional layer of abstraction between
|
---|
| 29 | * the code and the actual message in the .pot files.
|
---|
| 30 | */
|
---|
| 31 | abstract class org_tubepress_message_AbstractMessageService implements org_tubepress_message_MessageService
|
---|
| 32 | {
|
---|
| 33 | private $_msgs = array(
|
---|
| 34 | "options-page-title" => "TubePress Options",
|
---|
| 35 | "options-page-save-button" => "Save",
|
---|
| 36 | "options-page-intro-text" => "Set default options for the plugin. Each option here can be overridden on a per page/post basis. See the <a href=\"http://tubepress.org/documentation\">documentation</a> for more info.",
|
---|
| 37 | "options-page-donation" => "TubePress is free. But if you enjoy the plugin, and appreciate the hundreds of hours I've spent developing and supporting it, please consider a donation. No amount is too small. Thanks!",
|
---|
| 38 |
|
---|
| 39 | "options-category-title-gallery" => "Which videos?",
|
---|
| 40 | "options-category-title-display" => "Appearance",
|
---|
| 41 | "options-category-title-embedded" => "Embedded Player",
|
---|
| 42 | "options-category-title-meta" => "Meta Display",
|
---|
| 43 | "options-category-title-feed" => "YouTube Feed",
|
---|
| 44 | "options-category-title-advanced" => "Advanced",
|
---|
| 45 |
|
---|
| 46 | "options-title-top_rated" => "Top rated videos from...",
|
---|
| 47 | "options-title-favorites" => "This YouTube user's \"favorites\"",
|
---|
| 48 | "options-title-recently_featured" => "The latest \"featured\" videos on YouTube's homepage",
|
---|
| 49 | "options-title-mobile" => "Videos for mobile phones",
|
---|
| 50 | "options-title-playlist" => "This playlist",
|
---|
| 51 | "options-desc-playlist" => "Limited to 200 videos per playlist. Will usually look something like this: D2B04665B213AE35. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the 'p='. For instance: http://youtube.com/my_playlists?p=D2B04665B213AE35",
|
---|
| 52 | "options-title-most_viewed" => "Most-viewed videos from",
|
---|
| 53 | "options-title-most_linked" => "Most-linked videos",
|
---|
| 54 | "options-title-most_recent" => "Most-recently added videos",
|
---|
| 55 | "options-title-most_discussed" => "Most-discussed videos",
|
---|
| 56 | "options-title-most_responded" => "Most-responded to videos",
|
---|
| 57 | "options-title-views" => "Views",
|
---|
| 58 | "options-title-tag" => "YouTube search for...",
|
---|
| 59 | "options-title-user" => "Videos from this YouTube user",
|
---|
| 60 | "options-desc-tag" => "YouTube limits this mode to 1,000 results",
|
---|
| 61 |
|
---|
| 62 | "options-title-playerLocation" => "Play each video",
|
---|
| 63 | "options-title-descriptionLimit" => "Maximum description length",
|
---|
| 64 | "options-desc-descriptionLimit" => "Maximum number of characters to display in video descriptions. Set to 0 for no limit.",
|
---|
| 65 | "options-title-thumbHeight" => "Height (px) of thumbs",
|
---|
| 66 | "options-desc-thumbHeight" => "Default (and maximum) is 90",
|
---|
| 67 | "options-title-thumbWidth" => "Width (px) of thumbs",
|
---|
| 68 | "options-desc-thumbWidth" => "Default (and maximum) is 120",
|
---|
| 69 | "options-title-relativeDates" => "Use relative dates",
|
---|
| 70 | "options-desc-relativeDates" => "e.g. \"yesterday\" instead of \"November 3, 1980\"",
|
---|
| 71 | "options-title-resultsPerPage" => "Videos per Page",
|
---|
| 72 | "options-desc-resultsPerPage" => "Default is 20. Maximum is 50",
|
---|
| 73 | "options-title-orderBy" => "Order videos by",
|
---|
| 74 | 'options-title-paginationAbove' => 'Show pagination above thumbnails',
|
---|
| 75 | 'options-title-paginationBelow' => 'Show pagination below thumbnails',
|
---|
| 76 | 'options-desc-paginationAbove' => 'Only applies to galleries that span multiple pages',
|
---|
| 77 | 'options-desc-paginationBelow' => 'Only applies to galleries that span multiple pages',
|
---|
| 78 |
|
---|
| 79 | "options-title-autoplay" => "Auto-play videos",
|
---|
| 80 | "options-title-border" => "Show border",
|
---|
| 81 | "options-title-embeddedHeight" => "Max height (px)",
|
---|
| 82 | "options-desc-embeddedHeight" => "Default is 350",
|
---|
| 83 | "options-title-embeddedWidth" => "Max width (px)",
|
---|
| 84 | "options-desc-embeddedWidth" => "Default is 425",
|
---|
| 85 | "options-title-fullscreen" => "Allow fullscreen playback",
|
---|
| 86 | "options-title-genie" => "Enhanced genie menu",
|
---|
| 87 | "options-desc-genie" => "Show the genie menu, if present, when the mouse enters the video area (as opposed to only when the user pushes the \"menu\" button",
|
---|
| 88 | "options-title-loop" => "Loop",
|
---|
| 89 | "options-desc-loop" => "Continue playing the video until the user stops it",
|
---|
| 90 | "options-title-playerColor" => "Main color",
|
---|
| 91 | "options-desc-playerColor" => "Default is 999999",
|
---|
| 92 | "options-title-playerHighlight" => "Highlight color",
|
---|
| 93 | "options-desc-playerHighlight" => "Default is FFFFFF",
|
---|
| 94 | "options-title-showRelated" => "Show related videos",
|
---|
| 95 | "options-desc-showRelated" => "Toggles the display of related videos after a video finishes",
|
---|
| 96 | "options-title-showInfo" => "Show title and rating before video starts",
|
---|
| 97 | "options-title-quality" => "Video quality",
|
---|
| 98 | "options-title-playerImplementation" => "Implementation",
|
---|
| 99 | "options-desc-playerImplementation" => "The brand of the embedded player. Default is \"YouTube\"",
|
---|
| 100 |
|
---|
| 101 | "options-title-author" => "Author",
|
---|
| 102 | "options-title-category" => "Category",
|
---|
| 103 | "options-title-description" => "Description",
|
---|
| 104 | "options-title-id" => "ID",
|
---|
| 105 | "options-title-length" => "Length",
|
---|
| 106 | "options-title-rating" => "Rating",
|
---|
| 107 | "options-title-ratings" => "Ratings",
|
---|
| 108 | "options-title-tags" => "Tags",
|
---|
| 109 | "options-title-title" => "Title",
|
---|
| 110 | "options-title-uploaded" => "Posted",
|
---|
| 111 | "options-title-url" => "URL",
|
---|
| 112 | "options-title-views" => "Views",
|
---|
| 113 |
|
---|
| 114 | "options-title-dateFormat" => "Date format",
|
---|
| 115 | "options-desc-dateFormat" => "Set the textual formatting of date information for videos. See <a href=\"http://us.php.net/date\">date</a> for examples.",
|
---|
| 116 | "options-title-debugging_enabled" => "Enable debugging",
|
---|
| 117 | "options-desc-debugging_enabled" => "If checked, anyone will be able to view your debugging information. This is a rather small privacy risk. If you're not having problems with TubePress, or you're worried about revealing any details of your TubePress pages, feel free to disable the feature.",
|
---|
| 118 | "options-title-keyword" => "Shortcode keyword",
|
---|
| 119 | "options-desc-keyword" => "The word you insert (in plaintext, between square brackets) into your posts/pages to display a gallery.",
|
---|
| 120 | "options-title-randomize_thumbnails" => "Randomize thumbnails",
|
---|
| 121 | "options-desc-randomize_thumbnails" => "Most videos come with several thumbnails. By selecting this option, each time someone views your gallery they will see the same videos with each video's thumbnail randomized",
|
---|
| 122 | "options-title-nofollowLinks" => "Add rel=nofollow to most YouTube links",
|
---|
| 123 | "options-desc-nofollowLinks" => "Prevents search engines from indexing outbound links to youtube.com. The only exception is the link to a video's original page on YouTube.",
|
---|
| 124 |
|
---|
| 125 | "options-title-filter_racy" => "Filter \"racy\" content",
|
---|
| 126 | "options-desc-filter_racy" => "Don't show videos that may not be suitable for minors.",
|
---|
| 127 | "options-title-clientKey" => "YouTube API Client ID",
|
---|
| 128 | "options-desc-clientKey" => "YouTube will use this client ID for logging and debugging purposes if you experience a service problem on their end. You can register a new client ID <a href=\"http://code.google.com/apis/youtube/dashboard/\">here</a>. Don't change this unless you know what you're doing.",
|
---|
| 129 | "options-title-developerKey" => "YouTube API Developer Key",
|
---|
| 130 | "options-desc-developerKey" => "YouTube will use this developer key for logging and debugging purposes if you experience a service problem on their end. You can register a new client ID and developer key <a href=\"http://code.google.com/apis/youtube/dashboard/\">here</a>. Don't change this unless you know what you're doing.",
|
---|
| 131 | "options-title-cacheEnabled" => "Enable request cache",
|
---|
| 132 | "options-desc-cacheEnabled" => "Store YouTube responses locally for 1 hour. Each response is on the order of a few hundred KB, so leaving the cache enabled will significantly reduce load times for your galleries at the slight expense of freshness.",
|
---|
| 133 | "options-title-embeddableOnly" => "Only retrieve embeddable videos",
|
---|
| 134 | "options-desc-embeddableOnly" => "Some videos have embedding disabled. Checking this option will exclude these videos from your galleries.",
|
---|
| 135 |
|
---|
| 136 | "player-normal" => "normally (at the top of your gallery)",
|
---|
| 137 | "player-popup" => "in a popup window",
|
---|
| 138 | "player-youtube" => "from the original YouTube page",
|
---|
| 139 | "player-shadowbox" => "with Shadowbox",
|
---|
| 140 | "player-jqmodal" => 'with jqModal',
|
---|
| 141 | 'player-colorbox' => 'with Colorbox',
|
---|
| 142 |
|
---|
| 143 | "order-relevance" => "relevance",
|
---|
| 144 | "order-viewCount" => "view count",
|
---|
| 145 | "order-rating" => "rating",
|
---|
| 146 | "order-updated" => "date published",
|
---|
| 147 | "order-random" => "randomly",
|
---|
| 148 |
|
---|
| 149 | "timeFrame-today" => "today",
|
---|
| 150 | "timeFrame-this_week" => "this week",
|
---|
| 151 | "timeFrame-this_month" => "this month",
|
---|
| 152 | "timeFrame-all_time" => "all time",
|
---|
| 153 |
|
---|
| 154 | "video-author" => "Author",
|
---|
| 155 | "video-category" => "Category",
|
---|
| 156 | "video-description" => "",
|
---|
| 157 | "video-id" => "ID",
|
---|
| 158 | "video-length" => "",
|
---|
| 159 | "video-rating" => "Rating",
|
---|
| 160 | "video-ratings" => "Ratings",
|
---|
| 161 | "video-tags" => "Tags",
|
---|
| 162 | "video-title" => "",
|
---|
| 163 | "video-uploaded" => "Posted",
|
---|
| 164 | "video-url" => "URL",
|
---|
| 165 | "video-views" => "Views",
|
---|
| 166 |
|
---|
| 167 | "validation-int-type" => "%s can only take on integer values. You supplied %s.",
|
---|
| 168 | "validation-int-range" => "%s must be between %d and %d. You supplied %d.",
|
---|
| 169 | "validation-time" => "%s must be one of \"today\", \"this_week\", \"this_month\", \"all_time\". You supplied %s.",
|
---|
| 170 | "validation-order" => "%s must be on of \"relevance\", \"viewCount\", \"rating\", \"updated\", \"random\". You supplied %s.",
|
---|
| 171 | "validation-text" => "%s must be a string. You supplied %s.",
|
---|
| 172 |
|
---|
| 173 | "next" => "next",
|
---|
| 174 | "prev" => "prev",
|
---|
| 175 |
|
---|
| 176 | "widget-description" => "Displays YouTube videos in your sidebar using TubePress",
|
---|
| 177 | "widget-tagstring-description" => "TubePress shortcode for the widget. See the <a href=\"http://tubepress.org/documentation\"> documentation</a>.",
|
---|
| 178 |
|
---|
| 179 | "quality-normal" => "Normal",
|
---|
| 180 | "quality-high" => "High",
|
---|
| 181 | "quality-higher" => "Higher",
|
---|
| 182 | "quality-highest" => "Highest",
|
---|
| 183 |
|
---|
| 184 | "safeSearch-none" => "none",
|
---|
| 185 | "safeSearch-moderate" => "moderate",
|
---|
| 186 | "safeSearch-strict" => "strict",
|
---|
| 187 |
|
---|
| 188 | "playerImplementation-youtube" => "YouTube",
|
---|
| 189 | "playerImplementation-longtail" => "JW FLV Media Player (by Longtail Video)"
|
---|
| 190 | );
|
---|
| 191 |
|
---|
| 192 | /**
|
---|
| 193 | * Takes a message key and provides the actual message to translate
|
---|
| 194 | *
|
---|
| 195 | * @param string $msgId The message id
|
---|
| 196 | *
|
---|
| 197 | * @return string The message translation key for gettext
|
---|
| 198 | */
|
---|
| 199 | protected function _keyToMessage($msgId)
|
---|
| 200 | {
|
---|
| 201 | if (array_key_exists($msgId, $this->_msgs)) {
|
---|
| 202 | return $this->_msgs[$msgId];
|
---|
| 203 | }
|
---|
| 204 | return "";
|
---|
| 205 | }
|
---|
| 206 | }
|
---|