1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Added flags

This commit is contained in:
Laurent Cozic 2018-02-01 20:21:54 +00:00
parent f66be08d1d
commit 70adbe5e76
4 changed files with 39 additions and 24 deletions

View File

@ -160,20 +160,20 @@ This translation will apply to the three applications - desktop, mobile and term
Current translations: Current translations:
<!-- LOCALE-TABLE-AUTO-GENERATED --> <!-- LOCALE-TABLE-AUTO-GENERATED -->
Language | Code | Last translator | Percent done &nbsp; | Language | Code | Last translator | Percent done
---|---|---|--- ---|---|---|---|---
Croatian | hr_HR | Hrvoje Mandić <trbuhom@net.hr> | 72% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/hr.png) | Croatian | hr_HR | Hrvoje Mandić <trbuhom@net.hr> | 72%
Deutsch | de_DE | Tobias Strobel <git@strobeltobias.de> | 92% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png) | Deutsch | de_DE | Tobias Strobel <git@strobeltobias.de> | 92%
English | en_GB | | 100% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/gb.png) | English | en_GB | | 100%
Español | es_ES | Lucas Vieites | 80% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/es.png) | Español | es_ES | Lucas Vieites | 80%
Español (Costa Rica) | es_CR | | 68% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cr.png) | Español (Costa Rica) | es_CR | | 68%
Français | fr_FR | Laurent Cozic | 100% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/fr.png) | Français | fr_FR | Laurent Cozic | 100%
Italiano | it_IT | | 76% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/it.png) | Italiano | it_IT | | 76%
Nederlands | nl_BE | | 90% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/be.png) | Nederlands | nl_BE | | 90%
Português (Brasil) | pt_BR | | 74% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/br.png) | Português (Brasil) | pt_BR | | 74%
Русский | ru_RU | Artyom Karlov <artyom.karlov@gmail.com> | 96% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/ru.png) | Русский | ru_RU | Artyom Karlov <artyom.karlov@gmail.com> | 96%
中文 (简体) | zh_CN | RCJacH <RCJacH@outlook.com> | 76% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png) | 中文 (简体) | zh_CN | RCJacH <RCJacH@outlook.com> | 76%
日本語 | ja_JP | | 74% ![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/jp.png) | 日本語 | ja_JP | | 74%
<!-- LOCALE-TABLE-AUTO-GENERATED --> <!-- LOCALE-TABLE-AUTO-GENERATED -->
# Contributing # Contributing

View File

@ -297,4 +297,4 @@ function _(s, ...args) {
return sprintf(result, ...args); return sprintf(result, ...args);
} }
module.exports = { _, supportedLocales, countryDisplayName, localeStrings, setLocale, supportedLocalesToLanguages, defaultLocale, closestSupportedLocale, languageCode }; module.exports = { _, supportedLocales, countryDisplayName, localeStrings, setLocale, supportedLocalesToLanguages, defaultLocale, closestSupportedLocale, languageCode, countryCodeOnly };

View File

@ -18,7 +18,7 @@ const rnDir = rootDir + '/ReactNativeClient';
const electronDir = rootDir + '/ElectronClient/app'; const electronDir = rootDir + '/ElectronClient/app';
const { execCommand } = require('./tool-utils.js'); const { execCommand } = require('./tool-utils.js');
const { countryDisplayName } = require('lib/locale.js'); const { countryDisplayName, countryCodeOnly } = require('lib/locale.js');
function parsePoFile(filePath) { function parsePoFile(filePath) {
const content = fs.readFileSync(filePath); const content = fs.readFileSync(filePath);
@ -140,11 +140,12 @@ async function translationStatus(isDefault, poFile) {
function translationStatusToMdTable(status) { function translationStatusToMdTable(status) {
let output = []; let output = [];
output.push(['Language', 'Code', 'Last translator', 'Percent done'].join(' | ')); output.push(['&nbsp;', 'Language', 'Code', 'Last translator', 'Percent done'].join(' | '));
output.push(['---', '---', '---', '---'].join('|')); output.push(['---', '---', '---', '---', '---'].join('|'));
for (let i = 0; i < status.length; i++) { for (let i = 0; i < status.length; i++) {
const stat = status[i]; const stat = status[i];
output.push([stat.languageName, stat.locale, stat.translatorName, stat.percentDone + '%'].join(' | ')); const flagUrl = 'https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/' + countryCodeOnly(stat.locale).toLowerCase() + '.png';
output.push(['![](' + flagUrl + ')', stat.languageName, stat.locale, stat.translatorName, stat.percentDone + '%'].join(' | '));
} }
return output.join('\n'); return output.join('\n');
} }
@ -156,7 +157,8 @@ async function updateReadmeWithStats(stats) {
mdTable = mdTableMarkerOpen + mdTable + mdTableMarkerClose; mdTable = mdTableMarkerOpen + mdTable + mdTableMarkerClose;
let content = await fs.readFile(rootDir + '/README.md', 'utf-8'); let content = await fs.readFile(rootDir + '/README.md', 'utf-8');
const regex = new RegExp(mdTableMarkerOpen + '.*?' + mdTableMarkerClose); // [^]* matches any character including new lines
const regex = new RegExp(mdTableMarkerOpen + '[^]*?' + mdTableMarkerClose);
content = content.replace(regex, mdTable); content = content.replace(regex, mdTable);
await fs.writeFile(rootDir + '/README.md', content); await fs.writeFile(rootDir + '/README.md', content);
} }

View File

@ -343,6 +343,7 @@ sudo ln -s ~/.joplin-bin/bin/joplin /usr/bin/joplin
<table> <table>
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th>
<th>Language</th> <th>Language</th>
<th>Code</th> <th>Code</th>
<th>Last translator</th> <th>Last translator</th>
@ -351,72 +352,84 @@ sudo ln -s ~/.joplin-bin/bin/joplin /usr/bin/joplin
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/hr.png" alt=""></td>
<td>Croatian</td> <td>Croatian</td>
<td>hr_HR</td> <td>hr_HR</td>
<td>Hrvoje Mandić <a href="&#109;&#97;&#105;&#108;&#116;&#x6f;&#58;&#116;&#114;&#98;&#117;&#x68;&#x6f;&#109;&#x40;&#x6e;&#101;&#x74;&#46;&#104;&#x72;">&#116;&#114;&#98;&#117;&#x68;&#x6f;&#109;&#x40;&#x6e;&#101;&#x74;&#46;&#104;&#x72;</a></td> <td>Hrvoje Mandić <a href="&#x6d;&#x61;&#x69;&#108;&#116;&#111;&#x3a;&#x74;&#114;&#98;&#x75;&#x68;&#111;&#109;&#64;&#110;&#x65;&#116;&#x2e;&#104;&#x72;">&#x74;&#114;&#98;&#x75;&#x68;&#111;&#109;&#64;&#110;&#x65;&#116;&#x2e;&#104;&#x72;</a></td>
<td>72%</td> <td>72%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png" alt=""></td>
<td>Deutsch</td> <td>Deutsch</td>
<td>de_DE</td> <td>de_DE</td>
<td>Tobias Strobel <a href="&#109;&#97;&#105;&#x6c;&#116;&#111;&#x3a;&#x67;&#x69;&#116;&#x40;&#x73;&#116;&#114;&#x6f;&#x62;&#101;&#x6c;&#116;&#111;&#98;&#x69;&#97;&#x73;&#x2e;&#100;&#x65;">&#x67;&#x69;&#116;&#x40;&#x73;&#116;&#114;&#x6f;&#x62;&#101;&#x6c;&#116;&#111;&#98;&#x69;&#97;&#x73;&#x2e;&#100;&#x65;</a></td> <td>Tobias Strobel <a href="&#109;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#x67;&#x69;&#116;&#64;&#115;&#x74;&#x72;&#111;&#98;&#101;&#108;&#x74;&#x6f;&#98;&#105;&#97;&#115;&#46;&#x64;&#101;">&#x67;&#x69;&#116;&#64;&#115;&#x74;&#x72;&#111;&#98;&#101;&#108;&#x74;&#x6f;&#98;&#105;&#97;&#115;&#46;&#x64;&#101;</a></td>
<td>92%</td> <td>92%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/gb.png" alt=""></td>
<td>English</td> <td>English</td>
<td>en_GB</td> <td>en_GB</td>
<td></td> <td></td>
<td>100%</td> <td>100%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/es.png" alt=""></td>
<td>Español</td> <td>Español</td>
<td>es_ES</td> <td>es_ES</td>
<td>Lucas Vieites</td> <td>Lucas Vieites</td>
<td>80%</td> <td>80%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cr.png" alt=""></td>
<td>Español (Costa Rica)</td> <td>Español (Costa Rica)</td>
<td>es_CR</td> <td>es_CR</td>
<td></td> <td></td>
<td>68%</td> <td>68%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/fr.png" alt=""></td>
<td>Français</td> <td>Français</td>
<td>fr_FR</td> <td>fr_FR</td>
<td>Laurent Cozic</td> <td>Laurent Cozic</td>
<td>100%</td> <td>100%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/it.png" alt=""></td>
<td>Italiano</td> <td>Italiano</td>
<td>it_IT</td> <td>it_IT</td>
<td></td> <td></td>
<td>76%</td> <td>76%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/be.png" alt=""></td>
<td>Nederlands</td> <td>Nederlands</td>
<td>nl_BE</td> <td>nl_BE</td>
<td></td> <td></td>
<td>90%</td> <td>90%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/br.png" alt=""></td>
<td>Português (Brasil)</td> <td>Português (Brasil)</td>
<td>pt_BR</td> <td>pt_BR</td>
<td></td> <td></td>
<td>74%</td> <td>74%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/ru.png" alt=""></td>
<td>Русский</td> <td>Русский</td>
<td>ru_RU</td> <td>ru_RU</td>
<td>Artyom Karlov <a href="&#109;&#x61;&#x69;&#108;&#x74;&#x6f;&#58;&#x61;&#x72;&#116;&#121;&#x6f;&#x6d;&#x2e;&#107;&#x61;&#x72;&#108;&#x6f;&#118;&#64;&#103;&#109;&#97;&#105;&#108;&#x2e;&#x63;&#111;&#109;">&#x61;&#x72;&#116;&#121;&#x6f;&#x6d;&#x2e;&#107;&#x61;&#x72;&#108;&#x6f;&#118;&#64;&#103;&#109;&#97;&#105;&#108;&#x2e;&#x63;&#111;&#109;</a></td> <td>Artyom Karlov <a href="&#x6d;&#x61;&#x69;&#108;&#x74;&#x6f;&#x3a;&#97;&#x72;&#116;&#121;&#111;&#109;&#x2e;&#107;&#97;&#114;&#x6c;&#111;&#118;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#109;">&#97;&#x72;&#116;&#121;&#111;&#109;&#x2e;&#107;&#97;&#114;&#x6c;&#111;&#118;&#x40;&#x67;&#109;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#109;</a></td>
<td>96%</td> <td>96%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png" alt=""></td>
<td>中文 (简体)</td> <td>中文 (简体)</td>
<td>zh_CN</td> <td>zh_CN</td>
<td>RCJacH <a href="&#x6d;&#x61;&#x69;&#108;&#x74;&#111;&#58;&#82;&#67;&#74;&#x61;&#99;&#72;&#64;&#x6f;&#117;&#x74;&#108;&#111;&#111;&#107;&#46;&#x63;&#111;&#109;">&#82;&#67;&#74;&#x61;&#99;&#72;&#64;&#x6f;&#117;&#x74;&#108;&#111;&#111;&#107;&#46;&#x63;&#111;&#109;</a></td> <td>RCJacH <a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x52;&#x43;&#74;&#97;&#99;&#72;&#x40;&#111;&#117;&#x74;&#x6c;&#111;&#111;&#x6b;&#x2e;&#99;&#x6f;&#x6d;">&#x52;&#x43;&#74;&#97;&#99;&#72;&#x40;&#111;&#117;&#x74;&#x6c;&#111;&#111;&#x6b;&#x2e;&#99;&#x6f;&#x6d;</a></td>
<td>76%</td> <td>76%</td>
</tr> </tr>
<tr> <tr>
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/jp.png" alt=""></td>
<td>日本語</td> <td>日本語</td>
<td>ja_JP</td> <td>ja_JP</td>
<td></td> <td></td>