PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.0.2
Booking for Appointments and Events Calendar – Amelia v2.0.2
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / src / Application / Services / Helper / HelperService.php
ameliabooking / src / Application / Services / Helper Last commit date
HelperService.php 6 months ago
HelperService.php
1060 lines
1 <?php
2
3 namespace AmeliaBooking\Application\Services\Helper;
4
5 use AmeliaBooking\Domain\Services\DateTime\DateTimeService;
6 use AmeliaBooking\Domain\Services\Settings\SettingsService;
7 use AmeliaBooking\Domain\ValueObjects\Number\Integer\LoginType;
8 use AmeliaBooking\Infrastructure\Common\Container;
9 use AmeliaVendor\Firebase\JWT\JWT;
10 use AmeliaVendor\phpseclib3\Crypt\PublicKeyLoader;
11 use AmeliaVendor\phpseclib3\Crypt\RSA;
12 use Interop\Container\Exception\ContainerException;
13 use DateTime;
14 use Exception;
15
16 /**
17 * Class HelperService
18 *
19 * @package AmeliaBooking\Application\Services\Helper
20 */
21 class HelperService
22 {
23 private $container;
24
25 /**
26 * HelperService constructor.
27 *
28 * @param Container $container
29 */
30 public function __construct(Container $container)
31 {
32 $this->container = $container;
33 }
34
35 /**
36 * Returns formatted price based on price plugin settings
37 *
38 * @param int|float $price
39 *
40 * @return string
41 * @throws ContainerException
42 */
43 public function getFormattedPrice($price)
44 {
45 /** @var SettingsService $settingsService */
46 $settingsService = $this->container->get('domain.settings.service');
47
48 $paymentSettings = $settingsService->getCategorySettings('payments');
49
50 // Price Separators
51 $thousandSeparatorMap = [',', '.', ' ', ' '];
52
53 $decimalSeparatorMap = ['.', ',', '.', ','];
54
55 $thousandSeparator = $thousandSeparatorMap[$paymentSettings['priceSeparator'] - 1];
56
57 $decimalSeparator = $decimalSeparatorMap[$paymentSettings['priceSeparator'] - 1];
58
59 // Price Prefix
60 $pricePrefix = '';
61 if ($paymentSettings['priceSymbolPosition'] === 'before') {
62 $pricePrefix = $paymentSettings['symbol'];
63 } elseif ($paymentSettings['priceSymbolPosition'] === 'beforeWithSpace') {
64 $pricePrefix = $paymentSettings['symbol'] . ' ';
65 }
66
67 // Price Suffix
68 $priceSuffix = '';
69 if ($paymentSettings['priceSymbolPosition'] === 'after') {
70 $priceSuffix = $paymentSettings['symbol'];
71 } elseif ($paymentSettings['priceSymbolPosition'] === 'afterWithSpace') {
72 $priceSuffix = ' ' . $paymentSettings['symbol'];
73 }
74
75 $formattedNumber = number_format(
76 $price,
77 $paymentSettings['priceNumberOfDecimals'],
78 $decimalSeparator,
79 $thousandSeparator
80 );
81
82 return $pricePrefix . $formattedNumber . $priceSuffix;
83 }
84
85 /**
86 * @param int $seconds
87 *
88 * @return string
89 */
90 public function secondsToNiceDuration($seconds)
91 {
92 $hours = floor($seconds / 3600);
93
94 $minutes = $seconds / 60 % 60;
95
96 return ($hours ? ($hours . 'h ') : '') . ($hours && $minutes ? ' ' : '') . ($minutes ? ($minutes . 'min') : '');
97 }
98
99 /**
100 * @param string $email
101 * @param string $secret
102 * @param int $expireTimeStamp
103 * @param int $loginType
104 *
105 * @return mixed
106 * @throws Exception
107 */
108 public function getGeneratedJWT($email, $secret, $expireTimeStamp, $loginType)
109 {
110 $now = new DateTime();
111
112 $data = [
113 'iss' => AMELIA_SITE_URL,
114 'iat' => $now->getTimestamp(),
115 'email' => $email,
116 'wp' => $loginType
117 ];
118
119 if ($expireTimeStamp !== null) {
120 $data['exp'] = $expireTimeStamp;
121 }
122
123 return JWT::encode($data, $secret, 'HS256');
124 }
125
126 /**
127 * @param string $email
128 * @param string $type
129 * @param string $dateStartString
130 * @param string $dateEndString
131 * @param string $locale
132 *
133 * @return string
134 *
135 * @throws Exception
136 */
137 public function getCustomerCabinetUrl($email, $type, $dateStartString, $dateEndString, $locale, $changePass = false)
138 {
139 /** @var SettingsService $cabinetSettings */
140 $cabinetSettings = $this->container->get('domain.settings.service')->getSetting('roles', 'customerCabinet');
141
142 $cabinetPlaceholder = '';
143
144 $usedLanguages = $this->container->get('domain.settings.service')->getSetting('general', 'usedLanguages');
145
146 $cabinetURL = trim(
147 $locale &&
148 $usedLanguages &&
149 in_array($locale, $usedLanguages) &&
150 !empty($cabinetSettings['translations']['url'][$locale]) ?
151 $cabinetSettings['translations']['url'][$locale] : $cabinetSettings['pageUrl']
152 );
153
154 if ($cabinetURL) {
155 $tokenParam = $type === 'email' || $type === 'whatsapp' ?
156 (strpos($cabinetURL, '?') === false ? '?token=' : '&token=') .
157 $this->getGeneratedJWT(
158 $email,
159 $cabinetSettings['urlJwtSecret'],
160 DateTimeService::getNowDateTimeObject()->getTimestamp() + $cabinetSettings['tokenValidTime'],
161 LoginType::AMELIA_URL_TOKEN
162 ) : '';
163
164 $cabinetPlaceholder = substr($cabinetURL, -1) === '/' ?
165 substr($cabinetURL, 0, -1) . $tokenParam : $cabinetURL . $tokenParam;
166
167 if ($cabinetSettings['filterDate'] && $dateStartString && $dateEndString) {
168 $cabinetPlaceholder .= '&end=' . $dateEndString . '&start=' . $dateStartString;
169 }
170
171 if ($changePass) {
172 $cabinetPlaceholder .= '&changePass=' . $changePass;
173 }
174
175 $cabinetPlaceholder = apply_filters('amelia_customer_panel_placeholder_filter', $cabinetPlaceholder);
176 }
177
178 return $cabinetPlaceholder;
179 }
180
181 /**
182 * @param string $email
183 * @param string $type
184 * @param string $dateStartString
185 * @param string $dateEndString
186 * @param bool $changePass
187 *
188 * @return string
189 *
190 * @throws Exception
191 */
192 public function getProviderCabinetUrl($email, $type, $dateStartString, $dateEndString, $changePass = false)
193 {
194 /** @var SettingsService $cabinetSettings */
195 $cabinetSettings = $this->container->get('domain.settings.service')->getSetting('roles', 'providerCabinet');
196
197 $cabinetPlaceholder = '';
198
199 $cabinetURL = trim($cabinetSettings['pageUrl']);
200
201 if ($cabinetURL) {
202 $tokenParam = $type === 'email' ? (strpos($cabinetURL, '?') === false ? '?token=' : '&token=') .
203 $this->getGeneratedJWT(
204 $email,
205 $cabinetSettings['urlJwtSecret'],
206 DateTimeService::getNowDateTimeObject()->getTimestamp() + $cabinetSettings['tokenValidTime'],
207 LoginType::AMELIA_URL_TOKEN
208 ) : '';
209
210 $cabinetPlaceholder = substr($cabinetURL, -1) === '/' ?
211 substr($cabinetURL, 0, -1) . $tokenParam : $cabinetURL . $tokenParam;
212
213 if ($cabinetSettings['filterDate'] && $dateStartString && $dateEndString) {
214 $cabinetPlaceholder .= '&end=' . $dateEndString . '&start=' . $dateStartString;
215 }
216
217 if ($changePass) {
218 $cabinetPlaceholder .= '&changePass=' . $changePass;
219 }
220
221 $cabinetPlaceholder = apply_filters('amelia_employee_panel_placeholder_filter', $cabinetPlaceholder);
222 }
223
224 return $cabinetPlaceholder;
225 }
226
227 /**
228 * @param string $locale
229 * @param string $entityTranslation
230 * @param string $type
231 *
232 * @return array|null
233 */
234 public function getBookingTranslation($locale, $entityTranslation, $type)
235 {
236 $entityTranslation = !empty($entityTranslation) ? json_decode($entityTranslation, true) : null;
237
238 if ($locale) {
239 if ($type === null) {
240 return
241 $entityTranslation &&
242 !empty($entityTranslation[$locale]) ?
243 $entityTranslation[$locale] : null;
244 } else {
245 return
246 $entityTranslation &&
247 !empty($entityTranslation[$type][$locale]) ?
248 $entityTranslation[$type][$locale] : null;
249 }
250 }
251
252 return null;
253 }
254
255 /**
256 * @param string $bookingInfo
257 * @return string
258 */
259 public function getLocaleFromBooking($bookingInfo)
260 {
261 /** @var SettingsService $settingsService */
262 $settingsService = $this->container->get('domain.settings.service');
263
264 $usedLanguages = $settingsService->getSetting('general', 'usedLanguages');
265
266 $bookingInfo = !empty($bookingInfo) ? json_decode($bookingInfo, true) : null;
267
268 return $bookingInfo && !empty($bookingInfo['locale']) ? $this->getLocaleLanguage($usedLanguages, $bookingInfo['locale'])[0] : null;
269 }
270
271 /**
272 * @param string $translations
273 *
274 * @return string
275 */
276 public function getLocaleFromTranslations($translations)
277 {
278 /** @var SettingsService $settingsService */
279 $settingsService = $this->container->get('domain.settings.service');
280
281 $usedLanguages = $settingsService->getSetting('general', 'usedLanguages');
282
283 $translations = !empty($translations) ? json_decode($translations, true) : null;
284
285 return $translations && !empty($translations['defaultLanguage'])
286 ? $this->getLocaleLanguage($usedLanguages, $translations['defaultLanguage'])[0] : null;
287 }
288
289 /**
290 * @param array $usedLanguages
291 * @param string $locale
292 * @return array
293 */
294 public function getLocaleLanguage($usedLanguages, $locale)
295 {
296 $finalLanguages = [];
297 foreach ($usedLanguages as $language) {
298 if (explode('_', $language)[0] === explode('_', $locale)[0]) {
299 $finalLanguages[] = $language;
300 }
301 }
302
303 return empty($finalLanguages) ? [$locale] : $finalLanguages;
304 }
305
306
307 /**
308 * @return array
309 */
310 public static function getLanguages()
311 {
312 return array(
313 'af' => array(
314 'name' => 'Afrikaans',
315 'code' => 'af',
316 'wp_locale' => 'af',
317 'country_code' => 'za'
318 ) ,
319 'ar' => array(
320 'name' => 'Arabic',
321 'code' => 'ar',
322 'wp_locale' => 'ar',
323 'country_code' => 'sa'
324 ) ,
325 'ary' => array(
326 'name' => 'Moroccan Arabic',
327 'code' => 'ary',
328 'wp_locale' => 'ary',
329 'country_code' => 'ma'
330 ) ,
331 'as' => array(
332 'name' => 'Assamese',
333 'code' => 'as',
334 'wp_locale' => 'as',
335 'country_code' => 'in'
336 ) ,
337 'azb' => array(
338 'name' => 'South Azerbaijani',
339 'code' => 'azb',
340 'wp_locale' => 'azb',
341 'country_code' => 'az'
342 ) ,
343 'az' => array(
344 'name' => 'Azerbaijani',
345 'code' => 'az',
346 'wp_locale' => 'az',
347 'country_code' => 'az'
348 ) ,
349 'bel' => array(
350 'name' => 'Belarusian',
351 'code' => 'bel',
352 'wp_locale' => 'bel',
353 'country_code' => 'by'
354 ) ,
355 'bg_BG' => array(
356 'name' => 'Bulgarian',
357 'code' => 'bg',
358 'wp_locale' => 'bg_BG',
359 'country_code' => 'bg'
360 ) ,
361 'bn_BD' => array(
362 'name' => 'Bengali',
363 'code' => 'bn',
364 'wp_locale' => 'bn_BD',
365 'country_code' => 'bd'
366 ) ,
367 'bo' => array(
368 'name' => 'Tibetan',
369 'code' => 'bo',
370 'wp_locale' => 'bo',
371 'country_code' => 'cn'
372 ) ,
373 'bs_BA' => array(
374 'name' => 'Bosnian',
375 'code' => 'bs',
376 'wp_locale' => 'bs_BA',
377 'country_code' => 'ba'
378 ) ,
379 'ca' => array(
380 'name' => 'Catalan',
381 'code' => 'ca',
382 'wp_locale' => 'ca',
383 'country_code' => 'es'
384 ) ,
385 'ceb' => array(
386 'name' => 'Cebuano',
387 'code' => 'ceb',
388 'wp_locale' => 'ceb',
389 'country_code' => 'ph'
390 ) ,
391 'cs_CZ' => array(
392 'name' => 'Czech',
393 'code' => 'cs',
394 'wp_locale' => 'cs_CZ',
395 'country_code' => 'cz'
396 ) ,
397 'cy' => array(
398 'name' => 'Welsh',
399 'code' => 'cy',
400 'wp_locale' => 'cy',
401 'country_code' => 'gb'
402 ) ,
403 'da_DK' => array(
404 'name' => 'Danish',
405 'code' => 'da',
406 'wp_locale' => 'da_DK',
407 'country_code' => 'dk'
408 ) ,
409 'de_DE_formal' => array(
410 'name' => 'German (formal)',
411 'code' => 'de',
412 'wp_locale' => 'de_DE_formal',
413 'country_code' => 'de'
414 ) ,
415 'de_AT' => array(
416 'name' => 'German (Austria)',
417 'code' => 'de',
418 'wp_locale' => 'de_AT',
419 'country_code' => 'at'
420 ) ,
421 'de_DE' => array(
422 'name' => 'German',
423 'code' => 'de',
424 'wp_locale' => 'de_DE',
425 'country_code' => 'de'
426 ) ,
427 'de_CH' => array(
428 'name' => 'German (Switzerland)',
429 'code' => 'de-ch',
430 'wp_locale' => 'de_CH',
431 'country_code' => 'ch'
432 ) ,
433 'de_CH_informal' => array(
434 'name' => 'German (Switzerland) informal',
435 'code' => 'de-ch',
436 'wp_locale' => 'de_CH_informal',
437 'country_code' => 'ch'
438 ) ,
439 'dsb' => array(
440 'name' => 'Lower Sorbian',
441 'code' => 'dsb',
442 'wp_locale' => 'dsb',
443 'country_code' => 'de'
444 ) ,
445 'dzo' => array(
446 'name' => 'Dzongkha',
447 'code' => 'dzo',
448 'wp_locale' => 'dzo',
449 'country_code' => 'bt'
450 ) ,
451 'el' => array(
452 'name' => 'Greek',
453 'code' => 'el',
454 'wp_locale' => 'el',
455 'country_code' => 'gr'
456 ) ,
457 'en_AU' => array(
458 'name' => 'English (Australia)',
459 'code' => 'en-au',
460 'wp_locale' => 'en_AU',
461 'country_code' => 'au'
462 ) ,
463 'en_CA' => array(
464 'name' => 'English (Canada)',
465 'code' => 'en-ca',
466 'wp_locale' => 'en_CA',
467 'country_code' => 'ca'
468 ) ,
469 'en_GB' => array(
470 'name' => 'English (UK)',
471 'code' => 'en-gb',
472 'wp_locale' => 'en_GB',
473 'country_code' => 'gb'
474 ) ,
475 'en_US' => array(
476 'name' => 'English (US)',
477 'code' => 'en',
478 'wp_locale' => 'en_US',
479 'country_code' => 'us'
480 ) ,
481 'en_NZ' => array(
482 'name' => 'English (New Zealand)',
483 'code' => 'en',
484 'wp_locale' => 'en_NZ',
485 'country_code' => 'nz'
486 ) ,
487 'en_ZA' => array(
488 'name' => 'English (South Africa)',
489 'code' => 'en',
490 'wp_locale' => 'en_ZA',
491 'country_code' => 'za'
492 ) ,
493 'es_PE' => array(
494 'name' => 'Spanish (Peru)',
495 'code' => 'es-pe',
496 'wp_locale' => 'es_PE',
497 'country_code' => 'pe'
498 ) ,
499 'es_CR' => array(
500 'name' => 'Spanish (Costa Rica)',
501 'code' => 'es-cr',
502 'wp_locale' => 'es_CR',
503 'country_code' => 'cr'
504 ) ,
505 'es_EC' => array(
506 'name' => 'Spanish (Ecuador)',
507 'code' => 'es-ec',
508 'wp_locale' => 'es_EC',
509 'country_code' => 'ec'
510 ) ,
511 'es_CO' => array(
512 'name' => 'Spanish (Colombia)',
513 'code' => 'es-co',
514 'wp_locale' => 'es_CO',
515 'country_code' => 'co'
516 ) ,
517 'es_UY' => array(
518 'name' => 'Spanish (Uruguay)',
519 'code' => 'es-uy',
520 'wp_locale' => 'es_UY',
521 'country_code' => 'uy'
522 ) ,
523 'es_PR' => array(
524 'name' => 'Spanish (Puerto Rico)',
525 'code' => 'es-pr',
526 'wp_locale' => 'es_PR',
527 'country_code' => 'pr'
528 ) ,
529 'es_GT' => array(
530 'name' => 'Spanish (Guatemala)',
531 'code' => 'es',
532 'wp_locale' => 'es_GT',
533 'country_code' => 'gt'
534 ) ,
535 'es_AR' => array(
536 'name' => 'Spanish (Argentina)',
537 'code' => 'es-ar',
538 'wp_locale' => 'es_AR',
539 'country_code' => 'ar'
540 ) ,
541 'es_CL' => array(
542 'name' => 'Spanish (Chile)',
543 'code' => 'es-cl',
544 'wp_locale' => 'es_CL',
545 'country_code' => 'cl'
546 ) ,
547 'es_MX' => array(
548 'name' => 'Spanish (Mexico)',
549 'code' => 'es-mx',
550 'wp_locale' => 'es_MX',
551 'country_code' => 'mx'
552 ) ,
553 'es_ES' => array(
554 'name' => 'Spanish (Spain)',
555 'code' => 'es',
556 'wp_locale' => 'es_ES',
557 'country_code' => 'es'
558 ) ,
559 'es_VE' => array(
560 'name' => 'Spanish (Venezuela)',
561 'code' => 'es-ve',
562 'wp_locale' => 'es_VE',
563 'country_code' => 've'
564 ) ,
565 'et' => array(
566 'name' => 'Estonian',
567 'code' => 'et',
568 'wp_locale' => 'et',
569 'country_code' => 'ee'
570 ) ,
571 'eu' => array(
572 'name' => 'Basque',
573 'code' => 'eu',
574 'wp_locale' => 'eu',
575 'country_code' => 'es'
576 ) ,
577 'fa_IR' => array(
578 'name' => 'Persian',
579 'code' => 'fa',
580 'wp_locale' => 'fa_IR',
581 'country_code' => 'ir'
582 ) ,
583 'fa_AF' => array(
584 'name' => 'Persian (Afghanistan)',
585 'code' => 'fa-af',
586 'wp_locale' => 'fa_AF',
587 'country_code' => 'af'
588 ) ,
589 'fi' => array(
590 'name' => 'Finnish',
591 'code' => 'fi',
592 'wp_locale' => 'fi',
593 'country_code' => 'fi'
594 ) ,
595 'fr_FR' => array(
596 'name' => 'French (France)',
597 'code' => 'fr',
598 'wp_locale' => 'fr_FR',
599 'country_code' => 'fr'
600 ) ,
601 'fr_CA' => array(
602 'name' => 'French (Canada)',
603 'code' => 'fr',
604 'wp_locale' => 'fr_CA',
605 'country_code' => 'ca'
606 ) ,
607 'fr_BE' => array(
608 'name' => 'French (Belgium)',
609 'code' => 'fr-be',
610 'wp_locale' => 'fr_BE',
611 'country_code' => 'be'
612 ) ,
613 'fur' => array(
614 'name' => 'Friulian',
615 'code' => 'fur',
616 'wp_locale' => 'fur',
617 'country_code' => 'it'
618 ) ,
619 'gd' => array(
620 'name' => 'Scottish Gaelic',
621 'code' => 'gd',
622 'wp_locale' => 'gd',
623 'country_code' => 'gb'
624 ) ,
625 'gl_ES' => array(
626 'name' => 'Galician',
627 'code' => 'gl',
628 'wp_locale' => 'gl_ES',
629 'country_code' => 'es'
630 ) ,
631 'gu' => array(
632 'name' => 'Gujarati',
633 'code' => 'gu',
634 'wp_locale' => 'gu',
635 'country_code' => 'in'
636 ) ,
637 'haz' => array(
638 'name' => 'Hazaragi',
639 'code' => 'haz',
640 'wp_locale' => 'haz',
641 'country_code' => 'af'
642 ) ,
643 'he_IL' => array(
644 'name' => 'Hebrew',
645 'code' => 'he',
646 'wp_locale' => 'he_IL',
647 'country_code' => 'il'
648 ) ,
649 'hi_IN' => array(
650 'name' => 'Hindi',
651 'code' => 'hi',
652 'wp_locale' => 'hi_IN',
653 'country_code' => 'in'
654 ) ,
655 'hr' => array(
656 'name' => 'Croatian',
657 'code' => 'hr',
658 'wp_locale' => 'hr',
659 'country_code' => 'hr'
660 ) ,
661 'hsb' => array(
662 'name' => 'Upper Sorbian',
663 'code' => 'hsb',
664 'wp_locale' => 'hsb',
665 'country_code' => 'de'
666 ) ,
667 'hu_HU' => array(
668 'name' => 'Hungarian',
669 'code' => 'hu',
670 'wp_locale' => 'hu_HU',
671 'country_code' => 'hu'
672 ) ,
673 'hy' => array(
674 'name' => 'Armenian',
675 'code' => 'hy',
676 'wp_locale' => 'hy',
677 'country_code' => 'am'
678 ) ,
679 'id_ID' => array(
680 'name' => 'Indonesian',
681 'code' => 'id',
682 'wp_locale' => 'id_ID',
683 'country_code' => 'id'
684 ) ,
685 'is_IS' => array(
686 'name' => 'Icelandic',
687 'code' => 'is',
688 'wp_locale' => 'is_IS',
689 'country_code' => 'is'
690 ) ,
691 'it_IT' => array(
692 'name' => 'Italian',
693 'code' => 'it',
694 'wp_locale' => 'it_IT',
695 'country_code' => 'it'
696 ) ,
697 'ja' => array(
698 'name' => 'Japanese',
699 'code' => 'ja',
700 'wp_locale' => 'ja',
701 'country_code' => 'jp'
702 ) ,
703 'jv_ID' => array(
704 'name' => 'Javanese',
705 'code' => 'jv',
706 'wp_locale' => 'jv_ID',
707 'country_code' => 'id'
708 ) ,
709 'ka_GE' => array(
710 'name' => 'Georgian',
711 'code' => 'ka',
712 'wp_locale' => 'ka_GE',
713 'country_code' => 'ge'
714 ) ,
715 'kab' => array(
716 'name' => 'Kabyle',
717 'code' => 'kab',
718 'wp_locale' => 'kab',
719 'country_code' => 'dz'
720 ) ,
721 'kk' => array(
722 'name' => 'Kazakh',
723 'code' => 'kk',
724 'wp_locale' => 'kk',
725 'country_code' => 'kz'
726 ) ,
727 'km' => array(
728 'name' => 'Khmer',
729 'code' => 'km',
730 'wp_locale' => 'km',
731 'country_code' => 'kh'
732 ) ,
733 'kn' => array(
734 'name' => 'Kannada',
735 'code' => 'kn',
736 'wp_locale' => 'kn',
737 'country_code' => 'in'
738 ) ,
739 'ko_KR' => array(
740 'name' => 'Korean',
741 'code' => 'ko',
742 'wp_locale' => 'ko_KR',
743 'country_code' => 'kr'
744 ) ,
745 'lo' => array(
746 'name' => 'Lao',
747 'code' => 'lo',
748 'wp_locale' => 'lo',
749 'country_code' => 'la'
750 ) ,
751 'lt_LT' => array(
752 'name' => 'Lithuanian',
753 'code' => 'lt',
754 'wp_locale' => 'lt_LT',
755 'country_code' => 'lt'
756 ) ,
757 'lb_LU' => array(
758 'name' => 'Luxembourgish',
759 'code' => 'lb',
760 'wp_locale' => 'lb_LU',
761 'country_code' => 'lu'
762 ) ,
763 'lv' => array(
764 'name' => 'Latvian',
765 'code' => 'lv',
766 'wp_locale' => 'lv',
767 'country_code' => 'lv'
768 ) ,
769 'mk_MK' => array(
770 'name' => 'Macedonian',
771 'code' => 'mk',
772 'wp_locale' => 'mk_MK',
773 'country_code' => 'mk'
774 ) ,
775 'ml_IN' => array(
776 'name' => 'Malayalam',
777 'code' => 'ml',
778 'wp_locale' => 'ml_IN',
779 'country_code' => 'in'
780 ) ,
781 'mn' => array(
782 'name' => 'Mongolian',
783 'code' => 'mn',
784 'wp_locale' => 'mn',
785 'country_code' => 'mn'
786 ) ,
787 'mr' => array(
788 'name' => 'Marathi',
789 'code' => 'mr',
790 'wp_locale' => 'mr',
791 'country_code' => 'in'
792 ) ,
793 'ms_MY' => array(
794 'name' => 'Malay',
795 'code' => 'ms',
796 'wp_locale' => 'ms_MY',
797 'country_code' => 'my'
798 ) ,
799 'my_MM' => array(
800 'name' => 'Burmese',
801 'code' => 'mya',
802 'wp_locale' => 'my_MM',
803 'country_code' => 'mm'
804 ) ,
805 'nb_NO' => array(
806 'name' => 'Norwegian (Bokmål)',
807 'code' => 'nb',
808 'wp_locale' => 'nb_NO',
809 'country_code' => 'no'
810 ) ,
811 'ne_NP' => array(
812 'name' => 'Nepali',
813 'code' => 'ne',
814 'wp_locale' => 'ne_NP',
815 'country_code' => 'np'
816 ) ,
817 'nl_BE' => array(
818 'name' => 'Dutch (Belgium)',
819 'code' => 'nl-be',
820 'wp_locale' => 'nl_BE',
821 'country_code' => 'be'
822 ) ,
823 'nl_NL' => array(
824 'name' => 'Dutch',
825 'code' => 'nl',
826 'wp_locale' => 'nl_NL',
827 'country_code' => 'nl'
828 ) ,
829 'nl_NL_formal' => array(
830 'name' => 'Dutch (formal)',
831 'code' => 'nl',
832 'wp_locale' => 'nl_NL_formal',
833 'country_code' => 'nl'
834 ) ,
835 'nn_NO' => array(
836 'name' => 'Norwegian (Nynorsk)',
837 'code' => 'nn',
838 'wp_locale' => 'nn_NO',
839 'country_code' => 'no'
840 ) ,
841 'pa_IN' => array(
842 'name' => 'Punjabi',
843 'code' => 'pa',
844 'wp_locale' => 'pa_IN',
845 'country_code' => 'in'
846 ) ,
847 'pl_PL' => array(
848 'name' => 'Polish',
849 'code' => 'pl',
850 'wp_locale' => 'pl_PL',
851 'country_code' => 'pl'
852 ) ,
853 'ps' => array(
854 'name' => 'Pashto',
855 'code' => 'ps',
856 'wp_locale' => 'ps',
857 'country_code' => 'af'
858 ) ,
859 'pt_PT_ao90' => array(
860 'name' => 'Portuguese (AO90)',
861 'code' => 'pt',
862 'wp_locale' => 'pt_PT_ao90',
863 'country_code' => 'pt'
864 ) ,
865 'pt_PT' => array(
866 'name' => 'Portuguese (Portugal)',
867 'code' => 'pt',
868 'wp_locale' => 'pt_PT',
869 'country_code' => 'pt'
870 ) ,
871 'pt_AO' => array(
872 'name' => 'Portuguese (Angola)',
873 'code' => 'pt-ao',
874 'wp_locale' => 'pt_AO',
875 'country_code' => 'ao'
876 ) ,
877 'pt_BR' => array(
878 'name' => 'Portuguese (Brazil)',
879 'code' => 'pt-br',
880 'wp_locale' => 'pt_BR',
881 'country_code' => 'br'
882 ) ,
883 'rhg' => array(
884 'name' => 'Rohingya',
885 'code' => 'rhg',
886 'wp_locale' => 'rhg',
887 'country_code' => 'mm'
888 ) ,
889 'ro_RO' => array(
890 'name' => 'Romanian',
891 'code' => 'ro',
892 'wp_locale' => 'ro_RO',
893 'country_code' => 'ro'
894 ) ,
895 'ru_RU' => array(
896 'name' => 'Russian',
897 'code' => 'ru',
898 'wp_locale' => 'ru_RU',
899 'country_code' => 'ru'
900 ) ,
901 'sah' => array(
902 'name' => 'Sakha',
903 'code' => 'sah',
904 'wp_locale' => 'sah',
905 'country_code' => 'ru'
906 ) ,
907 'snd' => array(
908 'name' => 'Sindhi',
909 'code' => 'snd',
910 'wp_locale' => 'snd',
911 'country_code' => 'pk'
912 ) ,
913 'si_LK' => array(
914 'name' => 'Sinhala',
915 'code' => 'si',
916 'wp_locale' => 'si_LK',
917 'country_code' => 'lk'
918 ) ,
919 'sk_SK' => array(
920 'name' => 'Slovak',
921 'code' => 'sk',
922 'wp_locale' => 'sk_SK',
923 'country_code' => 'sk'
924 ) ,
925 'skr' => array(
926 'name' => 'Saraiki',
927 'code' => 'skr',
928 'wp_locale' => 'skr',
929 'country_code' => 'pk'
930 ) ,
931 'sl_SI' => array(
932 'name' => 'Slovenian',
933 'code' => 'sl',
934 'wp_locale' => 'sl_SI',
935 'country_code' => 'si'
936 ) ,
937 'sq' => array(
938 'name' => 'Albanian',
939 'code' => 'sq',
940 'wp_locale' => 'sq',
941 'country_code' => 'al'
942 ) ,
943 'sr_RS' => array(
944 'name' => 'Serbian',
945 'code' => 'sr',
946 'wp_locale' => 'sr_RS',
947 'country_code' => 'rs'
948 ) ,
949 'sv_SE' => array(
950 'name' => 'Swedish',
951 'code' => 'sv',
952 'wp_locale' => 'sv_SE',
953 'country_code' => 'se'
954 ) ,
955 'sw' => array(
956 'name' => 'Kiswahili',
957 'code' => 'sw',
958 'wp_locale' => 'sw',
959 'country_code' => 'ke'
960 ) ,
961 'szl' => array(
962 'name' => 'Silesian',
963 'code' => 'szl',
964 'wp_locale' => 'szl',
965 'country_code' => 'pl'
966 ) ,
967 'ta_IN' => array(
968 'name' => 'Tamil',
969 'code' => 'ta',
970 'wp_locale' => 'ta_IN',
971 'country_code' => 'in'
972 ) ,
973 'ta_LK' => array(
974 'name' => 'Tamil (Sri Lanka)',
975 'code' => 'ta-lk',
976 'wp_locale' => 'ta_LK',
977 'country_code' => 'lk'
978 ) ,
979 'te' => array(
980 'name' => 'Telugu',
981 'code' => 'te',
982 'wp_locale' => 'te',
983 'country_code' => 'in'
984 ) ,
985 'th' => array(
986 'name' => 'Thai',
987 'code' => 'th',
988 'wp_locale' => 'th',
989 'country_code' => 'th'
990 ) ,
991 'tl' => array(
992 'name' => 'Tagalog',
993 'code' => 'tl',
994 'wp_locale' => 'tl',
995 'country_code' => 'ph'
996 ) ,
997 'tr_TR' => array(
998 'name' => 'Turkish',
999 'code' => 'tr',
1000 'wp_locale' => 'tr_TR',
1001 'country_code' => 'tr'
1002 ) ,
1003 'tah' => array(
1004 'name' => 'Tahitian',
1005 'code' => 'tah',
1006 'wp_locale' => 'tah',
1007 'country_code' => 'pf'
1008 ) ,
1009 'ug_CN' => array(
1010 'name' => 'Uighur',
1011 'code' => 'ug',
1012 'wp_locale' => 'ug_CN',
1013 'country_code' => 'cn'
1014 ) ,
1015 'uk' => array(
1016 'name' => 'Ukrainian',
1017 'code' => 'uk',
1018 'wp_locale' => 'uk',
1019 'country_code' => 'ua'
1020 ) ,
1021 'ur' => array(
1022 'name' => 'Urdu',
1023 'code' => 'ur',
1024 'wp_locale' => 'ur',
1025 'country_code' => 'pk'
1026 ) ,
1027 'uz_UZ' => array(
1028 'name' => 'Uzbek',
1029 'code' => 'uz',
1030 'wp_locale' => 'uz_UZ',
1031 'country_code' => 'uz'
1032 ) ,
1033 'vi' => array(
1034 'name' => 'Vietnamese',
1035 'code' => 'vi',
1036 'wp_locale' => 'vi',
1037 'country_code' => 'vn'
1038 ) ,
1039 'zh_HK' => array(
1040 'name' => 'Chinese (Hong Kong)',
1041 'code' => 'zh-hk',
1042 'wp_locale' => 'zh_HK',
1043 'country_code' => 'hk'
1044 ) ,
1045 'zh_CN' => array(
1046 'name' => 'Chinese (China)',
1047 'code' => 'zh-cn',
1048 'wp_locale' => 'zh_CN',
1049 'country_code' => 'cn'
1050 ) ,
1051 'zh_TW' => array(
1052 'name' => 'Chinese (Taiwan)',
1053 'code' => 'zh-tw',
1054 'wp_locale' => 'zh_TW',
1055 'country_code' => 'tw'
1056 )
1057 );
1058 }
1059 }
1060