Merge pull request #631 from fabrixxm/addonlangs

Per addon translation
pull/635/merge
friendica 2013-02-27 16:53:08 -08:00
commit 079c638403
18 zmienionych plików z 109 dodań i 9988 usunięć

Wyświetl plik

@ -90,12 +90,21 @@ function pop_lang() {
if(! function_exists('load_translation_table')) {
function load_translation_table($lang) {
global $a;
$a->strings = array();
if(file_exists("view/$lang/strings.php")) {
include("view/$lang/strings.php");
}
else
$a->strings = array();
// load enabled plugins strings
$plugins = q("SELECT name FROM addon WHERE installed=1;");
if ($plugins!==false) {
foreach($plugins as $p) {
$name = $p['name'];
if(file_exists("addon/$name/lang/$lang/strings.php")) {
include("addon/$name/lang/$lang/strings.php");
}
}
}
}}
// translate string if translation exists

Wyświetl plik

@ -32,9 +32,7 @@ $install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false
$lang = get_browser_language();
load_translation_table($lang);
/**
*
@ -62,6 +60,9 @@ if(!$install) {
$maintenance = get_config('system', 'maintenance');
}
$lang = get_browser_language();
load_translation_table($lang);
/**
*

Plik diff jest za duży Load Diff

Wyświetl plik

@ -46,9 +46,12 @@ function po2php_run(&$argv, &$argc) {
$match=Array();
preg_match("|nplurals=([0-9]*); *plural=(.*)[;\\\\]|", $l, $match);
$cond = str_replace('n','$n',$match[2]);
$out .= 'function string_plural_select_' . $lang . '($n){'."\n";
// define plural select function if not already defined
$fnname = 'string_plural_select_' . $lang;
$out .= 'if(! function_exists("'.$fnname.'")) {'."\n";
$out .= 'function '. $fnname . '($n){'."\n";
$out .= ' return '.$cond.';'."\n";
$out .= '}'."\n";
$out .= '}}'."\n";
}

Wyświetl plik

@ -1,37 +1,76 @@
#!/bin/bash
FULLPATH=$(dirname $(readlink -f "$0"))
cd "$FULLPATH/../view/en/"
ADDONMODE=
ADDONNAME=
if [ "$1" == "--addon" -o "$1" == "-a" ]
then
ADDONMODE=1
if [ -z $2 ]; then echo -e "ERROR: missing addon name\n\nrun_xgettext.sh -a <addonname>"; exit 1; fi
ADDONNAME=$2
if [ ! -d "$FULLPATH/../addon/$ADDONNAME" ]; then echo "ERROR: addon '$ADDONNAME' not found"; exit 2; fi
fi
if [ $ADDONMODE ]
then
cd "$FULLPATH/../addon/$ADDONNAME"
mkdir -p "$FULLPATH/../addon/$ADDONNAME/lang/C"
OUTFILE="$FULLPATH/../addon/$ADDONNAME/lang/C/messages.po"
FINDSTARTDIR="."
FINDOPTS=
else
cd "$FULLPATH/../view/en/"
OUTFILE="$FULLPATH/messages.po"
FINDSTARTDIR="../../"
# skip addon folder
FINDOPTS="-wholename */addon -prune -o"
fi
F9KVERSION=$(sed -n "s/.*'FRIENDICA_VERSION'.*'\([0-9.]*\)'.*/\1/p" ../../boot.php);
echo "Friendica version $F9KVERSION"
OPTS=
OUTFILE="$FULLPATH/messages.po"
if [ "" != "$1" ]
then
OUTFILE="$(readlink -f ${FULLPATH}/$1)"
if [ -e "$OUTFILE" ]
then
echo "join extracted strings"
OPTS="-j"
fi
fi
#if [ "" != "$1" ]
#then
# OUTFILE="$(readlink -f ${FULLPATH}/$1)"
# if [ -e "$OUTFILE" ]
# then
# echo "join extracted strings"
# OPTS="-j"
# fi
#fi
KEYWORDS="-k -kt -ktt:1,2"
echo "extract strings to $OUTFILE.."
find ../../ -name "*.php" | xargs xgettext $KEYWORDS $OPTS -o "$OUTFILE" --from-code=UTF-8
for f in $(find "$FINDSTARTDIR" $FINDOPTS -name "*.php" -type f)
do
if [ ! -d "$f" ]
then
xgettext $KEYWORDS $OPTS -o "$OUTFILE" --from-code=UTF-8 "$f"
fi
done
echo "setup base info.."
sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE"
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011 the Friendica Project/g" "$OUTFILE"
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
sed -i "s/PACKAGE/Friendica/g" "$OUTFILE"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
if [ $ADDONMODE ]
then
sed -i "s/SOME DESCRIPTIVE TITLE./ADDON $ADDONNAME/g" "$OUTFILE"
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER//g" "$OUTFILE"
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.//g" "$OUTFILE"
sed -i "s/PACKAGE VERSION//g" "$OUTFILE"
sed -i "s/PACKAGE/Friendica $ADDONNAME addon/g" "$OUTFILE"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
else
sed -i "s/SOME DESCRIPTIVE TITLE./FRIENDICA Distributed Social Network/g" "$OUTFILE"
sed -i "s/YEAR THE PACKAGE'S COPYRIGHT HOLDER/2010, 2011, 2012, 2013 the Friendica Project/g" "$OUTFILE"
sed -i "s/FIRST AUTHOR <EMAIL@ADDRESS>, YEAR./Mike Macgirvin, 2010/g" "$OUTFILE"
sed -i "s/PACKAGE VERSION/$F9KVERSION/g" "$OUTFILE"
sed -i "s/PACKAGE/Friendica/g" "$OUTFILE"
sed -i "s/CHARSET/UTF-8/g" "$OUTFILE"
sed -i "s/^\"Plural-Forms/#\"Plural-Forms/g" "$OUTFILE"
fi
echo "done."

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_ca")) {
function string_plural_select_ca($n){
return ($n != 1);;
}
}}
;
$a->strings["Post successful."] = "Publicat amb éxit.";
$a->strings["[Embedded content - reload page to view]"] = "[Contingut embegut - recarrega la pàgina per a veure-ho]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
return ($n==1) ? 0 : ($n>=2 && $n<=4) ? 1 : 2;;
}
}}
;
$a->strings["Post successful."] = "Příspěvek úspěšně odeslán";
$a->strings["[Embedded content - reload page to view]"] = "[Vložený obsah - obnovení stránky pro zobrazení]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_de")) {
function string_plural_select_de($n){
return ($n != 1);;
}
}}
;
$a->strings["Altpager settings updated."] = "Altpager Einstellungen sind aktualisiert.";
$a->strings["Alternate Pagination Setting"] = "Alternative Seitenumbruch Einstellung";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_eo")) {
function string_plural_select_eo($n){
return ($n != 1);;
}
}}
;
$a->strings["Post successful."] = "Sukcese afiŝita.";
$a->strings["[Embedded content - reload page to view]"] = "[Enigita enhavo - reŝargu paĝon por spekti ĝin]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_es")) {
function string_plural_select_es($n){
return ($n != 1);;
}
}}
;
$a->strings["Post successful."] = "¡Publicado!";
$a->strings["[Embedded content - reload page to view]"] = "[Contenido incrustado - recarga la página para verlo]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_fr")) {
function string_plural_select_fr($n){
return ($n > 1);;
}
}}
;
$a->strings["Post successful."] = "Publication réussie.";
$a->strings["[Embedded content - reload page to view]"] = "[contenu incorporé - rechargez la page pour le voir]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_is")) {
function string_plural_select_is($n){
return ($n != 1);;
}
}}
;
$a->strings["Post successful."] = "Melding tókst.";
$a->strings["[Embedded content - reload page to view]"] = "[Innfelt efni - endurhlaða síðu til að sjá]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
return ($n != 1);;
}
}}
;
$a->strings["Altpager settings updated."] = "Impostazioni Altpager aggiornate.";
$a->strings["Alternate Pagination Setting"] = "Impostazioni Paginatore Alternativo";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_nb_no")) {
function string_plural_select_nb_no($n){
return ($n != 1);;
}
}}
;
$a->strings["Post successful."] = "Innlegg vellykket.";
$a->strings["[Embedded content - reload page to view]"] = "[Innebygget innhold - hent siden på nytt for å se det]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_pl")) {
function string_plural_select_pl($n){
return ($n==1 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2);;
}
}}
;
$a->strings["Post successful."] = "Post dodany pomyślnie";
$a->strings["[Embedded content - reload page to view]"] = "";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_pt_br")) {
function string_plural_select_pt_br($n){
return ($n > 1);;
}
}}
;
$a->strings["Post successful."] = "Publicado com sucesso.";
$a->strings["[Embedded content - reload page to view]"] = "[Conteúdo incorporado - recarregue a página para ver]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_ru")) {
function string_plural_select_ru($n){
return ($n%10==1 && $n%100!=11 ? 0 : $n%10>=2 && $n%10<=4 && ($n%100<10 || $n%100>=20) ? 1 : 2);;
}
}}
;
$a->strings["Post successful."] = "Успешно добавлено.";
$a->strings["[Embedded content - reload page to view]"] = "[Встроенное содержание - перезагрузите страницу для просмотра]";

