Pluf Framework

Pluf Framework Commit Details


Date:2008-12-19 04:30:03 (16 years 3 days ago)
Author:Loic d'Anterroches
Branch:develop, master
Commit:04e855468b238e3d02355921de0340444d3c1d72
Parents: 4cdca4b8334676376c10f325b9927a63827b555c
Message:Added the language control from the user object.

Changes:

File differences

src/Pluf/L10n.php
383383
384384
385385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
386584
return $res;
}
/**
* Returns iso codes.
*
* @param bool Is the language the key in the array (false)
* @return array The key is either the language or the iso code
*/
public static function getNativeLanguages($lang=false)
{
$res = array(
'ab' => 'Аҧсуа',
'aa' => 'Afaraf',
'af' => 'Afrikaans',
'ak' => 'Akan',
'am' => 'አማርኛ',
'ar' => 'العربية',
'an' => 'Aragonés',
'as' => 'অসমীয়া',
'av' => 'авар мацӀ',
'ae' => 'avesta',
'ay' => 'aymar aru',
'az' => 'Azərbaycanca',
'bm' => 'bamanankan',
'ba' => 'башҡорт теле',
'be' => 'Беларуская мова',
'bn' => 'বাংলা',
'bh' => 'Bihari',
'bi' => 'Bislama',
'bs' => 'bosanski jezik',
'br' => 'brezhoneg',
'bg' => 'български език',
'ca' => 'català',
'ch' => 'Chamoru',
'ce' => 'нохчийн мотт',
'ny' => 'chiCheŵa',
'cu' => 'чӑваш чӗлхи',
'kw' => 'Kernewek',
'co' => 'corsu',
'cr' => 'ᓀᐦᐃᔭᐍᐏᐣ',
'hr' => 'hrvatski jezik',
'cs' => 'čeština',
'da' => 'dansk',
'dv' => 'ދިވެހިބަސ',
'dz' => 'རྫོང་ཁ',
'en' => 'English',
'eo' => 'Esperanto',
'et' => 'eesti keel',
'ee' => 'Ɛʋɛgbɛ',
'fo' => 'føroyskt',
'fj' => 'vosa Vakaviti',
'fi' => 'suomi',
'fr' => 'français',
'fy' => 'frysk',
'ff' => 'Fulfulde, Pulaar, Pular',
'gl' => 'Galego',
'lg' => 'Luganda',
'ka' => 'ქართული ენა',
'de' => 'Deutsch',
'el' => 'Ελληνικά',
'kl' => 'kalaallisut',
'gn' => 'Avañe\'ẽ',
'gu' => 'ગુજરાતી',
'ht' => 'Kreyòl ayisyen',
'ha' => 'Hausancī',
'he' => 'עִבְרִית',
'hz' => 'Otjiherero',
'hi' => 'हिन्दी',
'ho' => 'Hiri Motu',
'hu' => 'magyar',
'is' => 'íslenska',
'io' => 'Ido',
'ig' => 'Igbo',
'id' => 'Bahasa Indonesia',
'ia' => 'interlingua',
'ie' => 'Interlingue',
'iu' => 'ᐃᓄᒃᑎᑐᑦ',
'ik' => 'Iñupiaq',
'ga' => 'Gaeilge',
'it' => 'italiano',
'ja' => '日本語 (にほんご)',
'jv' => 'basa Jawa',
'kn' => 'ಕನ್ನಡ',
'kr' => 'कॉशुर',
'kk' => 'Қазақ тілі',
'km' => 'Central Khmer',
'ki' => 'Gĩkũyũ',
'rw' => 'kinyaRwanda',
'ky' => 'кыргыз тили',
'kv' => 'коми кыв',
'kg' => 'Kikongo',
'ko' => '한국어 (韓國語)',
'kj' => 'Kurdish',
'lo' => 'ພາສາລາວ',
'la' => 'latine',
'lv' => 'latviešu valoda',
'li' => 'Limburgs',
'ln' => 'lingala',
'lt' => 'lietuvių kalba',
'lu' => 'Luxembourgish',
'mg' => 'Malagasy fiteny',
'ms' => 'bahasa Melayu',
'ml' => 'മലയാളം',
'mt' => 'Malti',
'gv' => 'Gaelg',
'mi' => 'te reo Māori',
'mr' => 'मराठी',
'mh' => 'Kajin M̧ajeļ',
'mn' => 'монгол хэл',
'na' => 'Ekakairũ Naoero',
'nv' => 'Diné bizaad',
'nd' => 'isiNdebele',
'nr' => 'isiNdebele',
'ng' => 'Owambo',
'ne' => 'नेपाली',
'se' => 'sámi',
'no' => 'Norsk',
'nb' => 'Norsk bokmål',
'nn' => 'Norsk nynorsk',
'oc' => 'Occitan',
'oj' => 'ᐊᓂᔑᓇᐯᒧᐏᐣ (Anishinaabemowin)',
'or' => 'ଓଡ଼ିଆ',
'om' => 'Afaan Oromoo',
'os' => 'ирон ӕвзаг',
'pi' => 'पालि',
'fa' => 'فارسی',
'pl' => 'polski',
'pt' => 'português',
'pa' => 'ਪੰਜਾਬੀ',
'ps' => 'پښتو',
'qu' => 'Runa Simi',
'rm' => 'rumantsch grischun',
'rn' => 'kiRundi',
'ru' => 'русский язык',
'sm' => 'gagana fa\'a Samoa',
'sg' => 'yângâ tî sängö',
'sa' => 'संस्कृतम्',
'sc' => 'sardu',
'gd' => 'Gàidhlig',
'sr' => 'српски језик',
'sn' => 'chiShona',
'ii' => 'ꆇꉙ',
'sd' => 'سنڌي، سندھی',
'si' => 'සිංහල',
'sk' => 'slovenčina',
'sl' => 'slovenščina',
'so' => 'Soomaaliga',
'st' => 'Sesotho',
'es' => 'español',
'su' => 'basa Sunda',
'sw' => 'kiswahili',
'ss' => 'siSwati',
'sv' => 'Svenska',
'tl' => 'Tagalog',
'ty' => 'te reo Tahiti',
'tg' => 'тоҷикӣ',
'ta' => 'தமிழ்',
'tt' => 'татарча',
'te' => 'తెలుగు',
'th' => 'ภาษาไทย',
'bo' => 'བོད་ཡིག',
'ti' => 'ትግርኛ',
'to' => 'faka-Tonga',
'ts' => 'Xitsonga',
'tn' => 'Setswana',
'tr' => 'Türkçe',
'tk' => 'Түркмен',
'tw' => 'Twi',
'ug' => 'Uyƣurqə',
'uk' => 'українська мова',
'ur' => 'اردو',
'uz' => 'O\'zbek',
've' => 'Tshivenḓa',
'vi' => 'Tiếng Việt',
'vo' => 'Volapük',
'wa' => 'walon',
'cy' => 'Cymraeg',
'wo' => 'Wolof',
'xh' => 'isiXhosa',
'yi' => 'ייִדיש',
'yo' => 'Yorùbá',
'za' => 'Saɯ cueŋƅ',
'zu' => 'isiZulu',
);
if ($lang) {
$res = array_flip($res);
ksort($res); //order by lang
}
return $res;
}
public static function getInstalledLanguages()
{
$l = array();
$nl = self::getNativeLanguages();
foreach (Pluf::f('languages', array('en')) as $lang) {
$l[$nl[$lang]] = $lang;
}
return $l;
}
}
src/Pluf/Middleware/Session.php
6767
6868
6969
70
7071
7172
7273
......
8081
8182
8283
84
8385
8486
8587
......
9799
98100
99101
102
103
104
100105
101106
102107
}
return false;
}
$set_lang = false;
if (isset($data[$user->session_key])) {
// We can get the corresponding user
$found_user = new Pluf_User($data[$user->session_key]);
$request->user->last_login = gmdate('Y-m-d H:i:s');
$request->user->update();
}
$set_lang = $found_user->language;
} else {
$request->user = $user;
}
} else {
$request->session = $session;
}
if ($set_lang) {
$request->session->setData('pluf_language', $set_lang);
}
if (isset($request->COOKIE[$request->session->test_cookie_name])) {
$request->session->test_cookie = $request->COOKIE[$request->session->test_cookie_name];
}

Archive Download the corresponding diff file

Branches

Tags

Number of commits:
Page rendered in 0.06447s using 13 queries.