41,035 changes: 41,035 additions & 0 deletions i18n/qgis_da.ts

Large diffs are not rendered by default.

Binary file added images/flags/en_US.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/images.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@
<file>flags/xh.png</file>
<file>flags/zh_CN.png</file>
<file>flags/zh_TW.png</file>
<file>flags/en_US.png</file>
</qresource>
<qresource prefix="/images/tips">
<file alias="symbol_levels.png">qgis_tips/symbol_levels.png</file>
Expand Down
92 changes: 87 additions & 5 deletions scripts/tsstat.pl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,61 @@

my @lang;

print "|Language|Count|Translated|Translation finished|Translation unfinished|Untranslated|Percentage|\n";
# script to generate a html list of the qgis application translatons
# showing the percentage finished and the names of the translators

# without argument it generates html which is used in the about-dialog of the application
# output to std-out, to be piped to doc/TRANSLATORS so it can be used in dialog
# scripts/tsstat.pl > doc/TRANSLATORS
# this version needs flag images from the resources

# with argument 'site' a more complete html page is create to be used on a website
# scripts/tsstat.pl site > page.html
# this version needs flag images in a directory 'flags'

# translator names here as a hash where the key is the lang_country code used for the ts file name
my $translators= {
af => 'Hendrik Bosman',
ar => 'Assem Kamal, Latif Jalil',
bg => 'Захари Савов, Jordan Tzvetkov',
ca_ES => 'Xavi',
cs_CZ => 'Martin Landa, Peter Antolik, Martin Dzurov, Jan Helebrant',
da => 'Henriette Roued',
de => 'Jürgen E. Fischer, Stephan Holl, Otto Dassau, Werner Macho',
es => 'Carlos Dávila, Javier César Aldariz, Gabriela Awad, Edwin Amado, Mayeul Kauffmann',
el_GR => 'Evripidis Argyropoulos, Mike Pegnigiannis, Nikos Ves',
et => 'Veiko Viil',
fa => 'Mola Pahnadayan',
fi => 'Marko Jarvenpaa',
fr => 'Eve Rousseau, Marc Monnerat, Lionel Roubeyrie, Jean Roc Morreale, Benjamin Bohard, Jeremy Garniaux, Yves Jacolin, Benjamin Lerre, Stéphane Morel, Marie Silvestre, Tahir Tamba, Xavier M, Mayeul Kauffmann, Mehdi Semchaoui',
hu => 'Zoltan Siki',
hr_HR => 'Zoran Jankovic',
is => 'Thordur Ivarsson',
id => 'Januar V. Simarmata, I Made Anombawa',
it => 'Paolo Cavallini, Flavio Rigolon, Maurizio Napolitano, Roberto Angeletti, Alessandro Fanna, Michele Beneventi, Marco Braida, Luca Casagrande, Luca Delucchi, Anne Gishla',
ja => 'BABA Yoshihiko, Yoichi Kayama',
ka_GE => 'Shota Murtskhvaladze, George Machitidze',
lo => 'Anousak Souphavanh',
lv => 'Maris Nartiss, Pēteris Brūns',
lt => 'Kestas M',
nl => 'Richard Duivenvoorde, Raymond Nijssen, Carlo van Rijswijk',
mn => 'Bayarmaa Enkhtur',
pl_PL => 'Robert Szczepanek, Milena Nowotarska, Borys Jurgiel, Mateusz Loskot, Tomasz Paul, Andrzej Swiader ',
pt_BR => 'Arthur Nanni, Christian Ferreira, Leandro Kaut',
pt_PT => 'Giovanni Manghi, Joana Simoes, Duarte Carreira, Alexandre Neto, Pedro Pereira',
ro => 'Lonut Losifescu-Enescu',
ru => 'Artem Popov',
sk => 'Lubos Balazovic',
sl_SI => 'Jože Detečnik, Dejan Gregor',
sv => 'Lars Luthman, Magnus Homann',
sq_AL => '',
th => 'Man Chao',
tr => 'Osman Yilmaz',
uk => 'Сергей Якунин',
vi => 'Bùi Hữu Mạnh',
zh_CN => 'Zhang Jun',
zh_TW => 'Nungyao Lin',
};

