Changeset 8653 for extensions/FacebookPlug
- Timestamp:
- Jan 13, 2011, 11:37:05 PM (14 years ago)
- Location:
- extensions/FacebookPlug/Plugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/FacebookPlug/Plugin/include/header.inc.php
r8448 r8653 29 29 30 30 // Array compute by plugins/FacebookPlug/tools/check_language.php script 31 $valid_fb_locales = array ( 0 => ' ca_ES', 1 => 'cs_CZ', 2 => 'da_DK', 3 => 'de_DE', 4 => 'es_ES', 5 => 'fa_IR', 6 => 'fr_CA', 7 => 'fr_FR', 8 => 'he_IL', 9 => 'hr_HR', 10 => 'hu_HU', 11 => 'it_IT', 12 => 'ja_JP', 13 => 'ka_GE', 14 => 'lv_LV', 15 => 'mk_MK', 16 => 'nl_NL', 17 => 'pl_PL', 18 => 'pt_BR', 19 => 'pt_PT', 20 => 'ro_RO', 21 => 'ru_RU', 22 => 'sk_SK', 23 => 'sr_RS', 24 => 'sv_SE', 25 => 'tr_TR', 26 => 'vi_VN', 27=> 'zh_CN', );31 $valid_fb_locales = array ( 0 => 'ar_AR', 1 => 'ca_ES', 2 => 'cs_CZ', 3 => 'da_DK', 4 => 'de_DE', 5 => 'es_ES', 6 => 'fa_IR', 7 => 'fr_CA', 8 => 'fr_FR', 9 => 'he_IL', 10 => 'hr_HR', 11 => 'hu_HU', 12 => 'it_IT', 13 => 'ja_JP', 14 => 'ka_GE', 15 => 'lv_LV', 16 => 'mk_MK', 17 => 'nl_NL', 18 => 'pl_PL', 19 => 'pt_BR', 20 => 'pt_PT', 21 => 'ro_RO', 22 => 'ru_RU', 23 => 'sk_SK', 24 => 'sr_RS', 25 => 'sv_SE', 26 => 'tr_TR', 27 => 'vi_VN', 28 => 'zh_CN', ); 32 32 33 33 // User language 34 $l anguage = $user['language'];35 if (! in_array($l anguage, $valid_fb_locales))36 { 37 $code_lang = substr($l anguage, 0, 2);38 // Compose a l anguage39 $l anguage = $code_lang.'_'.strtoupper($code_lang);40 if (! in_array($l anguage, $valid_fb_locales))41 { 42 // Search a l anguage34 $locale = $user['language']; 35 if (! in_array($locale, $valid_fb_locales)) 36 { 37 $code_lang = substr($locale, 0, 2); 38 // Compose a locale 39 $locale = $code_lang.'_'.strtoupper($code_lang); 40 if (! in_array($locale, $valid_fb_locales)) 41 { 42 // Search a locale 43 43 foreach ($valid_fb_locales as $valid_fb_locale) 44 44 { … … 48 48 } 49 49 } 50 // default l anguage51 $l anguage = 'en_US';52 } 53 } 54 55 return $l anguage;50 // default locale 51 $locale = 'en_US'; 52 } 53 } 54 55 return $locale; 56 56 } 57 57 -
extensions/FacebookPlug/Plugin/include/picture.inc.php
r8440 r8653 30 30 if ($page['fbp']['do_facebook_init']) 31 31 { 32 // Header for each page33 //~ $tpls[] = 'picture.header';32 // Init array 33 $tpls = array(); 34 34 35 35 // Specific -
extensions/FacebookPlug/Plugin/tools/check_language.php
r8435 r8653 31 31 if (!is_link($path) and is_dir($path) and file_exists($path.'/iso.txt')) 32 32 { 33 echo '<br />'.$file.'<br />'.'-------'.'<br />'; 34 $file_connect = 'http://connect.facebook.net/'.$file.'/all.js'; 35 echo $file_connect.'<br />'; 33 $locale = $file; 34 $languages['list'][] = $locale; 36 35 37 $content = @file_get_contents($file_connect); 38 if ($content !== false and ! preg_match('/is not a valid locale/', $content)) 39 { 40 echo 'ok'.'<br />'; 41 $languages['ok'][] = $file; 42 } 43 else 44 { 45 echo 'ko'.'<br />'; 46 $languages['ko'][] = $file; 47 } 36 $code_lang = substr($locale, 0, 2); 37 // Compose a locale 38 $locale = $code_lang.'_'.strtoupper($code_lang); 39 $languages['list'][] = $locale; 48 40 } 49 41 } 50 42 closedir($dir); 43 44 foreach (array_unique($languages['list']) as $locale) 45 { 46 echo '<br />'.$locale.'<br />'.'-------'.'<br />'; 47 $locale_connect = 'http://connect.facebook.net/'.$locale.'/all.js'; 48 echo $locale_connect.'<br />'; 49 50 $content = @file_get_contents($locale_connect); 51 if ($content !== false and ! preg_match('/is not a valid locale/', $content)) 52 { 53 echo 'ok'.'<br />'; 54 $languages['ok'][] = $locale; 55 } 56 else 57 { 58 echo 'ko'.'<br />'; 59 $languages['ko'][] = $locale; 60 } 61 } 62 51 63 @asort($languages['ok']); 52 64 @asort($languages['ko']);
Note: See TracChangeset
for help on using the changeset viewer.