PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 2.0.0
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v2.0.0
4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / freemius / includes / l10n.php
embedpress / freemius / includes Last commit date
debug 9 years ago entities 9 years ago managers 9 years ago sdk 9 years ago supplements 9 years ago class-freemius-abstract.php 9 years ago class-freemius.php 9 years ago class-fs-api.php 9 years ago class-fs-logger.php 9 years ago class-fs-plugin-updater.php 9 years ago class-fs-security.php 9 years ago fs-core-functions.php 9 years ago fs-essential-functions.php 9 years ago fs-plugin-info-dialog.php 9 years ago i18n.php 9 years ago index.php 9 years ago l10n.php 9 years ago
l10n.php
251 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
6 * @since 1.2.1.6
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * Retrieve the translation of $text.
15 *
16 * @since 1.2.1.6
17 *
18 * @param string $text
19 *
20 * @return string
21 */
22 function _fs_text( $text ) {
23 return translate( $text, 'freemius' );
24 }
25
26 /**
27 * Retrieve the translation of $text and escapes it for safe use in an attribute.
28 *
29 * @since 1.2.1.6
30 *
31 * @param string $text
32 *
33 * @return string
34 */
35 function _fs_esc_attr( $text ) {
36 return esc_attr( translate( $text, 'freemius' ) );
37 }
38
39 /**
40 * Retrieve the translation of $text and escapes it for safe use in HTML output.
41 *
42 * @since 1.2.1.6
43 *
44 * @param string $text
45 *
46 * @return string
47 */
48 function _fs_esc_html( $text ) {
49 return esc_html( translate( $text, 'freemius' ) );
50 }
51
52 /**
53 * Display translated text.
54 *
55 * @since 1.2.0
56 *
57 * @param string $text
58 */
59 function _fs_echo( $text ) {
60 echo translate( $text, 'freemius' );
61 }
62
63 /**
64 * Display translated text that has been escaped for safe use in an attribute.
65 *
66 * @since 1.2.1.6
67 *
68 * @param string $text
69 */
70 function _fs_esc_attr_echo( $text ) {
71 echo esc_attr( translate( $text, 'freemius' ) );
72 }
73
74 /**
75 * Display translated text that has been escaped for safe use in HTML output.
76 *
77 * @since 1.2.1.6
78 *
79 * @param string $text
80 */
81 function _fs_esc_html_echo( $text ) {
82 echo esc_html( translate( $text, 'freemius' ) );
83 }
84
85 /**
86 * Retrieve translated string with gettext context.
87 *
88 * Quite a few times, there will be collisions with similar translatable text
89 * found in more than two places, but with different translated context.
90 *
91 * By including the context in the pot file, translators can translate the two
92 * strings differently.
93 *
94 * @since 1.2.1.6
95 *
96 * @param string $text
97 * @param string $context
98 *
99 * @return string
100 */
101 function _fs_x( $text, $context ) {
102 return translate_with_gettext_context( $text, $context, 'freemius' );
103 }
104
105 /**
106 * Display translated string with gettext context.
107 *
108 * @since 1.2.1.6
109 *
110 * @param string $text
111 * @param string $context
112 */
113 function _fs_ex( $text, $context ) {
114 // Avoid misleading Theme Check warning.
115 $fn = '_x';
116 echo $fn( $text, $context, 'freemius' );
117 }
118
119 /**
120 * Translate string with gettext context, and escapes it for safe use in an attribute.
121 *
122 * @since 1.2.1.6
123 *
124 * @param string $text
125 * @param string $context
126 *
127 * @return string
128 */
129 function _fs_esc_attr_x( $text, $context ) {
130 return esc_attr( translate_with_gettext_context( $text, $context, 'freemius' ) );
131 }
132
133 /**
134 * Translate string with gettext context, and escapes it for safe use in HTML output.
135 *
136 * @since 2.9.0
137 *
138 * @param string $text
139 * @param string $context
140 *
141 * @return string
142 */
143 function _fs_esc_html_x( $text, $context ) {
144 return esc_html( translate_with_gettext_context( $text, $context, 'freemius' ) );
145 }
146
147 /**
148 * Translates and retrieves the singular or plural form based on the supplied number.
149 *
150 * @since 1.2.1.6
151 *
152 * @param string $single
153 * @param string $plural
154 * @param int $number
155 *
156 * @return string
157 */
158 function _fs_n( $single, $plural, $number ) {
159 $translations = get_translations_for_domain( 'freemius' );
160 $translation = $translations->translate_plural( $single, $plural, $number );
161
162 /**
163 * Filters the singular or plural form of a string.
164 *
165 * @since WP 2.2.0
166 *
167 * @param string $translation
168 * @param string $single
169 * @param string $plural
170 * @param string $number
171 * @param string $domain
172 */
173 return apply_filters( 'ngettext', $translation, $single, $plural, $number, 'freemius' );
174 }
175
176 /**
177 * Translates and retrieves the singular or plural form based on the supplied number, with gettext context.
178 *
179 * @since 1.2.1.6
180 *
181 * @param string $single
182 * @param string $plural
183 * @param int $number
184 * @param string $context
185 *
186 * @return string
187 */
188 function _fs_nx($single, $plural, $number, $context ) {
189 $translations = get_translations_for_domain( 'freemius' );
190 $translation = $translations->translate_plural( $single, $plural, $number, $context );
191
192 /**
193 * Filters the singular or plural form of a string with gettext context.
194 *
195 * @since WP 3.0
196 *
197 * @param string $translation
198 * @param string $single
199 * @param string $plural
200 * @param string $number
201 * @param string $context
202 * @param string $domain
203 */
204 return apply_filters( 'ngettext_with_context', $translation, $single, $plural, $number, $context, 'freemius' );
205 }
206
207 /**
208 * Registers plural strings in POT file, but does not translate them.
209 *
210 * Used when you want to keep structures with translatable plural
211 * strings and use them later when the number is known.
212 *
213 * @since 1.2.1.6
214 *
215 * @param string $singular
216 * @param string $plural
217 *
218 * @return array
219 */
220 function _fs_n_noop( $singular, $plural ) {
221 return array(
222 'singular' => $singular,
223 'plural' => $plural,
224 'context' => null,
225 'domain' => 'freemius'
226 );
227 }
228
229 /**
230 * Registers plural strings with gettext context in POT file, but does not translate them.
231 *
232 * Used when you want to keep structures with translatable plural
233 * strings and use them later when the number is known.
234 *
235 * @since 1.2.1.6
236 *
237 * @param string $singular
238 * @param string $plural
239 * @param string $context
240 *
241 * @return array
242 */
243 function _fs_nx_noop( $singular, $plural, $context ) {
244 return array(
245 'singular' => $singular,
246 'plural' => $plural,
247 'context' => $context,
248 'domain' => 'freemius'
249 );
250 }
251