Translations of this page?:

DokuWiki PHP translation checks

This page shows the result of checks on translation strings. The results are presented language by language. All languages are tested but only those with troubles are reported.

The test was run on 2012-03-05T07:06:49+01:00

Here is the test list :

  • percent test 1
    This test checks that there are as many % signs in translation as in original english. many small presentation problems may arise when the the number of % sign differs.
  • percent test 2
    for string that contain % signs, checks that %thing are present in both original and translation. This will detect typos for example where %s will be mis typed as s% in translation.

source code of the tests is available at the bottom of this page.

Explanation for translators:

DokuWiki sometimes uses a function called sprintf to insert certain words into a given language string to complete a sentence. Where a word (or number) has to be inserted is determined by a so called format string. Format strings start with a percent sign, optionally followed by numbers and dots and end with a single letter.

The most common format string is a simple %s for inserting a string. A %d indicates a decimal number and %.2f will insert a floating point number rounded to 2 digits after the decimal point.

When translating a string it is important to leave the format strings intact. They have to appear exactly as in the original. If a string contains several format strings, order does matter. Make sure the logical order of words or numbers to be inserted are the same as in the original.

ar

! ./inc/lang/en/lang.php
! ./inc/lang/ar/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=بريد ملخص عن تغييرات كل صفحة

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=قائمة بالصفحات المتغيرة منذ آخر بريد

ca-valencia

! ./lib/plugins/usermanager/lang/en/lang.php
! ./lib/plugins/usermanager/lang/ca-valencia/lang.php

