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