Changeset 8667


Ignore:
Timestamp:
Jan 14, 2011, 11:58:24 PM (10 years ago)
Author:
rub
Message:

List all facebook locale

Location:
extensions/FacebookPlug/Plugin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/FacebookPlug/Plugin/include/header.inc.php

    r8653 r8667  
    2929
    3030  // Array compute by plugins/FacebookPlug/tools/check_language.php script
    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', );
     31  $valid_fb_locales = array ( 0 => 'af_ZA', 1 => 'ar_AR', 2 => 'ay_BO', 3 => 'az_AZ', 4 => 'be_BY', 5 => 'bg_BG', 6 => 'bn_IN', 7 => 'bs_BA', 8 => 'ca_ES', 9 => 'ck_US', 10 => 'cs_CZ', 11 => 'cy_GB', 12 => 'da_DK', 13 => 'de_DE', 14 => 'el_GR', 15 => 'en_GB', 16 => 'en_PI', 17 => 'en_UD', 18 => 'en_US', 19 => 'eo_EO', 20 => 'es_CL', 21 => 'es_CO', 22 => 'es_ES', 23 => 'es_LA', 24 => 'es_MX', 25 => 'es_VE', 26 => 'et_EE', 27 => 'eu_ES', 28 => 'fa_IR', 29 => 'fb_FI', 30 => 'fb_LT', 31 => 'fi_FI', 32 => 'fo_FO', 33 => 'fr_CA', 34 => 'fr_FR', 35 => 'ga_IE', 36 => 'gl_ES', 37 => 'gn_PY', 38 => 'gu_IN', 39 => 'he_IL', 40 => 'hi_IN', 41 => 'hr_HR', 42 => 'hu_HU', 43 => 'hy_AM', 44 => 'id_ID', 45 => 'is_IS', 46 => 'it_IT', 47 => 'ja_JP', 48 => 'jv_ID', 49 => 'ka_GE', 50 => 'kk_KZ', 51 => 'km_KH', 52 => 'kn_IN', 53 => 'ko_KR', 54 => 'ku_TR', 55 => 'la_VA', 56 => 'li_NL', 57 => 'lt_LT', 58 => 'lv_LV', 59 => 'mg_MG', 60 => 'mk_MK', 61 => 'ml_IN', 62 => 'mn_MN', 63 => 'mr_IN', 64 => 'ms_MY', 65 => 'mt_MT', 66 => 'nb_NO', 67 => 'ne_NP', 68 => 'nl_BE', 69 => 'nl_NL', 70 => 'nn_NO', 71 => 'pa_IN', 72 => 'pl_PL', 73 => 'ps_AF', 74 => 'pt_BR', 75 => 'pt_PT', 76 => 'qu_PE', 77 => 'rm_CH', 78 => 'ro_RO', 79 => 'ru_RU', 80 => 'sa_IN', 81 => 'se_NO', 82 => 'sk_SK', 83 => 'sl_SI', 84 => 'so_SO', 85 => 'sq_AL', 86 => 'sr_RS', 87 => 'sv_SE', 88 => 'sw_KE', 89 => 'sy_SY', 90 => 'ta_IN', 91 => 'te_IN', 92 => 'tg_TJ', 93 => 'th_TH', 94 => 'tl_PH', 95 => 'tl_ST', 96 => 'tr_TR', 97 => 'tt_RU', 98 => 'uk_UA', 99 => 'ur_PK', 100 => 'uz_UZ', 101 => 'vi_VN', 102 => 'xh_ZA', 103 => 'yi_DE', 104 => 'zh_CN', 105 => 'zh_HK', 106 => 'zh_TW', 107 => 'zu_ZA', );
    3232
    3333  // User language
  • extensions/FacebookPlug/Plugin/tools/check_language.php

    r8656 r8667  
    3232  {
    3333    $locale = $file;
    34     $languages['list'][] = $locale;
     34    $languages['strict_list'][] = $locale;
    3535
    3636    $code_lang = substr($locale, 0, 2);
    3737    // Compose a locale
    3838    $locale = $code_lang.'_'.strtoupper($code_lang);
    39     $languages['list'][] = $locale;
     39    $languages['extented_list'][] = $locale;
    4040  }
    4141}
    4242closedir($dir);
    4343
    44 foreach (array_unique($languages['list']) as $locale)
     44$languages['extented_list'] = array_merge($languages['strict_list'], $languages['extented_list']);
     45
     46/*foreach (array_unique($languages['extented_list']) as $locale)
    4547{
    4648  echo '<br />'.$locale.'<br />'.'-------'.'<br />';
     
    7274echo '<br />'.'<br />'.'Facebook Locales'.'<br />'.'-----------------------------'.'<br />';
    7375echo @file_get_contents('http://www.facebook.com/translations/FacebookLocales.xml');
     76*/
     77$dom = DomDocument::load('http://www.facebook.com/translations/FacebookLocales.xml');
     78
     79$domrepresentation = $dom->getElementsByTagName("representation");
     80
     81foreach ($domrepresentation as $representations)
     82{
     83  $languages['fb'][] = $representations->nodeValue;
     84}
     85@sort($languages['fb']);
     86
     87echo '<br />'.'<br />'.'Languages defined on Facebook'.'<br />'.'-----------------------------'.'<br />';
     88var_export($languages['fb']);
     89
     90echo '<br />'.'<br />'.'Languages not defined on Facebook'.'<br />'.'-----------------------------'.'<br />';
     91var_export(array_values(array_diff($languages['strict_list'],$languages['fb'])));
     92
     93echo '<br />'.'<br />'.'Extented languages not defined on Facebook'.'<br />'.'-----------------------------'.'<br />';
     94var_export(array_values(array_diff($languages['extented_list'],$languages['fb'])));
     95
    7496?>
Note: See TracChangeset for help on using the changeset viewer.