+ $lang[update_exists]=User name change failed, the specified user name (%s) already exists (any other changes will be applied).
-   $tr[update_exists]=Erro canviant el nom de l'usuari, el nom d'usuari que ha donat ya existix (els demés canvis s'aplicaran).

el

! ./inc/lang/en/lang.php
! ./inc/lang/el/lang.php

+ $lang[uploadbadcontent]=The uploaded content did not match the %s file extension.
-   $tr[uploadbadcontent]=Το περιεχόμενο του αρχείου δεν ταιριάζει με την επέκτασή του.

+ $lang[media_edit]=Edit %s
-   $tr[media_edit]=Επεξεργασία

+ $lang[media_history]=History of %s
-   $tr[media_history]=Αυτές είναι οι παλαιότερες αναθεωρήσεις του αρχείου.

es

! ./inc/lang/en/lang.php
! ./inc/lang/es/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=recopilar correo de cambios por cada página

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=lista de páginas con cambios desde el último correo

fa

! ./inc/lang/en/lang.php
! ./inc/lang/fa/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=ارسال ایمیل‌های فشرده برای تغییرات هر صفحه

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=لیست صفحات تغییر داده شده از آخرین رای‌نامه

gl

! ./inc/lang/en/lang.php
! ./inc/lang/gl/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=correo-e con resumo de trocos para cada páxina

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=lista de páxinas mudadas dende o último correo-e

he

! ./inc/lang/en/lang.php
! ./inc/lang/he/lang.php

+ $lang[i_phpver]=Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.
-   $tr[i_phpver]=גרסת ה־PHP שלך <code>%s</code> נמוכה מהדרוש. עליך לשדרג את התקנת ה־PHP שלך.

hi

! ./lib/plugins/plugin/lang/en/lang.php
! ./lib/plugins/plugin/lang/hi/lang.php

+ $lang[deleted]=Plugin %s deleted.
-   $tr[deleted]=मिटाया हुआ

ia

! ./inc/lang/en/lang.php
! ./inc/lang/ia/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=un digesto de modificationes pro cata pagina

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=lista de paginas modificate depost le ultime e-mail

it

! ./inc/lang/en/lang.php
! ./inc/lang/it/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=email riassuntiva delle modifiche di ogni pagina

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=elenco delle pagine modificate dall'ultima email

km

! ./inc/lang/en/lang.php
! ./inc/lang/km/lang.php

+ $lang[i_phpver]=Your PHP version <code>%s</code> is lower than the needed <code>%s</code>. You need to upgrade your PHP install.
-   $tr[i_phpver]=PHP ប្រវត់លេខ<code>%s</code> ជា

la

! ./inc/lang/en/lang.php
! ./inc/lang/la/lang.php

+ $lang[uploadbadcontent]=The uploaded content did not match the %s file extension.
-   $tr[uploadbadcontent]=Documentum oneratum cum genere documenti non congruit.

+ $lang[recent_global]=You're currently watching the changes inside the <b>%s</b> namespace. You can also <a href="%s">view the recent changes of the whole wiki</a>.
-   $tr[recent_global]=Mutatione in hoc genere uides. Recentiores mutationes quoque uidere <a href="%s">potes</a>

mk

! ./inc/lang/en/lang.php
! ./inc/lang/mk/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=е-пошта со преглед од промените за секоја страница

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=листа на променети страници од последната е-пошта

nl

! ./lib/plugins/plugin/lang/en/lang.php
! ./lib/plugins/plugin/lang/nl/lang.php

- $lang[packageinstalled]=Plugin package (%d plugin(s): %s) successfully installed.
+   $tr[packageinstalled]=Plugin package (%d plugin%s: %s) succesvol geïnstalleerd.

no

! ./inc/lang/en/lang.php
! ./inc/lang/no/lang.php

+ $lang[media_edit]=Edit %s
-   $tr[media_edit]=Rediger

+ $lang[media_history]=History of %s
-   $tr[media_history]=Dette er de tidligere versjonene av filen.

pl

! ./inc/lang/en/lang.php
! ./inc/lang/pl/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=email ze streszczeniem zmian dla każdej ze stron

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=lista zmienionych stron od czasu ostatniego emaila

! ./lib/plugins/plugin/lang/en/lang.php
! ./lib/plugins/plugin/lang/pl/lang.php

= $lang[packageinstalled]=Plugin package (%d plugin(s): %s) successfully installed.
=   $tr[packageinstalled]=Pakiet wtyczek (%d wtyczki:% s) zainstalowany pomyślnie.
  -  %s

ru

! ./inc/lang/en/lang.php
! ./inc/lang/ru/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=сводка изменений по каждой странице

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=перечислять изменившиеся страницы с прошлого уведомления

sq

! ./inc/lang/en/lang.php
! ./inc/lang/sq/lang.php

+ $lang[subscr_style_digest]=digest email of changes for each page (every %.2f days)
-   $tr[subscr_style_digest]=pasqyro email-e ndryshimi pér çdo faqe

+ $lang[subscr_style_list]=list of changed pages since last email (every %.2f days)
-   $tr[subscr_style_list]=listë e faqeve të ndryshuara që nga emaili i fundit

zh

! ./inc/lang/en/lang.php
! ./inc/lang/zh/lang.php

- $lang[media_view]=%s
+   $tr[media_view]=%s 在 %s

+ $lang[media_viewold]=%s at %s
-   $tr[media_viewold]=%s 

! ./lib/plugins/plugin/lang/en/lang.php
! ./lib/plugins/plugin/lang/zh/lang.php

- $lang[packageinstalled]=Plugin package (%d plugin(s): %s) successfully installed.
+   $tr[packageinstalled]=插件  (%d plugin%s: %s) 已成功安装。

zh-tw

! ./lib/plugins/plugin/lang/en/lang.php
! ./lib/plugins/plugin/lang/zh-tw/lang.php

- $lang[packageinstalled]=Plugin package (%d plugin(s): %s) successfully installed.
+   $tr[packageinstalled]=插件 (%d 插件%s: %s) 已成功地安裝。

script code

This page was produced with the following php code

checklanguage.php
#! /usr/bin/php5
<?php
/*
 * checklanguage.php simple checks on english dokuwiki texts and their translations
 * Copyright (C) 2011 Schplurtz le Déboulonné <schplurtz laposte.net>
 *
 *     This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with this program.  If not, see http://www.gnu.org/licenses/.
 */
/*
 This script runs some automated tests on dokuwiki translation strings.
 
 It assumes that every time a % appears in english it is a format
 directive for printf or a friend of its. So it checks that there
 are the same number of '%' in english and translation and it checks
 that that the format are the same. order does not matter (don't know
 how LTR and RTL languages behave)
 
 /schplurtz
*/
# ADJUST TO THE BASE OF YOUR DW. no other thing need be changed...
$base_english=dirname(__FILE__);
$base_tr=$base_english;
 
$vu=array( 'lang' => array(), 'file' => array() );
 
# get all langs
exec( 'cd '.$base_english.'/inc/lang && ls', $langdirs );
# get all english PHP language files
exec( 'cd '.$base_english.' && find . -name "*.php" | grep lang/en/', $english_files );
pageheader();
foreach( $langdirs as $language ) {
    if( 'en' == $language )
        continue;
    foreach( $english_files as $en_fi ) {
        $fen = $base_english . '/' . $en_fi;
        $tr_fi = str_replace( 'lang/en/', 'lang/'.$language.'/', $en_fi );
        $ftr = $base_tr . '/' . $tr_fi;
        unset( $lang );
        if( !file_exists( $ftr ) )
            /* nothing to check if no translation exists */
            continue;
        include( $fen );
        include( $ftr );
        $tr=$lang;
        unset( $lang );
        include( $fen );
 
        chklang( $lang, $tr, $en_fi, $tr_fi );
        filefooter( $language, $en_fi, $tr_fi );
    }
}
pagefooter();
 
function chklang( &$en, &$tr, $prenfi, $prtrfi, $strkeys='' ) {
    global $language;
    foreach( $en as $k =>$v ) {
 
        if( is_array( $v ) ) {
            chklang( $v, $tr[$k], $prenfi, $prtrfi, $strkeys.'['.$k.']' );
            continue;
        }
        if( ($pen=substr_count( $v, '%' )) != ($ptr=substr_count( $tr[$k], '%' )) ) {
            fileheader($language, $prenfi, $prtrfi);
            echo
                "\n",
                ($pen - $ptr) < 0 ? '- ' : '+ ',
                '$lang',$strkeys,'[',$k,']=',$v,"\n",
                ($pen - $ptr) > 0 ? '- ' : '+ ',
                '  $tr',$strkeys,'[',$k,']=',$tr[$k],"\n";
            continue;
        }
        if( !$pen )
            continue;
        preg_match_all( '/%[-.0-9hl]*?[%dufsc]/', $v, $nen );
        preg_match_all( '/%[-.0-9hl]*?[%dufsc]/', $tr[$k], $ntr );
        foreach( $nen as $ken => $sen ) {
            if( !is_array( $ntr[$ken] )) {
                foreach( $sen as $unm )
                    echo '  -- ', $unm, "\n";
            }
            else {
                if( count( $sen ) != count( $ntr[$ken] ) ) {
                    fileheader($language, $prenfi, $prtrfi);
                    echo
                        "\n",
                        '= ',
                        '$lang',$strkeys,'[',$k,']=',$v,"\n",
                        '= ',
                        '  $tr',$strkeys,'[',$k,']=',$tr[$k],"\n";
                    foreach( array_diff( $sen, $ntr[$ken] ) as $noc ) {
                        echo '  -  ', $noc, "\n";
                    }
                    foreach( array_diff( $ntr[$ken], $sen ) as $noc ) {
                        echo '  +  ', $noc, "\n";
                    }
                }
            }
        }
    }
}
 
function pageheader() {
?>
====== DokuWiki PHP translation checks =====
 
This page shows the result of checks on translation strings. The results
are presented language by language. All languages are tested but only those with troubles are reported.
 
The test was run on <?php echo date( 'c' ),"\n"; ?>
 
Here is the test list :
 
  * percent test 1\\ This test checks that there are as many ''%'' signs in translation as in original english. many small presentation problems may arise when the the number of ''%'' sign differs.
  * percent test 2\\ for string that contain ''%'' signs, checks that %thing are present in both original and translation. This will detect typos for example where ''%s'' will be mis typed as ''s%'' in translation.
 
[[#script code|source code]] of the tests is available at the bottom of this page.
 
**Explanation for translators:**
 
DokuWiki sometimes uses a function called [[phpfn>sprintf]] to insert certain words into a given language string to complete a sentence. Where a word (or number) has to be inserted is determined by a so called format string. Format strings start with a percent sign, optionally followed by numbers and dots and end with a single letter.
 
The most common format string is a simple ''%s'' for inserting a string. A ''%d'' indicates a decimal number and ''%.2f'' will insert a floating point number rounded to 2 digits after the decimal point.
 
When translating a string it is important to **leave the format strings intact**. They have to appear exactly as in the original. If a string contains several format strings, **order does matter**. Make sure the logical order of words or numbers to be inserted are the same as in the original.
 
 
<?php
}
function pagefooter() {
?>
 
===== script code =====
 
This page was produced with the following php code
 
<?php
/*
 * must break </ code> in 2 pieces otherwise it is not possible to
 * self-include this file in doku page
 */
echo '<', 'code php checklanguage.php>', "\n";
readfile( __FILE__ );
echo '</', 'code>', "\n";
}
 
function langheader( $language ) {
    global $vu;
    if( !array_key_exists( $language, $vu['lang'] )) {
        $vu['lang'][$language]=1;
        echo '===== ', $language, ' =====', "\n";
    }
}
function langfooter() {
    return;
}
function fileheader( $language, $en_file, $tr_file ) {
    global $vu;
    langheader( $language );
    if( !array_key_exists( $tr_file, $vu['file'] )) {
        $vu['file'][$tr_file] = 1;
        echo
            "\n! ",$en_file,"\\\\\n",
            '! ',$tr_file,"\\\\\n",
            "<file>\n";
    }
}
function filefooter( $language, $en_file, $tr_file ) {
    global $vu;
    if( array_key_exists( $tr_file, $vu['file'] )) {
        echo '<', "/file>\n";
    }
}
translation-check.txt · Last modified: 2012/03/05 07:10 by 2.14.125.19
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate