Ticket #170: remove_google-translate.diff

File remove_google-translate.diff, 27.6 KB (added by juanramondiaz, 13 months ago)
  • locales/locales.php

     
    99        var $slug; 
    1010        var $nplurals = 2; 
    1111        var $plural_expression = 'n != 1'; 
    12         var $google_code = null; 
    1312        var $preferred_sans_serif_font_family = null; 
    1413        // TODO: days, months, decimals, quotes 
    1514         
     
    7877                $af->country_code = 'za'; 
    7978                $af->wp_locale = 'af'; 
    8079                $af->slug = 'af'; 
    81                 $af->google_code = 'af'; 
    8280 
    8381                $ak = new GP_Locale(); 
    8482                $ak->english_name = 'Akan'; 
     
    9694                $am->lang_code_iso_639_2 = 'amh'; 
    9795                $am->country_code = 'et'; 
    9896                $am->slug = 'am'; 
    99                 $am->google_code = 'am'; 
    10097 
    10198                $an = new GP_Locale(); 
    10299                $an->english_name = 'Aragonese'; 
     
    114111                $ar->country_code = ''; 
    115112                $ar->wp_locale = 'ar'; 
    116113                $ar->slug = 'ar'; 
    117                 $ar->google_code = 'ar'; 
    118114                $ar->nplurals = 6; 
    119115                $ar->plural_expression = 'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5'; 
    120116                $ar->rtl = true; 
     
    162158                $az->country_code = 'az'; 
    163159                $az->wp_locale = 'az'; 
    164160                $az->slug = 'az'; 
    165                 $az->google_code = 'az'; 
    166161                 
    167162                $az_tr = new GP_Locale(); 
    168163                $az_tr->english_name = 'Azerbaijani (Turkey)'; 
     
    198193                $be->lang_code_iso_639_2 = 'bel'; 
    199194                $be->country_code = 'by'; 
    200195                $be->slug = 'be'; 
    201                 $be->google_code = 'be'; 
    202196                $be->nplurals = 3; 
    203197                $be->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    204198 
     
    210204                $bg->country_code = 'bg'; 
    211205                $bg->wp_locale = 'bg_BG'; 
    212206                $bg->slug = 'bg'; 
    213                 $bg->google_code = 'bg'; 
    214207 
    215208                $bh = new GP_Locale(); 
    216209                $bh->english_name = 'Bihari'; 
     
    243236                $bn_bd->country_code = 'bn'; 
    244237                $bn_bd->wp_locale = 'bn_BD'; 
    245238                $bn_bd->slug = 'bn'; 
    246                 $bn_bd->google_code = 'bn'; 
    247239 
    248240                $bo = new GP_Locale(); 
    249241                $bo->english_name = 'Tibetan'; 
     
    252244                $bo->lang_code_iso_639_2 = 'tib'; 
    253245                $bo->country_code = ''; 
    254246                $bo->slug = 'bo'; 
    255                 $bo->google_code = 'bo'; 
    256247                $bo->nplurals = 1; 
    257248                $bo->plural_expression = '0'; 
    258249 
     
    335326                $cs->country_code = 'cz'; 
    336327                $cs->wp_locale = 'cs_CZ'; 
    337328                $cs->slug = 'cs'; 
    338                 $cs->google_code = 'cs'; 
    339329                $cs->nplurals = 3; 
    340330                $cs->plural_expression = '(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'; 
    341331 
     
    373363                $cy->country_code = 'uk'; 
    374364                $cy->wp_locale = 'cy'; 
    375365                $cy->slug = 'cy'; 
    376                 $cy->google_code = 'cy'; 
    377366                $cy->nplurals = 4; 
    378367                $cy->plural_expression = '(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3'; 
    379368 
     
    385374                $da->country_code = 'dk'; 
    386375                $da->wp_locale = 'da_DK'; 
    387376                $da->slug = 'da'; 
    388                 $da->google_code = 'da'; 
    389377                 
    390378                $de = new GP_Locale(); 
    391379                $de->english_name = 'German'; 
     
    394382                $de->country_code = 'de'; 
    395383                $de->wp_locale = 'de_DE'; 
    396384                $de->slug = 'de'; 
    397                 $de->google_code = 'de'; 
    398385                 
    399386                $dv = new GP_Locale(); 
    400387                $dv->english_name = 'Divehi'; 
     
    404391                $dv->country_code = 'mv'; 
    405392                $dv->wp_locale = 'dv'; 
    406393                $dv->slug = 'dv'; 
    407                 $dv->google_code = 'dv'; 
    408394                $dv->rtl = true; 
    409395                 
    410396                $dz = new GP_Locale(); 
     
    441427                $el->country_code = 'gr'; 
    442428                $el->wp_locale = 'el'; 
    443429                $el->slug = 'el'; 
    444                 $el->google_code = 'el'; 
    445430                 
    446431                $en = new GP_Locale(); 
    447432                $en->english_name = 'English'; 
     
    450435                $en->country_code = 'us'; 
    451436                $en->wp_locale = 'en_US'; 
    452437                $en->slug = 'en'; 
    453                 $en->google_code = 'en'; 
    454438                 
    455439                $en_ca = new GP_Locale(); 
    456440                $en_ca->english_name = 'English (Canada)'; 
     
    461445                $en_ca->country_code = 'ca'; 
    462446                $en_ca->wp_locale = 'en_CA'; 
    463447                $en_ca->slug = 'en-ca'; 
    464                 $en_ca->google_code = 'en'; 
    465448                                 
    466449                $en_gb = new GP_Locale(); 
    467450                $en_gb->english_name = 'English (UK)'; 
     
    471454                $en_gb->lang_code_iso_639_3 = 'eng'; 
    472455                $en_gb->country_code = 'gb'; 
    473456                $en_gb->wp_locale = 'en_GB'; 
    474                 $en_gb->slug = 'en-gb'; 
    475                 $en_gb->google_code = 'en';              
     457                $en_gb->slug = 'en-gb';  
    476458 
    477459                $eo = new GP_Locale(); 
    478460                $eo->english_name = 'Esperanto'; 
     
    482464                $eo->country_code = ''; 
    483465                $eo->wp_locale = 'eo'; 
    484466                $eo->slug = 'eo'; 
    485                 $eo->google_code = 'eo'; 
    486467 
    487468                $es_cl = new GP_Locale(); 
    488469                $es_cl->english_name = 'Spanish (Chile)'; 
     
    492473                $es_cl->country_code = 'cl'; 
    493474                $es_cl->wp_locale = 'es_CL'; 
    494475                $es_cl->slug = 'es-cl'; 
    495                 $es_cl->google_code = 'es'; 
    496476 
    497477                $es_pe = new GP_Locale(); 
    498478                $es_pe->english_name = 'Spanish (Peru)'; 
     
    502482                $es_pe->country_code = 'pe'; 
    503483                $es_pe->wp_locale = 'es_PE'; 
    504484                $es_pe->slug = 'es-pe'; 
    505                 $es_pe->google_code = 'es'; 
    506485 
    507486                $es_pr = new GP_Locale(); 
    508487                $es_pr->english_name = 'Spanish (Puerto Rico)'; 
     
    512491                $es_pr->country_code = 'pr'; 
    513492                $es_pr->wp_locale = 'es_PR'; 
    514493                $es_pr->slug = 'es-pr'; 
    515                 $es_pr->google_code = 'es'; 
    516494                 
    517495                $es_ve = new GP_Locale(); 
    518496                $es_ve->english_name = 'Spanish (Venezuela)'; 
     
    522500                $es_ve->country_code = 'pe'; 
    523501                $es_ve->wp_locale = 'es_VE'; 
    524502                $es_ve->slug = 'es-ve'; 
    525                 $es_ve->google_code = 'es'; 
    526503 
    527504                $es_co = new GP_Locale(); 
    528505                $es_co->english_name = 'Spanish (Colombia)'; 
     
    532509                $es_co->country_code = 'co'; 
    533510                $es_co->wp_locale = 'es_CO'; 
    534511                $es_co->slug = 'es-co'; 
    535                 $es_co->google_code = 'es'; 
    536512 
    537513                $es = new GP_Locale(); 
    538514                $es->english_name = 'Spanish (Spain)'; 
     
    541517                $es->country_code = 'es'; 
    542518                $es->wp_locale = 'es_ES'; 
    543519                $es->slug = 'es'; 
    544                 $es->google_code = 'es'; 
    545520                 
    546521                $et = new GP_Locale(); 
    547522                $et->english_name = 'Estonian'; 
     
    551526                $et->country_code = 'ee'; 
    552527                $et->wp_locale = 'et'; 
    553528                $et->slug = 'et'; 
    554                 $et->google_code = 'et'; 
    555529 
    556530                $eu = new GP_Locale(); 
    557531                $eu->english_name = 'Basque'; 
     
    561535                $eu->country_code = 'es'; 
    562536                $eu->wp_locale = 'eu'; 
    563537                $eu->slug = 'eu'; 
    564                 $eu->google_code = 'eu'; 
    565538 
    566539                $fa = new GP_Locale(); 
    567540                $fa->english_name = 'Persian'; 
     
    571544                $fa->country_code = ''; 
    572545                $fa->wp_locale = 'fa_IR'; 
    573546                $fa->slug = 'fa'; 
    574                 $fa->google_code = 'fa'; 
    575547                $fa->nplurals = 1; 
    576548                $fa->plural_expression = '0'; 
    577549                $fa->rtl = true; 
     
    584556                $fa_af->country_code = ''; 
    585557                $fa_af->wp_locale = 'fa_AF'; 
    586558                $fa_af->slug = 'fa-af'; 
    587                 $fa_af->google_code = 'fa'; 
    588559                $fa_af->nplurals = 1; 
    589560                $fa_af->plural_expression = '0'; 
    590561                $fa_af->rtl = true; 
     
    597568                $fi->country_code = 'fi'; 
    598569                $fi->wp_locale = 'fi'; 
    599570                $fi->slug = 'fi'; 
    600                 $fi->google_code = 'fi'; 
    601571 
    602572                $fj = new GP_Locale(); 
    603573                $fj->english_name = 'Fijian'; 
     
    623593                $fr->country_code = 'fr'; 
    624594                $fr->wp_locale = 'fr_FR'; 
    625595                $fr->slug = 'fr'; 
    626                 $fr->google_code = 'fr'; 
    627596                $fr->nplurals = 2; 
    628597                $fr->plural_expression = 'n > 1'; 
    629598 
     
    668637                $ga->lang_code_iso_639_2 = 'gle'; 
    669638                $ga->country_code = 'ie'; 
    670639                $ga->slug = 'ga'; 
    671                 $ga->google_code = 'ga'; 
    672640                $ga->nplurals = 5; 
    673641                $ga->plural_expression = 'n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4'; 
    674642                 
     
    681649                $gd->country_code = 'uk'; 
    682650                $gd->wp_locale = 'gd'; 
    683651                $gd->slug = 'gd'; 
    684                 $gd->google_code = 'gd'; 
    685652                $gd->nplurals = 4; 
    686653                $gd->plural_expression = '(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3';                
    687654 
     
    693660                $gl->country_code = 'es'; 
    694661                $gl->wp_locale = 'gl_ES'; 
    695662                $gl->slug = 'gl'; 
    696                 $gl->google_code = 'gl'; 
    697663 
    698664                $gn = new GP_Locale(); 
    699665                $gn->english_name = 'Guaraní'; 
     
    703669                $gn->country_code = ''; 
    704670                $gn->wp_locale = 'gn'; 
    705671                $gn->slug = 'gn'; 
    706                 $gn->google_code = 'gn'; 
    707672 
    708673                $gu = new GP_Locale(); 
    709674                $gu->english_name = 'Gujarati'; 
     
    712677                $gu->lang_code_iso_639_2 = 'guj'; 
    713678                $gu->country_code = ''; 
    714679                $gu->slug = 'gu'; 
    715                 $gu->google_code = 'gu'; 
    716680 
    717681                $ha = new GP_Locale(); 
    718682                $ha->english_name = 'Hausa'; 
     
    739703                $he->country_code = 'il'; 
    740704                $he->wp_locale = 'he_IL'; 
    741705                $he->slug = 'he'; 
    742                 $he->google_code = 'iw'; 
    743706                $he->rtl = true; 
    744707 
    745708                $hi = new GP_Locale(); 
     
    750713                $hi->country_code = 'in'; 
    751714                $hi->wp_locale = 'hi_IN'; 
    752715                $hi->slug = 'hi'; 
    753                 $hi->google_code = 'hi'; 
    754716 
    755717                $hr = new GP_Locale(); 
    756718                $hr->english_name = 'Croatian'; 
     
    760722                $hr->country_code = 'hr'; 
    761723                $hr->wp_locale = 'hr'; 
    762724                $hr->slug = 'hr'; 
    763                 $hr->google_code = 'hr'; 
    764725                $hr->nplurals = 3; 
    765726                $hr->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    766727 
     
    772733                $hu->country_code = 'hu'; 
    773734                $hu->wp_locale = 'hu_HU'; 
    774735                $hu->slug = 'hu'; 
    775                 $hu->google_code = 'hu'; 
    776736 
    777737                $hy = new GP_Locale(); 
    778738                $hy->english_name = 'Armenian'; 
     
    800760                $id->country_code = 'id'; 
    801761                $id->wp_locale = 'id_ID'; 
    802762                $id->slug = 'id'; 
    803                 $id->google_code = 'id'; 
    804763                $id->nplurals = 2; 
    805764                $id->plural_expression = 'n > 1'; 
    806765 
     
    827786                $is->lang_code_iso_639_2 = 'isl'; 
    828787                $is->country_code = 'is'; 
    829788                $is->slug = 'is'; 
    830                 $is->google_code = 'is'; 
    831789                $is->wp_locale = 'is_IS'; 
    832790                $is->nplurals = 2; 
    833791                $is->plural_expression = '(n % 100 != 1 && n % 100 != 21 && n % 100 != 31 && n % 100 != 41 && n % 100 != 51 && n % 100 != 61 && n % 100 != 71 && n % 100 != 81 && n % 100 != 91)'; 
     
    840798                $it->country_code = 'it'; 
    841799                $it->wp_locale = 'it_IT'; 
    842800                $it->slug = 'it'; 
    843                 $it->google_code = 'it'; 
    844801 
    845802                $ja = new GP_Locale(); 
    846803                $ja->english_name = 'Japanese'; 
     
    849806                $ja->country_code = 'jp'; 
    850807                $ja->wp_locale = 'ja'; 
    851808                $ja->slug = 'ja'; 
    852                 $ja->google_code = 'ja'; 
    853809                $ja->nplurals = 1; 
    854810                $ja->plural_expression = '0'; 
    855811 
     
    870826                $ka->country_code = 'ge'; 
    871827                $ka->wp_locale = 'ka_GE'; 
    872828                $ka->slug = 'ka'; 
    873                 $ka->google_code = 'ka'; 
    874829                $ka->nplurals = 1; 
    875830                $ka->plural_expression = '0'; 
    876831 
     
    882837                $kk->country_code = 'kz'; 
    883838                $kk->wp_locale = 'kk'; 
    884839                $kk->slug = 'kk'; 
    885                 $kk->google_code = 'kk'; 
    886840 
    887841                $km = new GP_Locale(); 
    888842                $km->english_name = 'Khmer'; 
     
    891845                $km->lang_code_iso_639_2 = 'khm'; 
    892846                $km->country_code = 'kh'; 
    893847                $km->slug = 'km'; 
    894                 $km->google_code = 'km'; 
    895848                $km->nplurals = 1; 
    896849                $km->plural_expression = '0'; 
    897850 
     
    903856                $kn->country_code = 'in'; 
    904857                $kn->wp_locale = 'kn'; 
    905858                $kn->slug = 'kn'; 
    906                 $kn->google_code = 'kn'; 
    907859 
    908860                $ko = new GP_Locale(); 
    909861                $ko->english_name = 'Korean'; 
     
    913865                $ko->country_code = 'kr'; 
    914866                $ko->wp_locale = 'ko_KR'; 
    915867                $ko->slug = 'ko'; 
    916                 $ko->google_code = 'ko'; 
    917868                $ko->nplurals = 1; 
    918869                $ko->plural_expression = '0'; 
    919870 
     
    932883                $ku->lang_code_iso_639_2 = 'kur'; 
    933884                $ku->country_code = 'ku'; 
    934885                $ku->slug = 'ku'; 
    935                 $ku->google_code = 'ku'; 
    936886 
    937887                $ky = new GP_Locale(); 
    938888                $ky->english_name = 'Kirghiz'; 
     
    970920                $li->country_code = 'nl'; 
    971921                $li->wp_locale = 'li'; 
    972922                $li->slug = 'li'; 
    973                 $li->google_code = 'li'; 
    974923                 
    975924                $lo = new GP_Locale(); 
    976925                $lo->english_name = 'Lao'; 
     
    980929                $lo->country_code = ''; 
    981930                $lo->wp_locale = 'lo'; 
    982931                $lo->slug = 'lo'; 
    983                 $lo->google_code = 'lo'; 
    984932                $lo->nplurals = 1; 
    985933                $lo->plural_expression = '0'; 
    986934 
     
    991939                $lt->lang_code_iso_639_2 = 'lit'; 
    992940                $lt->country_code = 'lt'; 
    993941                $lt->slug = 'lt'; 
    994                 $lt->google_code = 'lt'; 
    995942                $lt->nplurals = 3; 
    996943                $lt->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    997944 
     
    1003950                $lv->country_code = 'lv'; 
    1004951                $lv->wp_locale = 'lv'; 
    1005952                $lv->slug = 'lv'; 
    1006                 $lv->google_code = 'lv'; 
    1007953                $lv->nplurals = 3; 
    1008954                $lv->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)'; 
    1009955                 
     
    1013959                $me->lang_code_iso_639_1 = 'me'; 
    1014960                $me->country_code = 'me'; 
    1015961                $me->wp_locale = 'me_ME'; 
    1016                 $me->google_code = 'srp'; 
    1017962                $me->slug = 'me'; 
    1018963                 
    1019964                $mg = new GP_Locale(); 
     
    1033978                $mhr->lang_code_iso_639_3 = 'mhr'; 
    1034979                $mhr->country_code = 'ru'; 
    1035980                $mhr->slug = 'mhr'; 
    1036                 $mhr->google_code = 'chm';       
    1037981                                 
    1038982                $mk = new GP_Locale(); 
    1039983                $mk->english_name = 'Macedonian'; 
     
    1043987                $mk->country_code = 'mk'; 
    1044988                $mk->wp_locale = 'mk_MK'; 
    1045989                $mk->slug = 'mk'; 
    1046                 $mk->google_code = 'mk'; 
    1047990                $mk->nplurals = 2; 
    1048991                $mk->plural_expression = 'n==1 || n%10==1 ? 0 : 1'; 
    1049992 
     
    1055998                $ml->country_code = 'in'; 
    1056999                $ml->wp_locale = 'ml_IN'; 
    10571000                $ml->slug = 'ml'; 
    1058                 $ml->google_code = 'ml'; 
    10591001 
    10601002                $mn = new GP_Locale(); 
    10611003                $mn->english_name = 'Mongolian'; 
     
    10641006                $mn->lang_code_iso_639_2 = 'mon'; 
    10651007                $mn->country_code = 'mn'; 
    10661008                $mn->slug = 'mn'; 
    1067                 $mn->google_code = 'mn'; 
    10681009 
    10691010                $mr = new GP_Locale(); 
    10701011                $mr->english_name = 'Marathi'; 
     
    10731014                $mr->lang_code_iso_639_2 = 'mar'; 
    10741015                $mr->country_code = ''; 
    10751016                $mr->slug = 'mr'; 
    1076                 $mr->google_code = 'mr'; 
    10771017                 
    10781018                $mrj = new GP_Locale(); 
    10791019                $mrj->english_name = 'Mari (Hill)'; 
     
    10831023                $mrj->lang_code_iso_639_3 = 'mrj'; 
    10841024                $mrj->country_code = 'ru'; 
    10851025                $mrj->slug = 'mrj'; 
    1086                 $mrj->google_code = 'chm';               
    10871026 
    10881027                $ms = new GP_Locale(); 
    10891028                $ms->english_name = 'Malay'; 
     
    10931032                $ms->country_code = ''; 
    10941033                $ms->wp_locale = 'ms_MY'; 
    10951034                $ms->slug = 'ms'; 
    1096                 $ms->google_code = 'ms'; 
    10971035                $ms->nplurals = 1; 
    10981036                $ms->plural_expression = '0'; 
    10991037 
     
    11131051                $my->country_code = 'mm'; 
    11141052                $my->wp_locale = 'my_MM'; 
    11151053                $my->slug = 'mya'; 
    1116                 $my->google_code = 'my'; 
    11171054 
    11181055                $ne = new GP_Locale(); 
    11191056                $ne->english_name = 'Nepali'; 
     
    11321069                $nb->country_code = 'no'; 
    11331070                $nb->wp_locale = 'nb_NO'; 
    11341071                $nb->slug = 'nb'; 
    1135                 $nb->google_code = 'no'; 
    11361072 
    11371073                $nl = new GP_Locale(); 
    11381074                $nl->english_name = 'Dutch'; 
     
    11421078                $nl->country_code = 'nl'; 
    11431079                $nl->wp_locale = 'nl_NL'; 
    11441080                $nl->slug = 'nl'; 
    1145                 $nl->google_code = 'nl'; 
    11461081 
    11471082                $nl_be = new GP_Locale(); 
    11481083                $nl_be->english_name = 'Dutch (Belgium)'; 
     
    11521087                $nl_be->country_code = 'be'; 
    11531088                $nl_be->wp_locale = 'nl_BE'; 
    11541089                $nl_be->slug = 'nl-be'; 
    1155                 $nl_be->google_code = 'nl'; 
    11561090                 
    11571091                $nn = new GP_Locale(); 
    11581092                $nn->english_name = 'Norwegian (Nynorsk)'; 
     
    11701104                $no->lang_code_iso_639_2 = 'nor'; 
    11711105                $no->country_code = 'no'; 
    11721106                $no->slug = 'no'; 
    1173                 $no->google_code = 'no'; 
    11741107 
    11751108                $oc = new GP_Locale(); 
    11761109                $oc->english_name = 'Occitan'; 
     
    12061139                $pl->country_code = 'pl'; 
    12071140                $pl->wp_locale = 'pl_PL'; 
    12081141                $pl->slug = 'pl'; 
    1209                 $pl->google_code = 'pl'; 
    12101142                $pl->nplurals = 3; 
    12111143                $pl->plural_expression = '(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    12121144 
     
    12191151                $pt_br->country_code = 'br'; 
    12201152                $pt_br->wp_locale = 'pt_BR'; 
    12211153                $pt_br->slug = 'pt-br'; 
    1222                 $pt_br->google_code = 'pt-PT'; 
    12231154                $pt_br->nplurals = 2; 
    12241155                $pt_br->plural_expression = '(n > 1)'; 
    12251156                 
     
    12301161                $pt->country_code = 'pt'; 
    12311162                $pt->wp_locale = 'pt_PT'; 
    12321163                $pt->slug = 'pt'; 
    1233                 $pt->google_code = 'pt-PT'; 
    12341164                 
    12351165                $ps = new GP_Locale(); 
    12361166                $ps->english_name = 'Pashto'; 
     
    12391169                $ps->country_code = ''; 
    12401170                $ps->wp_locale = 'ps'; 
    12411171                $ps->slug = 'ps'; 
    1242                 $ps->google_code = 'ps'; 
    12431172                $ps->rtl = true;                 
    12441173 
    12451174                $ro = new GP_Locale(); 
     
    12501179                $ro->country_code = 'ro'; 
    12511180                $ro->wp_locale = 'ro_RO'; 
    12521181                $ro->slug = 'ro'; 
    1253                 $ro->google_code = 'ro'; 
    12541182                $ro->nplurals = 3; 
    12551183                $ro->plural_expression = '(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2)'; 
    12561184 
     
    12621190                $ru->country_code = 'ru'; 
    12631191                $ru->wp_locale = 'ru_RU'; 
    12641192                $ru->slug = 'ru'; 
    1265                 $ru->google_code = 'ru'; 
    12661193                $ru->nplurals = 3; 
    12671194                $ru->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    12681195 
     
    12741201                $ru_ua->country_code = 'ua'; 
    12751202                $ru_ua->wp_locale = 'ru_UA'; 
    12761203                $ru_ua->slug = 'ru-ua'; 
    1277                 $ru_ua->google_code = 'ru'; 
    12781204                $ru_ua->nplurals = 3; 
    12791205                $ru_ua->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    12801206         
     
    13271253                $sd->country_code = 'pk'; 
    13281254                $sd->wp_locale = 'sd_PK'; 
    13291255                $sd->slug = 'sd'; 
    1330                 $sd->google_code = 'sd'; 
    13311256 
    13321257                $si = new GP_Locale(); 
    13331258                $si->english_name = 'Sinhala'; 
     
    13371262                $si->country_code = 'lk'; 
    13381263                $si->wp_locale = 'si_LK'; 
    13391264                $si->slug = 'si'; 
    1340                 $si->google_code = 'si'; 
    13411265 
    13421266                $sk = new GP_Locale(); 
    13431267                $sk->english_name = 'Slovak'; 
     
    13471271                $sk->country_code = 'sk'; 
    13481272                $sk->slug = 'sk'; 
    13491273                $sk->wp_locale = 'sk_SK'; 
    1350                 $sk->google_code = 'sk'; 
    13511274                $sk->nplurals = 3; 
    13521275                $sk->plural_expression = '(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'; 
    13531276 
     
    13591282                $sl->country_code = 'si'; 
    13601283                $sl->wp_locale = 'sl_SI'; 
    13611284                $sl->slug = 'sl'; 
    1362                 $sl->google_code = 'sl'; 
    13631285                $sl->nplurals = 4; 
    13641286                $sl->plural_expression = '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)'; 
    13651287                 
     
    13721294                $so->country_code = 'so'; 
    13731295                $so->wp_locale = 'so_SO'; 
    13741296                $so->slug = 'so'; 
    1375                 $so->google_code = 'so'; 
    13761297                 
    13771298                $sq = new GP_Locale(); 
    13781299                $sq->english_name = 'Albanian'; 
     
    13821303                $sq->wp_locale = 'sq'; 
    13831304                $sq->country_code = 'al'; 
    13841305                $sq->slug = 'sq'; 
    1385                 $sq->google_code = 'sq'; 
    13861306 
    13871307                $sr = new GP_Locale(); 
    13881308                $sr->english_name = 'Serbian'; 
     
    13921312                $sr->country_code = 'rs'; 
    13931313                $sr->wp_locale = 'sr_RS'; 
    13941314                $sr->slug = 'sr'; 
    1395                 $sr->google_code = 'sr'; 
    13961315                $sr->nplurals = 3; 
    13971316                $sr->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    13981317 
     
    14241343                $sv->country_code = 'se'; 
    14251344                $sv->wp_locale = 'sv_SE'; 
    14261345                $sv->slug = 'sv'; 
    1427                 $sv->google_code = 'sv'; 
    14281346 
    14291347                $sw = new GP_Locale(); 
    14301348                $sw->english_name = 'Swahili'; 
     
    14341352                $sw->country_code = ''; 
    14351353                $sw->wp_locale = 'sw'; 
    14361354                $sw->slug = 'sw'; 
    1437                 $sw->google_code = 'sw'; 
    14381355 
    14391356                $ta = new GP_Locale(); 
    14401357                $ta->english_name = 'Tamil'; 
     
    14441361                $ta->country_code = 'IN'; 
    14451362                $ta->wp_locale = 'ta_IN'; 
    14461363                $ta->slug = 'ta'; 
    1447                 $ta->google_code = 'ta'; 
    14481364                 
    14491365                $ta_lk = new GP_Locale(); 
    14501366                $ta_lk->english_name = 'Tamil (Sri Lanka)'; 
     
    14541370                $ta_lk->country_code = 'LK'; 
    14551371                $ta_lk->wp_locale = 'ta_LK'; 
    14561372                $ta_lk->slug = 'ta-lk'; 
    1457                 $ta_lk->google_code = 'ta'; 
    14581373 
    14591374                $te = new GP_Locale(); 
    14601375                $te->english_name = 'Telugu'; 
     
    14641379                $te->country_code = ''; 
    14651380                $te->wp_locale = 'te'; 
    14661381                $te->slug = 'te'; 
    1467                 $te->google_code = 'te'; 
    14681382 
    14691383                $th = new GP_Locale(); 
    14701384                $th->english_name = 'Thai'; 
     
    14741388                $th->country_code = ''; 
    14751389                $th->wp_locale = 'th'; 
    14761390                $th->slug = 'th'; 
    1477                 $th->google_code = 'th'; 
    14781391                $th->nplurals = 1; 
    14791392                $th->plural_expression = '0'; 
    14801393                 
     
    14951408                $tl->lang_code_iso_639_2 = 'tgl'; 
    14961409                $tl->country_code = 'ph'; 
    14971410                $tl->slug = 'tl'; 
    1498                 $tl->google_code = 'tl'; 
    14991411 
    15001412                $tr = new GP_Locale(); 
    15011413                $tr->english_name = 'Turkish'; 
     
    15051417                $tr->country_code = 'tr'; 
    15061418                $tr->wp_locale = 'tr_TR'; 
    15071419                $tr->slug = 'tr'; 
    1508                 $tr->google_code = 'tr'; 
    15091420                $tr->nplurals = 2; 
    15101421                $tr->plural_expression = '(n > 1)'; 
    15111422 
     
    15251436                $ug->country_code = 'cn'; 
    15261437                $ug->wp_locale = 'ug_CN'; 
    15271438                $ug->slug = 'ug'; 
    1528                 $ug->google_code = 'ug'; 
    15291439 
    15301440                $uk = new GP_Locale(); 
    15311441                $uk->english_name = 'Ukrainian'; 
     
    15351445                $uk->country_code = 'ua'; 
    15361446                $uk->wp_locale = 'uk'; 
    15371447                $uk->slug = 'uk'; 
    1538                 $uk->google_code = 'uk'; 
    15391448                $uk->nplurals = 3; 
    15401449                $uk->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; 
    15411450 
     
    15471456                $ur->country_code = ''; 
    15481457                $ur->wp_locale = 'ur'; 
    15491458                $ur->slug = 'ur'; 
    1550                 $ur->google_code = 'ur'; 
    15511459 
    15521460                $uz = new GP_Locale(); 
    15531461                $uz->english_name = 'Uzbek'; 
     
    15571465                $uz->country_code = 'uz'; 
    15581466                $uz->wp_locale = 'uz_UZ'; 
    15591467                $uz->slug = 'uz'; 
    1560                 $uz->google_code = 'uz'; 
    15611468                $uz->rtl = true; 
    15621469                $uz->nplurals = 1; 
    15631470                $uz->plural_expression = '0'; 
     
    15781485                $vi->country_code = 'vn'; 
    15791486                $vi->wp_locale = 'vi'; 
    15801487                $vi->slug = 'vi'; 
    1581                 $vi->google_code = 'vi'; 
    15821488                $vi->nplurals = 1; 
    15831489                $vi->plural_expression = '0'; 
    15841490 
     
    16081514                $yi->lang_code_iso_639_2 = 'yid'; 
    16091515                $yi->country_code = ''; 
    16101516                $yi->slug = 'yi'; 
    1611                 $yi->google_code = 'yi'; 
    16121517                $yi->rtl = true; 
    16131518 
    16141519                $zh_cn = new GP_Locale(); 
     
    16191524                $zh_cn->country_code = 'cn'; 
    16201525                $zh_cn->wp_locale = 'zh_CN'; 
    16211526                $zh_cn->slug = 'zh-cn'; 
    1622                 $zh_cn->google_code = 'zh-CN'; 
    16231527                $zh_cn->nplurals = 1; 
    16241528                $zh_cn->plural_expression = '0'; 
    16251529 
     
    16521556                $zh_tw->country_code = 'tw'; 
    16531557                $zh_tw->slug = 'zh-tw'; 
    16541558                $zh_tw->wp_locale= 'zh_TW'; 
    1655                 $zh_tw->google_code = 'zh-TW'; 
    16561559                $zh_tw->nplurals = 1; 
    16571560                $zh_tw->plural_expression = '0'; 
    16581561 
  • gp-settings.php

     
    276276 
    277277require_once( GP_PATH . GP_INC . 'warnings.php' ); 
    278278require_once( GP_PATH . GP_INC . 'validation.php' ); 
    279 require_once( GP_PATH . GP_INC . 'google.php' ); 
    280279require_once( GP_PATH . GP_INC . 'advanced-permissions.php' ); 
    281280 
    282281require_once GP_PATH . GP_INC . 'thing.php'; 
  • gp-templates/translations.php

     
    88wp_enqueue_script( 'translations-page' ); 
    99// localizer adds var in front of the variable name, so we can't use $gp.editor.options 
    1010$editor_options = compact('can_approve', 'can_write', 'url', 'discard_warning_url', 'set_priority_url', 'set_status_url'); 
    11 $editor_options['google_translate_language'] = $locale->google_code; 
    1211wp_localize_script( 'editor', '$gp_editor_options', $editor_options ); 
    1312$parity = gp_parity_factory(); 
    1413add_action( 'gp_head', lambda( '', 'gp_preferred_sans_serif_style_tag($locale);', compact( 'locale' ) ) ); 
     
    2726                <option value="" selected="selected">Bulk Actions</option> 
    2827                <option value="approve">Approve</option> 
    2928                <option value="reject">Reject</option> 
    30                 <option value="gtranslate">Translate via Google</option> 
    3129        </select> 
    3230        <input type="hidden" name="bulk[redirect_to]" value="<?php echo esc_attr(gp_url_current()); ?>" id="bulk[redirect_to]" /> 
    3331        <input type="hidden" name="bulk[row-ids]" value="" id="bulk[row-ids]" /> 
  • gp-templates/helper-functions.php

     
    2727 
    2828                <?php if ( $can_edit ): ?> 
    2929                        <p> 
    30                                 <a href="#" class="copy" tabindex="-1"><?php _e('Copy from original'); ?></a> &bull; 
    31                                 <a href="#" class="gtranslate" tabindex="-1"><?php _e('Translation from Google'); ?></a> 
     30                                <a href="#" class="copy" tabindex="-1"><?php _e('Copy from original'); ?></a> 
    3231                        </p> 
    3332                <?php else: ?> 
    3433                        <p> 
  • gp-includes/routes/translation.php

     
    138138                        if ( 'approve' == $bulk['action'] || 'reject' == $bulk['action'] ) { 
    139139                                $this->_bulk_approve( $project, $locale, $translation_set, $bulk ); 
    140140                        } 
    141  
    142                         if ( 'gtranslate' == $bulk['action'] ) { 
    143                                 $this->_bulk_google_translate( $project, $locale, $translation_set, $bulk ); 
    144                         } 
    145141                } else { 
    146142                        $this->errors[] = 'No translations were supplied.'; 
    147143                } 
     
    198194                        } 
    199195                } 
    200196        } 
    201          
    202         function _bulk_google_translate( $project, $locale, $translation_set, $bulk ) { 
    203                 $google_errors = 0; 
    204                 $insert_errors = 0; 
    205                 $ok = 0; 
    206                 $skipped = 0; 
    207                  
    208                 $singulars = array(); 
    209                 $original_ids = array(); 
    210                 foreach( $bulk['row-ids'] as $row_id ) { 
    211                         if ( gp_in( '-', $row_id) ) { 
    212                                 $skipped++; 
    213                                 continue; 
    214                         } 
    215                         $original_id = gp_array_get( split( '-', $row_id ), 0 ); 
    216                         $original = GP::$original->get( $original_id ); 
    217                         if ( !$original || $original->plural ) { 
    218                                 $skipped++; 
    219                                 continue; 
    220                         } 
    221                         $singulars[] = $original->singular; 
    222                         $original_ids[] = $original_id; 
    223                 } 
    224                 $results = google_translate_batch( $locale, $singulars ); 
    225                 if ( is_wp_error( $results ) ) { 
    226                         error_log( print_r( $results, true ) ); 
    227                         $this->errors[] = $results->get_error_message(); 
    228                         return; 
    229                 } 
    230                 foreach( gp_array_zip( $original_ids, $singulars, $results )  as $item ) { 
    231                         list( $original_id, $singular, $translation ) = $item; 
    232                         if ( is_wp_error( $translation ) ) { 
    233                                 $google_errors++; 
    234                                 error_log( $translation->get_error_message() ); 
    235                                 continue; 
    236                         } 
    237                         $data = compact( 'original_id' ); 
    238                         $data['user_id'] = GP::$user->current()->id; 
    239                         $data['translation_set_id'] = $translation_set->id; 
    240                         $data['translation_0'] = $translation; 
    241                         $data['status'] = 'fuzzy'; 
    242                         $data['warnings'] = GP::$translation_warnings->check( $singular, null, array( $translation ), $locale ); 
    243                         $inserted = GP::$translation->create( $data ); 
    244                         $inserted? $ok++ : $insert_errors++; 
    245                 } 
    246                 if ( $google_errors > 0 || $insert_errors > 0 ) { 
    247                         $message = array(); 
    248                         if ( $ok ) $message[] = sprintf( __('Added: %d.' ), $ok ); 
    249                         if ( $google_errors ) $message[] = sprintf( __('Error from Google Translate: %d.' ), $google_errors ); 
    250                         if ( $insert_errors ) $message[] = sprintf( __('Error adding: %d.' ), $insert_errors ); 
    251                         if ( $skipped ) $message[] = sprintf( __('Skipped: %d.' ), $skipped ); 
    252                         $this->errors[] = implode( '', $message ); 
    253                 } else { 
    254                         $this->notices[] = sprintf( __('%d fuzzy translation from Google Translate were added.' ), $ok ); 
    255                 } 
    256         } 
    257197                         
    258198        function discard_warning( $project_path, $locale_slug, $translation_set_slug ) { 
    259199                return $this->edit_single_translation( $project_path, $locale_slug, $translation_set_slug, array( $this, 'discard_warning_edit_function' ) ); 
  • js/editor.js

     
    4949                        .on('change', 'select.priority', $gp.editor.hooks.set_priority) 
    5050                        .on('click', 'a.close', $gp.editor.hooks.hide) 
    5151                        .on('click', 'a.copy', $gp.editor.hooks.copy) 
    52                         .on('click', 'a.gtranslate', $gp.editor.hooks.google_translate) 
    5352                        .on('click', 'a.discard-warning', $gp.editor.hooks.discard_warning) 
    5453                        .on('click', 'button.approve', $gp.editor.hooks.set_status_current) 
    5554                        .on('click', 'button.reject', $gp.editor.hooks.set_status_rejected) 
     
    155154                original_text = original_text.replace(/<span class=.invisibles.*?<\/span>/g, ''); 
    156155                a = link.parents('.textareas').find('textarea').val(original_text).focus(); 
    157156        }, 
    158         google_translate: function(link) { 
    159                 original_text = link.parents('.textareas').siblings('.original').html(); 
    160                 if (!original_text) original_text = link.parents('.textareas').siblings('p:last').children('.original').html(); 
    161                 if (!original_text) return; 
    162                 if (typeof google == 'undefined') { 
    163                         $gp.notices.error('Couldn&#8217;t load Google Translate library!'); 
    164                         return; 
    165                 } 
    166                 $gp.notices.notice('Translating via Google Translate&hellip;');          
    167                 google.language.translate({text: original_text, type: 'html'}, 'en', $gp_editor_options.google_translate_language, function(result) { 
    168                         if (!result.error) { 
    169                                 // fix common google translate misbehaviours 
    170                                 result.translation = result.translation.replace(/% (s|d)/gi, function(m, letter) { 
    171                                         return '%'+letter.toLowerCase(); 
    172                                 }); 
    173                                 result.translation = result.translation.replace(/% (\d+) \$ (S|D)/gi, function(m, number, letter) { 
    174                                         return '%'+number+'$'+letter.toLowerCase(); 
    175                                 }); 
    176                                 result.translation = result.translation.replace(/&lt;\/\s+([A-Z]+)&gt;/g, function(m, tag) { 
    177                                         return '&lt;/'+tag.toLowerCase()+'&gt;'; 
    178                                 }); 
    179  
    180                                 link.parent('p').siblings('textarea').html(result.translation).focus(); 
    181                                 $gp.notices.success('Translated!'); 
    182                         } else { 
    183                                 $gp.notices.error('Error in translating via Google Translate: '+result.message+'!'); 
    184                                 link.parent('p').siblings('textarea').focus(); 
    185                         } 
    186                 });              
    187         }, 
    188157        hooks: { 
    189158                show: function() { 
    190159                        $gp.editor.show($(this)); 
     
    202171                        $gp.editor.copy($(this)); 
    203172                        return false; 
    204173                }, 
    205                 google_translate: function() { 
    206                         $gp.editor.google_translate($(this)); 
    207                         return false; 
    208                 }, 
    209174                discard_warning: function() { 
    210175                        $gp.editor.discard_warning($(this)); 
    211176                        return false; 
     
    225190        } 
    226191}}(jQuery); 
    227192 
    228 if (typeof google != 'undefined') google.load("language", "1"); 
    229  
    230193jQuery(function($) { 
    231194        $gp.editor.init($('#translations')); 
    232195});