for my $i (<i18n/qgis_*.ts>) {
my ($langcode) = $i =~ /i18n\/qgis_(.*).ts/;
Expand Down Expand Up @@ -39,10 +93,38 @@

my $n = $translations+$untranslated;

push @lang, { name=>$name, n=>$n, translations=>$translations, finished=>$finished, unfinished=>$unfinished, untranslated=>$untranslated, percentage=>($n-$untranslated)/$n*100 };
push @lang, { code=>$langcode, name=>$name, n=>$n, translations=>$translations, finished=>$finished, unfinished=>$unfinished, untranslated=>$untranslated, percentage=>($n-$untranslated)/$n*100 };
}


for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
print "|", $l->{name}, "|", join("|", $l->{n}, $l->{translations}, $l->{finished}, $l->{unfinished}, $l->{untranslated}, sprintf("%.1f", $l->{percentage}) ), "|\n";
if ($ARGV[0] eq "site"){
print "<html><body>";
print "<head>";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>";
print "<style>";
print "body{font-family:sans-serif;}";
print "table {font-size:80%;border-collapse: collapse;}";
print "td {border-left:solid 1px #aaaaaa;border-right:solid 1px #aaaaaa;padding:1px 10px;}";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style></head>";
print "<table>";
print "<tr><td colspan=\"2\" style=\"width:250px;\">Language</td><td>Count</td><td>Finished</td><td>Unfinished</td><td>Untranslated</td><td>Percentage</td><td>Translators</td></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
print "\n<tr><td><img src=\"flags/", $l->{code}, ".png\">", "</td><td>", $l->{name}, "</td><td>", join("</td><td>", $l->{n}, $l->{finished}, $l->{unfinished}, $l->{untranslated}, sprintf("<div class=\"bartodo\"><div class=\"bardone\" style=\"width:%.1fpx\">%.1f</div></div>", ($l->{percentage}, $l->{percentage})) ), "</td><td>", $translators->{$l->{code}} ,"</tr></tr>";
}
print "</table></body></html>";
}
else {
print "<style>";
print "table {font-size:80%;}";
print "th {text-align:left; }";
print ".bartodo{ background-color:red;width:100px;height:20px;}";
print ".bardone{ background-color:green;width:80px;height:20px;font-size:80%;text-align:center;padding-top:4px;height:16px;color:white;}";
print "</style>";
print "<table>";
print "<tr><th colspan=\"2\" style=\"width:250px;\">Language</th><th>Finished %</th><th>Translators</th></tr>\n";
for my $l (sort { $b->{percentage} <=> $a->{percentage} } @lang) {
print "\n<tr><td><img src=\"qrc:/images/flags/", $l->{code}, ".png\">", "</td><td>", $l->{name}, "</td><td>", join("</td><td>", sprintf("<div class=\"bartodo\"><div class=\"bardone\" style=\"width:%.1fpx\">%.1f</div></div>", ($l->{percentage}, $l->{percentage})) ), "</td><td>", $translators->{$l->{code}} ,"</tr></tr>";
}
print "</table>";
}
37 changes: 4 additions & 33 deletions src/app/qgsabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ void QgsAbout::init()
txtDonors->document()->setDefaultStyleSheet( myStyle );
txtDonors->setHtml( donorsHTML );
QgsDebugMsg( QString( "donorsHTML:%1" ).arg( donorsHTML.toAscii().constData() ) );
QgsDebugMsg( QString( "txtDonors:%1" ).arg( txtDonors->toHtml().toAscii().constData() ) );
}

// read the TRANSLATORS file and populate the text widget
Expand All @@ -175,46 +174,18 @@ void QgsAbout::init()
#endif
if ( translatorFile.open( QIODevice::ReadOnly ) )
{
QString translatorHTML = ""
+ tr( "<p>The following have contributed to QGIS"
" by translating the user interface or documentation</p>" )
+ "<hr>"
"<table width='100%'>"
"<tr><th>" + tr( "Language" ) + "</th>"
"<th>" + tr( "Names" ) + "</th></tr>";
QString website;
QString translatorHTML = "";
QTextStream translatorStream( &translatorFile );
// Always use UTF-8
translatorStream.setCodec( "UTF-8" );
QString sline;
QString myStyle = QgsApplication::reportStyleSheet();
translatorHTML += "<style>" + myStyle + "</style>";
while ( !translatorStream.atEnd() )
{
sline = translatorStream.readLine(); // line of text excluding '\n'
//ignore the line if it starts with a hash....
if ( sline.left( 1 ) == "#" )
continue;
QStringList myTokens = sline.split( "|", QString::SkipEmptyParts );
if ( myTokens.size() > 1 )
{
website = myTokens[1];
}
else
{
website = "&nbsp;";
}
translatorHTML += "<tr>";
translatorHTML += "<td>" + myTokens[0] + "</td><td>" + website + "</td>";
// close the row
translatorHTML += "</tr>";
translatorHTML += translatorStream.readLine();
}
translatorHTML += "</table>";

QString myStyle = QgsApplication::reportStyleSheet();
txtTranslators->clear();
txtTranslators->document()->setDefaultStyleSheet( myStyle );
txtTranslators->setHtml( translatorHTML );
QgsDebugMsg( QString( "translatorHTML:%1" ).arg( translatorHTML.toAscii().constData() ) );
QgsDebugMsg( QString( "txtTranslators:%1" ).arg( txtTranslators->toHtml().toAscii().constData() ) );
}
setWhatsNew();
}
Expand Down
9 changes: 8 additions & 1 deletion src/app/qgsoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,14 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
lblSystemLocale->setText( tr( "Detected active locale on your system: %1" ).arg( mySystemLocale ) );
QString myUserLocale = settings.value( "locale/userLocale", "" ).toString();
QStringList myI18nList = i18nList();
cboLocale->addItems( myI18nList );
foreach( QString l, myI18nList )
{
#if QT_VERSION >= 0x040800
cboLocale->addItem( QIcon( QString( ":/images/flags/%1.png" ).arg( l ) ), QLocale( l ).nativeLanguageName() );
#else
cboLocale->addItem( QIcon( QString( ":/images/flags/%1.png" ).arg( l ) ), l );
#endif
}
if ( myI18nList.contains( myUserLocale ) )
{
cboLocale->setCurrentIndex( myI18nList.indexOf( myUserLocale ) );
Expand Down
16 changes: 14 additions & 2 deletions src/ui/qgsabout.ui
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ p, li { white-space: pre-wrap; }
</attribute>
<layout class="QGridLayout">
<item row="0" column="0">
<widget class="QTextBrowser" name="txtTranslators"/>
<widget class="QWebView" name="txtTranslators">
<property name="url">
<url>
<string>about:blank</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
Expand All @@ -238,13 +244,19 @@ p, li { white-space: pre-wrap; }
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>tabWidget</tabstop>
<tabstop>btnQgisHome</tabstop>
<tabstop>btnQgisUser</tabstop>
<tabstop>txtProviders</tabstop>
<tabstop>lstDevelopers</tabstop>
<tabstop>txtTranslators</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>txtDonors</tabstop>
<tabstop>lstContributors</tabstop>
Expand Down
38 changes: 19 additions & 19 deletions src/ui/qgsoptionsbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>825</width>
<height>852</height>
<width>800</width>
<height>526</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -33,7 +33,7 @@
<item row="2" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>6</number>
<number>0</number>
</property>
<property name="iconSize">
<size>
Expand Down Expand Up @@ -66,8 +66,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>787</width>
<height>859</height>
<width>761</width>
<height>819</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
Expand Down Expand Up @@ -733,8 +733,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>761</width>
<height>471</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_8">
Expand Down Expand Up @@ -907,8 +907,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>761</width>
<height>466</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
Expand Down Expand Up @@ -1193,8 +1193,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>778</width>
<height>437</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
Expand Down Expand Up @@ -1274,8 +1274,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>761</width>
<height>573</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_13">
Expand Down Expand Up @@ -1650,8 +1650,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>778</width>
<height>437</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -1824,8 +1824,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>761</width>
<height>539</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_17">
Expand Down Expand Up @@ -1921,8 +1921,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>803</width>
<height>763</height>
<width>333</width>
<height>526</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_20">
Expand Down