Wyświetl plik

@ -1,8 +1,9 @@
<?php
if(! function_exists("string_plural_select_zh_cn")) {
function string_plural_select_zh_cn($n){
return 0;;
}
}}
;
$a->strings["Post successful."] = "评论发表了。";
$a->strings["[Embedded content - reload page to view]"] = "[嵌入内容-重新加载页为看]";
@ -1505,7 +1506,7 @@ $a->strings["Alternate Pagination Setting"] = "供替换的分页设置";
$a->strings["Use links to \"newer\" and \"older\" pages in place of page numbers?"] = "用到「更新」和「更旧」页代替页数?";
$a->strings["Force global use of the alternate pager"] = "让大家用供替换的分页";
$a->strings["Each user chooses whether to use the alternate pager"] = "每用户选择是否用供替换的分页";
$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = "MathJax插件表示用LaTeX句法的数学公式围绕\$\$或者eqnarray快在您墙网络分页和私人收件箱的文章。";
$a->strings["The MathJax addon renders mathematical formulae written using the LaTeX syntax surrounded by the usual $$ or an eqnarray block in the postings of your wall,network tab and private mail."] = "MathJax插件表示用LaTeX句法的数学公式围绕$$或者eqnarray快在您墙网络分页和私人收件箱的文章。";
$a->strings["Use the MathJax renderer"] = "用MathJax表示器";
$a->strings["MathJax Base URL"] = "MathJax基础URL";
$a->strings["The URL for the javascript file that should be included to use MathJax. Can be either the MathJax CDN or another installation of MathJax."] = "URL JavaScript文件应该包括为用MathJax。可以MathJax CDN或者别的MathJax安装。";