mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
Fixed translator names
This commit is contained in:
parent
b26094eba8
commit
c94cc93971
@ -200,7 +200,7 @@ Current translations:
|
||||
<!-- LOCALE-TABLE-AUTO-GENERATED -->
|
||||
| Language | Code | Last translator | Percent done
|
||||
---|---|---|---|---
|
||||
![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/es/basque_country.png) | Basque | eu | | 89%
|
||||
![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/es/basque_country.png) | Basque | eu | juan.abasolo@ehu.eus | 89%
|
||||
![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/hr.png) | Croatian | hr_HR | Hrvoje Mandić <trbuhom@net.hr> | 72%
|
||||
![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/de.png) | Deutsch | de_DE | Tobias Strobel <git@strobeltobias.de> | 91%
|
||||
![](https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/gb.png) | English | en_GB | | 100%
|
||||
|
@ -108,6 +108,23 @@ function availableLocales(defaultLocale) {
|
||||
return output;
|
||||
}
|
||||
|
||||
function extractTranslator(regex, poContent) {
|
||||
const translatorMatch = poContent.match(regex);
|
||||
let translatorName = '';
|
||||
|
||||
if (translatorMatch && translatorMatch.length >= 1) {
|
||||
translatorName = translatorMatch[1];
|
||||
translatorName = translatorName.replace(/["\s]+$/, '');
|
||||
translatorName = translatorName.replace(/\\n$/, '');
|
||||
translatorName = translatorName.replace(/^\s*/, '');
|
||||
}
|
||||
|
||||
if (translatorName.indexOf('FULL NAME') >= 0) return '';
|
||||
if (translatorName.indexOf('LL@li.org') >= 0) return '';
|
||||
|
||||
return translatorName;
|
||||
}
|
||||
|
||||
async function translationStatus(isDefault, poFile) {
|
||||
// "apt install translate-toolkit" to have pocount
|
||||
const command = 'pocount "' + poFile + '"';
|
||||
@ -120,17 +137,26 @@ async function translationStatus(isDefault, poFile) {
|
||||
|
||||
let translatorName = '';
|
||||
const content = await fs.readFile(poFile, 'utf-8');
|
||||
// "Last-Translator: Hrvoje Mandić <trbuhom@net.hr>\n"
|
||||
const translatorMatch = content.match(/Last-Translator:\s*?(.*)/);
|
||||
|
||||
if (translatorMatch.length >= 1) {
|
||||
translatorName = translatorMatch[1];
|
||||
translatorName = translatorName.replace(/["\s]+$/, '');
|
||||
translatorName = translatorName.replace(/\\n$/, '');
|
||||
translatorName = translatorName.replace(/^\s*/, '');
|
||||
translatorName = extractTranslator(/Last-Translator:\s*?(.*)/, content);
|
||||
if (!translatorName) {
|
||||
translatorName = extractTranslator(/Language-Team:\s*?(.*)/, content);
|
||||
}
|
||||
|
||||
if (translatorName.indexOf('FULL NAME') >= 0) translatorName = '';
|
||||
// "Last-Translator: Hrvoje Mandić <trbuhom@net.hr>\n"
|
||||
// let translatorMatch = content.match(/Last-Translator:\s*?(.*)/);
|
||||
// if (translatorMatch.length < 1) {
|
||||
// translatorMatch = content.match(/Last-Team:\s*?(.*)/);
|
||||
// }
|
||||
|
||||
// if (translatorMatch.length >= 1) {
|
||||
// translatorName = translatorMatch[1];
|
||||
// translatorName = translatorName.replace(/["\s]+$/, '');
|
||||
// translatorName = translatorName.replace(/\\n$/, '');
|
||||
// translatorName = translatorName.replace(/^\s*/, '');
|
||||
// }
|
||||
|
||||
// if (translatorName.indexOf('FULL NAME') >= 0) translatorName = '';
|
||||
|
||||
return {
|
||||
percentDone: isDefault ? 100 : percentDone,
|
||||
|
@ -378,21 +378,21 @@ $$
|
||||
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/es/basque_country.png" alt=""></td>
|
||||
<td>Basque</td>
|
||||
<td>eu</td>
|
||||
<td></td>
|
||||
<td>juan.abasolo@ehu.eus</td>
|
||||
<td>89%</td>
|
||||
</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>hr_HR</td>
|
||||
<td>Hrvoje Mandić <a href="mailto:trbuhom@net.hr">trbuhom@net.hr</a></td>
|
||||
<td>Hrvoje Mandić <a href="mailto:trbuhom@net.hr">trbuhom@net.hr</a></td>
|
||||
<td>72%</td>
|
||||
</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>de_DE</td>
|
||||
<td>Tobias Strobel <a href="mailto:git@strobeltobias.de">git@strobeltobias.de</a></td>
|
||||
<td>Tobias Strobel <a href="mailto:git@strobeltobias.de">git@strobeltobias.de</a></td>
|
||||
<td>91%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -448,14 +448,14 @@ $$
|
||||
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/ru.png" alt=""></td>
|
||||
<td>Русский</td>
|
||||
<td>ru_RU</td>
|
||||
<td>Artyom Karlov <a href="mailto:artyom.karlov@gmail.com">artyom.karlov@gmail.com</a></td>
|
||||
<td>Artyom Karlov <a href="mailto:artyom.karlov@gmail.com">artyom.karlov@gmail.com</a></td>
|
||||
<td>94%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://raw.githubusercontent.com/stevenrskelton/flag-icon/master/png/16/country-4x3/cn.png" alt=""></td>
|
||||
<td>中文 (简体)</td>
|
||||
<td>zh_CN</td>
|
||||
<td>RCJacH <a href="mailto:RCJacH@outlook.com">RCJacH@outlook.com</a></td>
|
||||
<td>RCJacH <a href="mailto:RCJacH@outlook.com">RCJacH@outlook.com</a></td>
|
||||
<td>75%</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
Loading…
Reference in New Issue
Block a user