From 2ebd5c9a7a5b716d1d61dd98397fd665bac0c8f2 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 28 Aug 2020 08:50:58 +0200 Subject: [PATCH 01/10] NSIS: Use consistent string delimiters for translation texts --- installer/languages/Dutch.nsh | 2 +- installer/languages/English.nsh | 2 +- installer/languages/French.nsh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/installer/languages/Dutch.nsh b/installer/languages/Dutch.nsh index 293d36c46..b8d0d55be 100644 --- a/installer/languages/Dutch.nsh +++ b/installer/languages/Dutch.nsh @@ -1,4 +1,4 @@ -LangString MsgAlreadyInstalled ${LANG_DUTCH} '${PRODUCT_NAME} is al geïnstalleerd. $\n$\nKlik op “OK” om de vorige versie te verwijderen of op “Annuleren” om de installatie te annuleren.' +LangString MsgAlreadyInstalled ${LANG_DUTCH} "${PRODUCT_NAME} is al geïnstalleerd. $\n$\nKlik op “OK” om de vorige versie te verwijderen of op “Annuleren” om de installatie te annuleren." LangString MsgApplicationRunning ${LANG_DUTCH} "De applicatie ${PRODUCT_NAME} is nog actief. Sluit haar af en probeer het opnieuw." LangString MsgRequires64Bit ${LANG_DUTCH} "Voor deze versie van ${PRODUCT_NAME} heb je een 64 bitssysteem nodig." LangString MuiDescriptionRequired ${LANG_DUTCH} "Installeert ${PRODUCT_NAME} en de bestanden die het nodig heeft om te draaien." diff --git a/installer/languages/English.nsh b/installer/languages/English.nsh index d2d9f5ea1..3ebede99a 100644 --- a/installer/languages/English.nsh +++ b/installer/languages/English.nsh @@ -1,4 +1,4 @@ -LangString MsgAlreadyInstalled ${LANG_ENGLISH} '${PRODUCT_NAME} is already installed. $\n$\nClick "OK" to uninstall the previous version or "Cancel" to cancel this upgrade.' +LangString MsgAlreadyInstalled ${LANG_ENGLISH} "${PRODUCT_NAME} is already installed. $\n$\nClick $\"OK$\" to uninstall the previous version or $\"Cancel$\" to cancel this upgrade." LangString MsgApplicationRunning ${LANG_ENGLISH} "The application ${PRODUCT_NAME} is running. Please close it and try again." LangString MsgRequires64Bit ${LANG_ENGLISH} "This version of ${PRODUCT_NAME} requires a 64-bit Windows system." LangString MuiDescriptionRequired ${LANG_ENGLISH} "Installs ${PRODUCT_NAME} along with the necessary files for it run." diff --git a/installer/languages/French.nsh b/installer/languages/French.nsh index 2d2dcbe97..50b2828f4 100644 --- a/installer/languages/French.nsh +++ b/installer/languages/French.nsh @@ -1,4 +1,4 @@ -LangString MsgAlreadyInstalled ${LANG_FRENCH} '${PRODUCT_NAME} est déjà installé. $\n$\nCliquez sur « OK » pour désinstaller la version précédente ou « Annuler » pour annuler cette mise à jour.' +LangString MsgAlreadyInstalled ${LANG_FRENCH} "${PRODUCT_NAME} est déjà installé. $\n$\nCliquez sur « OK » pour désinstaller la version précédente ou « Annuler » pour annuler cette mise à jour." LangString MsgApplicationRunning ${LANG_FRENCH} "L’application ${PRODUCT_NAME} est en cours d’exécution. Veuillez la stopper et essayer à nouveau." LangString MsgRequires64Bit ${LANG_FRENCH} "Cette version de ${PRODUCT_NAME} requiert un système Windows 64 bits." LangString MuiDescriptionRequired ${LANG_FRENCH} "Installe ${PRODUCT_NAME} ainsi que les fichiers nécessaires à son exécution." From e69275e85f06d717ade1369bcccdb2d17519bd20 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 28 Aug 2020 09:01:22 +0200 Subject: [PATCH 02/10] PICARD-1929: Convert NSIS translations to/from JSON for Transifex --- installer/languages/json2nsh.py | 57 +++++++++++++++ installer/languages/nsh2json.py | 60 ++++++++++++++++ installer/languages/nshutil.py | 107 ++++++++++++++++++++++++++++ installer/languages/sources/de.json | 16 +++++ installer/languages/sources/en.json | 16 +++++ installer/languages/sources/fr.json | 16 +++++ installer/languages/sources/it.json | 16 +++++ installer/languages/sources/nl.json | 16 +++++ 8 files changed, 304 insertions(+) create mode 100755 installer/languages/json2nsh.py create mode 100755 installer/languages/nsh2json.py create mode 100644 installer/languages/nshutil.py create mode 100644 installer/languages/sources/de.json create mode 100644 installer/languages/sources/en.json create mode 100644 installer/languages/sources/fr.json create mode 100644 installer/languages/sources/it.json create mode 100644 installer/languages/sources/nl.json diff --git a/installer/languages/json2nsh.py b/installer/languages/json2nsh.py new file mode 100755 index 000000000..568ab3a02 --- /dev/null +++ b/installer/languages/json2nsh.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Picard, the next-generation MusicBrainz tagger +# +# Copyright (C) 2020 Philipp Wolfer +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +import glob +import json +import os.path + +import nshutil as nsh + + +def language_from_filename(path): + lang = os.path.splitext(os.path.basename(path))[0] + return (nsh.code_to_language(lang), lang) + + +def write_langstring(f, language, identifier, text): + langstring = nsh.make_langstring(language, identifier, text) + f.write(langstring) + + +def main(): + scriptdir = os.path.dirname(os.path.abspath(__file__)) + sourcesdir = os.path.join(scriptdir, 'sources') + + for path in glob.glob(os.path.join(sourcesdir, '*.json')): + language, language_code = language_from_filename(path) + if not language: + print(f'Unknown language code "{language_code}", skipping') + continue + target_file = os.path.join(scriptdir, f'{language}.nsh') + with open(path, 'r', encoding='utf-8') as infile: + data = json.loads(infile.read()) + with open(target_file, 'w+', encoding='utf-8') as outfile: + for identifier, text in data.items(): + write_langstring(outfile, language, identifier, text) + + +if __name__ == "__main__": + main() diff --git a/installer/languages/nsh2json.py b/installer/languages/nsh2json.py new file mode 100755 index 000000000..4779ae467 --- /dev/null +++ b/installer/languages/nsh2json.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Picard, the next-generation MusicBrainz tagger +# +# Copyright (C) 2020 Philipp Wolfer +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +import glob +import json +import os.path + +import nshutil as nsh + + +def language_from_filename(path): + lang = os.path.splitext(os.path.basename(path))[0] + return (lang, nsh.language_to_code(lang)) + + +def extract_strings(f): + for line in f: + parsed = nsh.parse_langstring(line) + if parsed: + yield parsed + + +def main(): + scriptdir = os.path.dirname(os.path.abspath(__file__)) + + for path in glob.glob(os.path.join(scriptdir, '*.nsh')): + language, language_code = language_from_filename(path) + if not language_code: + print(f'Unknown language "{language}", skipping') + continue + target_file = os.path.join(scriptdir, 'sources', f'{language_code}.json') + with open(path, 'r', encoding='utf-8') as infile: + output = {} + for identifier, text in extract_strings(infile): + output[identifier] = text + + with open(target_file, 'w+', encoding='utf-8') as outfile: + outfile.write(json.dumps(output, indent=4)) + + +if __name__ == "__main__": + main() diff --git a/installer/languages/nshutil.py b/installer/languages/nshutil.py new file mode 100644 index 000000000..cd70a3fdd --- /dev/null +++ b/installer/languages/nshutil.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Picard, the next-generation MusicBrainz tagger +# +# Copyright (C) 2020 Philipp Wolfer +# +# 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 2 +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +import re + + +LANGUAGES = { + 'Arabic': 'ar', + 'Catalan': 'ca', + 'Czech': 'cs', + 'Danish': 'da', + 'Dutch': 'nl', + 'English': 'en', + 'Estonian': 'et', + 'Finnish': 'fi', + 'French': 'fr', + 'German': 'de', + 'Greek': 'el', + 'Hebrew': 'he', + 'Italian': 'it', + 'Japanese': 'ja', + 'Korean': 'ko', + 'Norwegian': 'nb', + 'Polish': 'pl', + 'Portuguese': 'pt', + 'PortugueseBR': 'pt_BR', + 'Russian': 'ru', + 'SimpChinese': 'zh-Hans', + 'Slovak': 'sk', + 'Slovenian': 'sl', + 'Spanish': 'es', + 'Swedish': 'sv', + 'TradChinese': 'zh-Hant', + 'Turkish': 'tr', + 'Ukrainian': 'uk', +} + +_R_LANGUAGES = dict([(code, name) for name, code in LANGUAGES.items()]) + +# See https://nsis.sourceforge.io/Docs/Chapter4.html#varstrings +ESCAPE_CHARS = { + r'$\r': '\r', + r'$\n': '\n', + r'$\t': '\t', + r'$\"': '"', + r'$\'': "'", + r'$\`': '`', +} + +RE_LANGSTRING_LINE = re.compile(r'LangString\s+(?P[A-Za-z0-9_]+)\s+\${LANG_[A-Z]+}\s+["\'`](?P.*)["\'`]$') + + +def language_to_code(language): + return LANGUAGES.get(language) + + +def code_to_language(language_code): + return _R_LANGUAGES.get(language_code) + + +def escape_string(text): + for escape, char in ESCAPE_CHARS.items(): + if char in ("'", "`"): # No need to escape quotes other than "" + continue + text = text.replace(char, escape) + return text + + +def unescape_string(text): + for escape, char in ESCAPE_CHARS.items(): + text = text.replace(escape, char) + return text + + +def parse_langstring(line): + match = RE_LANGSTRING_LINE.match(line) + if match: + return ( + match.group('identifier'), + unescape_string(match.group('text')) + ) + else: + return None + + +def make_langstring(language, identifier, text): + language = language.upper() + text = escape_string(text) + return f'LangString {identifier} ${{LANG_{language}}} "{text}"\n' diff --git a/installer/languages/sources/de.json b/installer/languages/sources/de.json new file mode 100644 index 000000000..71b0ece12 --- /dev/null +++ b/installer/languages/sources/de.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} ist bereits installiert. \n\nKlicken Sie \u201eOK\u201c um die vorherige Version zu deinstallieren oder \u201eAbbrechen\u201c um das Update abzubrechen.", + "MsgApplicationRunning": "Die Anwendung ${PRODUCT_NAME} wird ausgef\u00fchrt. Bitte schlie\u00dfen und erneut versuchen.", + "MsgRequires64Bit": "Diese Version von ${PRODUCT_NAME} erfordert ein 64-bit Windows-System.", + "MuiDescriptionRequired": "Installiert ${PRODUCT_NAME} mit den f\u00fcr die Ausf\u00fchrung erforderlichen Dateien.", + "MuiDescriptionLang": "Installiert \u00dcbersetzungen von ${PRODUCT_NAME} in verschiedenen Sprachen.", + "MuiDescriptionShortcuts": "Installiert Verkn\u00fcpfungen, um ${PRODUCT_NAME} zu starten.", + "MuiDescriptionDesktop": "Installiert eine Verkn\u00fcpfung auf dem Desktop.", + "MuiDescriptionStarteMenu": "Installiert eine Verkn\u00fcpfung im Startmen\u00fc.", + "OptionRemoveSettings": "Einstellungen und pers\u00f6nliche Daten entfernen", + "SectionDesktop": "Desktop", + "SectionLanguages": "Sprachen", + "SectionRequired": "Programmdateien (erforderlich)", + "SectionShortcuts": "Verkn\u00fcpfungen", + "SectionStartMenu": "Startmen\u00fc" +} \ No newline at end of file diff --git a/installer/languages/sources/en.json b/installer/languages/sources/en.json new file mode 100644 index 000000000..863c26d68 --- /dev/null +++ b/installer/languages/sources/en.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} is already installed. \n\nClick \"OK\" to uninstall the previous version or \"Cancel\" to cancel this upgrade.", + "MsgApplicationRunning": "The application ${PRODUCT_NAME} is running. Please close it and try again.", + "MsgRequires64Bit": "This version of ${PRODUCT_NAME} requires a 64-bit Windows system.", + "MuiDescriptionRequired": "Installs ${PRODUCT_NAME} along with the necessary files for it run.", + "MuiDescriptionLang": "Installs translations of ${PRODUCT_NAME} in different languages.", + "MuiDescriptionShortcuts": "Installs shortcuts to launch ${PRODUCT_NAME}.", + "MuiDescriptionDesktop": "Installs a shortcut on the desktop.", + "MuiDescriptionStarteMenu": "Installs a shortcut in the Start Menu.", + "OptionRemoveSettings": "Remove settings and personal data", + "SectionDesktop": "Desktop", + "SectionLanguages": "Languages", + "SectionRequired": "Program files (required)", + "SectionShortcuts": "Shortcuts", + "SectionStartMenu": "Start menu" +} \ No newline at end of file diff --git a/installer/languages/sources/fr.json b/installer/languages/sources/fr.json new file mode 100644 index 000000000..da4b201ca --- /dev/null +++ b/installer/languages/sources/fr.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} est d\u00e9j\u00e0 install\u00e9. \n\nCliquez sur \u00ab\u00a0OK\u00a0\u00bb pour d\u00e9sinstaller la version pr\u00e9c\u00e9dente ou \u00ab\u00a0Annuler\u00a0\u00bb pour annuler cette mise \u00e0 jour.", + "MsgApplicationRunning": "L\u2019application ${PRODUCT_NAME} est en cours d\u2019ex\u00e9cution. Veuillez la stopper et essayer \u00e0 nouveau.", + "MsgRequires64Bit": "Cette version de ${PRODUCT_NAME} requiert un syst\u00e8me Windows 64 bits.", + "MuiDescriptionRequired": "Installe ${PRODUCT_NAME} ainsi que les fichiers n\u00e9cessaires \u00e0 son ex\u00e9cution.", + "MuiDescriptionLang": "Installe les traductions de ${PRODUCT_NAME} dans diff\u00e9rentes langues.", + "MuiDescriptionShortcuts": "Installe les raccourcis pour lancer ${PRODUCT_NAME}.", + "MuiDescriptionDesktop": "Installe un raccourci sur le bureau.", + "MuiDescriptionStarteMenu": "Installe un raccourci dans le menu D\u00e9marrer.", + "OptionRemoveSettings": "Supprimer les pr\u00e9f\u00e9rences et les donn\u00e9es personnelles", + "SectionDesktop": "Bureau", + "SectionLanguages": "Langues", + "SectionRequired": "Fichiers du programme (requis)", + "SectionShortcuts": "Raccourcis", + "SectionStartMenu": "Menu D\u00e9marrer" +} \ No newline at end of file diff --git a/installer/languages/sources/it.json b/installer/languages/sources/it.json new file mode 100644 index 000000000..55956eea3 --- /dev/null +++ b/installer/languages/sources/it.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} \u00e8 gi\u00e0 installato.\n\nFai clic su 'OK' per disinstallare la versione installata o su 'Annulla' per annullare l'aggiornamento.", + "MsgApplicationRunning": "L'applicazione ${PRODUCT_NAME} \u00e8 in esecuzione.\nChiudi l'applicazione e riprova.", + "MsgRequires64Bit": "Questa versione di ${PRODUCT_NAME} richiede un sistema Windows a 64bit.", + "MuiDescriptionRequired": "Installa ${PRODUCT_NAME} e i relativi file necessari alla sua esecuzione.", + "MuiDescriptionLang": "Installa le traduzioni di ${PRODUCT_NAME} per le differenti lingue.", + "MuiDescriptionShortcuts": "Installa collegamento per eseguire ${PRODUCT_NAME}.", + "MuiDescriptionDesktop": "Installa collegamento sul desktop.", + "MuiDescriptionStarteMenu": "Installa collegamento nel menu Start.", + "OptionRemoveSettings": "Elimina impostazioni e dati personali", + "SectionDesktop": "Desktop", + "SectionLanguages": "Lingue", + "SectionRequired": "File programma (richiesti)", + "SectionShortcuts": "Collegamenti", + "SectionStartMenu": "Menu Start" +} \ No newline at end of file diff --git a/installer/languages/sources/nl.json b/installer/languages/sources/nl.json new file mode 100644 index 000000000..6f4d93cd6 --- /dev/null +++ b/installer/languages/sources/nl.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} is al ge\u00efnstalleerd. \n\nKlik op \u201cOK\u201d om de vorige versie te verwijderen of op \u201cAnnuleren\u201d om de installatie te annuleren.", + "MsgApplicationRunning": "De applicatie ${PRODUCT_NAME} is nog actief. Sluit haar af en probeer het opnieuw.", + "MsgRequires64Bit": "Voor deze versie van ${PRODUCT_NAME} heb je een 64 bitssysteem nodig.", + "MuiDescriptionRequired": "Installeert ${PRODUCT_NAME} en de bestanden die het nodig heeft om te draaien.", + "MuiDescriptionLang": "Installeert vertalingen van ${PRODUCT_NAME}.", + "MuiDescriptionShortcuts": "Installeert snelkoppelingen om ${PRODUCT_NAME} te starten.", + "MuiDescriptionDesktop": "Installeert een snelkoppeling op het bureaublad.", + "MuiDescriptionStarteMenu": "Installeert een snelkoppeling in het startmenu.", + "OptionRemoveSettings": "Verwijder instellingen en persoonlijke gegevens", + "SectionDesktop": "Bureaublad", + "SectionLanguages": "Talen", + "SectionRequired": "Programmabestanden (vereist)", + "SectionShortcuts": "Snelkoppelingen", + "SectionStartMenu": "Startmenu" +} \ No newline at end of file From 01f13ad02f4df1fe2b828c07661bce92faeb8723 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 28 Aug 2020 09:18:56 +0200 Subject: [PATCH 03/10] PICARD-1929: Transifex configuration for NSIS translations --- .tx/config | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.tx/config b/.tx/config index e35c3310d..28f1bf48b 100644 --- a/.tx/config +++ b/.tx/config @@ -13,6 +13,12 @@ source_file = po/appstream/picard-appstream.pot source_lang = en type = PO +[musicbrainz.picard_installer] +file_filter = installer/languages/sources/.json +source_file = installer/languages/sources/en.json +source_lang = en +type = KEYVALUEJSON + [musicbrainz.countries] file_filter = po/countries/.po source_file = po/countries/countries.pot From 0e346f5307d18820249141c9dda3fedd859077ce Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 28 Aug 2020 09:28:58 +0200 Subject: [PATCH 04/10] PICARD-1929: Use English as default for empty NSIS translations NSIS will by itself not allow empty translatons, hence make sure to handle empty strings on tranlation import. --- installer/languages/json2nsh.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/installer/languages/json2nsh.py b/installer/languages/json2nsh.py index 568ab3a02..b2e2fd9fa 100755 --- a/installer/languages/json2nsh.py +++ b/installer/languages/json2nsh.py @@ -36,10 +36,23 @@ def write_langstring(f, language, identifier, text): f.write(langstring) +def merge_translations(*translations): + merged = {} + for trans in translations: + for k, v in trans.items(): + if v: + merged[k] = v + return merged + + def main(): scriptdir = os.path.dirname(os.path.abspath(__file__)) sourcesdir = os.path.join(scriptdir, 'sources') + # Read the english sources for defaults + with open(os.path.join(sourcesdir, 'en.json'), 'r', encoding='utf-8') as infile: + data_en = json.loads(infile.read()) + for path in glob.glob(os.path.join(sourcesdir, '*.json')): language, language_code = language_from_filename(path) if not language: @@ -48,6 +61,7 @@ def main(): target_file = os.path.join(scriptdir, f'{language}.nsh') with open(path, 'r', encoding='utf-8') as infile: data = json.loads(infile.read()) + data = merge_translations(data_en, data) with open(target_file, 'w+', encoding='utf-8') as outfile: for identifier, text in data.items(): write_langstring(outfile, language, identifier, text) From 921ed8f5ac2cf9f462de54ad4f5e501c0c575040 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sat, 5 Sep 2020 17:41:39 +0200 Subject: [PATCH 05/10] PICARD-1929: Generate NSIS translation files during build Do not include the .nsh files in the repository but generate them during build from the JSON files. --- .gitignore | 1 + installer/languages/Dutch.nsh | 14 -------------- installer/languages/English.nsh | 14 -------------- installer/languages/French.nsh | 14 -------------- installer/languages/German.nsh | 14 -------------- installer/languages/Italian.nsh | 14 -------------- installer/languages/json2nsh.py | 5 ++++- installer/languages/nsh2json.py | 7 +++++-- installer/picard-setup.nsi.in | 2 +- setup.py | 3 +++ 10 files changed, 14 insertions(+), 74 deletions(-) delete mode 100644 installer/languages/Dutch.nsh delete mode 100644 installer/languages/English.nsh delete mode 100644 installer/languages/French.nsh delete mode 100644 installer/languages/German.nsh delete mode 100644 installer/languages/Italian.nsh diff --git a/.gitignore b/.gitignore index 5e6b34154..d53a58d4f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ build/ coverage.xml dist/ installer/picard-setup.nsi +installer/languages/out/*.nsh locale/ org.musicbrainz.Picard.appdata.xml picard.egg-info diff --git a/installer/languages/Dutch.nsh b/installer/languages/Dutch.nsh deleted file mode 100644 index b8d0d55be..000000000 --- a/installer/languages/Dutch.nsh +++ /dev/null @@ -1,14 +0,0 @@ -LangString MsgAlreadyInstalled ${LANG_DUTCH} "${PRODUCT_NAME} is al geïnstalleerd. $\n$\nKlik op “OK” om de vorige versie te verwijderen of op “Annuleren” om de installatie te annuleren." -LangString MsgApplicationRunning ${LANG_DUTCH} "De applicatie ${PRODUCT_NAME} is nog actief. Sluit haar af en probeer het opnieuw." -LangString MsgRequires64Bit ${LANG_DUTCH} "Voor deze versie van ${PRODUCT_NAME} heb je een 64 bitssysteem nodig." -LangString MuiDescriptionRequired ${LANG_DUTCH} "Installeert ${PRODUCT_NAME} en de bestanden die het nodig heeft om te draaien." -LangString MuiDescriptionLang ${LANG_DUTCH} "Installeert vertalingen van ${PRODUCT_NAME}." -LangString MuiDescriptionShortcuts ${LANG_DUTCH} "Installeert snelkoppelingen om ${PRODUCT_NAME} te starten." -LangString MuiDescriptionDesktop ${LANG_DUTCH} "Installeert een snelkoppeling op het bureaublad." -LangString MuiDescriptionStarteMenu ${LANG_DUTCH} "Installeert een snelkoppeling in het startmenu." -LangString OptionRemoveSettings ${LANG_DUTCH} "Verwijder instellingen en persoonlijke gegevens" -LangString SectionDesktop ${LANG_DUTCH} "Bureaublad" -LangString SectionLanguages ${LANG_DUTCH} "Talen" -LangString SectionRequired ${LANG_DUTCH} "Programmabestanden (vereist)" -LangString SectionShortcuts ${LANG_DUTCH} "Snelkoppelingen" -LangString SectionStartMenu ${LANG_DUTCH} "Startmenu" diff --git a/installer/languages/English.nsh b/installer/languages/English.nsh deleted file mode 100644 index 3ebede99a..000000000 --- a/installer/languages/English.nsh +++ /dev/null @@ -1,14 +0,0 @@ -LangString MsgAlreadyInstalled ${LANG_ENGLISH} "${PRODUCT_NAME} is already installed. $\n$\nClick $\"OK$\" to uninstall the previous version or $\"Cancel$\" to cancel this upgrade." -LangString MsgApplicationRunning ${LANG_ENGLISH} "The application ${PRODUCT_NAME} is running. Please close it and try again." -LangString MsgRequires64Bit ${LANG_ENGLISH} "This version of ${PRODUCT_NAME} requires a 64-bit Windows system." -LangString MuiDescriptionRequired ${LANG_ENGLISH} "Installs ${PRODUCT_NAME} along with the necessary files for it run." -LangString MuiDescriptionLang ${LANG_ENGLISH} "Installs translations of ${PRODUCT_NAME} in different languages." -LangString MuiDescriptionShortcuts ${LANG_ENGLISH} "Installs shortcuts to launch ${PRODUCT_NAME}." -LangString MuiDescriptionDesktop ${LANG_ENGLISH} "Installs a shortcut on the desktop." -LangString MuiDescriptionStarteMenu ${LANG_ENGLISH} "Installs a shortcut in the Start Menu." -LangString OptionRemoveSettings ${LANG_ENGLISH} "Remove settings and personal data" -LangString SectionDesktop ${LANG_ENGLISH} "Desktop" -LangString SectionLanguages ${LANG_ENGLISH} "Languages" -LangString SectionRequired ${LANG_ENGLISH} "Program files (required)" -LangString SectionShortcuts ${LANG_ENGLISH} "Shortcuts" -LangString SectionStartMenu ${LANG_ENGLISH} "Start menu" diff --git a/installer/languages/French.nsh b/installer/languages/French.nsh deleted file mode 100644 index 50b2828f4..000000000 --- a/installer/languages/French.nsh +++ /dev/null @@ -1,14 +0,0 @@ -LangString MsgAlreadyInstalled ${LANG_FRENCH} "${PRODUCT_NAME} est déjà installé. $\n$\nCliquez sur « OK » pour désinstaller la version précédente ou « Annuler » pour annuler cette mise à jour." -LangString MsgApplicationRunning ${LANG_FRENCH} "L’application ${PRODUCT_NAME} est en cours d’exécution. Veuillez la stopper et essayer à nouveau." -LangString MsgRequires64Bit ${LANG_FRENCH} "Cette version de ${PRODUCT_NAME} requiert un système Windows 64 bits." -LangString MuiDescriptionRequired ${LANG_FRENCH} "Installe ${PRODUCT_NAME} ainsi que les fichiers nécessaires à son exécution." -LangString MuiDescriptionLang ${LANG_FRENCH} "Installe les traductions de ${PRODUCT_NAME} dans différentes langues." -LangString MuiDescriptionShortcuts ${LANG_FRENCH} "Installe les raccourcis pour lancer ${PRODUCT_NAME}." -LangString MuiDescriptionDesktop ${LANG_FRENCH} "Installe un raccourci sur le bureau." -LangString MuiDescriptionStarteMenu ${LANG_FRENCH} "Installe un raccourci dans le menu Démarrer." -LangString OptionRemoveSettings ${LANG_FRENCH} "Supprimer les préférences et les données personnelles" -LangString SectionDesktop ${LANG_FRENCH} "Bureau" -LangString SectionLanguages ${LANG_FRENCH} "Langues" -LangString SectionRequired ${LANG_FRENCH} "Fichiers du programme (requis)" -LangString SectionShortcuts ${LANG_FRENCH} "Raccourcis" -LangString SectionStartMenu ${LANG_FRENCH} "Menu Démarrer" diff --git a/installer/languages/German.nsh b/installer/languages/German.nsh deleted file mode 100644 index 0a16e4c7f..000000000 --- a/installer/languages/German.nsh +++ /dev/null @@ -1,14 +0,0 @@ -LangString MsgAlreadyInstalled ${LANG_GERMAN} "${PRODUCT_NAME} ist bereits installiert. $\n$\nKlicken Sie „OK“ um die vorherige Version zu deinstallieren oder „Abbrechen“ um das Update abzubrechen." -LangString MsgApplicationRunning ${LANG_GERMAN} "Die Anwendung ${PRODUCT_NAME} wird ausgeführt. Bitte schließen und erneut versuchen." -LangString MsgRequires64Bit ${LANG_GERMAN} "Diese Version von ${PRODUCT_NAME} erfordert ein 64-bit Windows-System." -LangString MuiDescriptionRequired ${LANG_GERMAN} "Installiert ${PRODUCT_NAME} mit den für die Ausführung erforderlichen Dateien." -LangString MuiDescriptionLang ${LANG_GERMAN} "Installiert Übersetzungen von ${PRODUCT_NAME} in verschiedenen Sprachen." -LangString MuiDescriptionShortcuts ${LANG_GERMAN} "Installiert Verknüpfungen, um ${PRODUCT_NAME} zu starten." -LangString MuiDescriptionDesktop ${LANG_GERMAN} "Installiert eine Verknüpfung auf dem Desktop." -LangString MuiDescriptionStarteMenu ${LANG_GERMAN} "Installiert eine Verknüpfung im Startmenü." -LangString OptionRemoveSettings ${LANG_GERMAN} "Einstellungen und persönliche Daten entfernen" -LangString SectionDesktop ${LANG_GERMAN} "Desktop" -LangString SectionLanguages ${LANG_GERMAN} "Sprachen" -LangString SectionRequired ${LANG_GERMAN} "Programmdateien (erforderlich)" -LangString SectionShortcuts ${LANG_GERMAN} "Verknüpfungen" -LangString SectionStartMenu ${LANG_GERMAN} "Startmenü" diff --git a/installer/languages/Italian.nsh b/installer/languages/Italian.nsh deleted file mode 100644 index 4bcbb3440..000000000 --- a/installer/languages/Italian.nsh +++ /dev/null @@ -1,14 +0,0 @@ -LangString MsgAlreadyInstalled ${LANG_ITALIAN} "${PRODUCT_NAME} è già installato.$\n$\nFai clic su 'OK' per disinstallare la versione installata o su 'Annulla' per annullare l'aggiornamento." -LangString MsgApplicationRunning ${LANG_ITALIAN} "L'applicazione ${PRODUCT_NAME} è in esecuzione.$\nChiudi l'applicazione e riprova." -LangString MsgRequires64Bit ${LANG_ITALIAN} "Questa versione di ${PRODUCT_NAME} richiede un sistema Windows a 64bit." -LangString MuiDescriptionRequired ${LANG_ITALIAN} "Installa ${PRODUCT_NAME} e i relativi file necessari alla sua esecuzione." -LangString MuiDescriptionLang ${LANG_ITALIAN} "Installa le traduzioni di ${PRODUCT_NAME} per le differenti lingue." -LangString MuiDescriptionShortcuts ${LANG_ITALIAN} "Installa collegamento per eseguire ${PRODUCT_NAME}." -LangString MuiDescriptionDesktop ${LANG_ITALIAN} "Installa collegamento sul desktop." -LangString MuiDescriptionStarteMenu ${LANG_ITALIAN} "Installa collegamento nel menu Start." -LangString OptionRemoveSettings ${LANG_ITALIAN} "Elimina impostazioni e dati personali" -LangString SectionDesktop ${LANG_ITALIAN} "Desktop" -LangString SectionLanguages ${LANG_ITALIAN} "Lingue" -LangString SectionRequired ${LANG_ITALIAN} "File programma (richiesti)" -LangString SectionShortcuts ${LANG_ITALIAN} "Collegamenti" -LangString SectionStartMenu ${LANG_ITALIAN} "Menu Start" diff --git a/installer/languages/json2nsh.py b/installer/languages/json2nsh.py index b2e2fd9fa..831e14566 100755 --- a/installer/languages/json2nsh.py +++ b/installer/languages/json2nsh.py @@ -48,6 +48,8 @@ def merge_translations(*translations): def main(): scriptdir = os.path.dirname(os.path.abspath(__file__)) sourcesdir = os.path.join(scriptdir, 'sources') + outdir = os.path.join(scriptdir, 'out') + os.makedirs(outdir, exist_ok=True) # Read the english sources for defaults with open(os.path.join(sourcesdir, 'en.json'), 'r', encoding='utf-8') as infile: @@ -58,7 +60,8 @@ def main(): if not language: print(f'Unknown language code "{language_code}", skipping') continue - target_file = os.path.join(scriptdir, f'{language}.nsh') + target_file = os.path.join(outdir, f'{language}.nsh') + print(f'{path} => {target_file}') with open(path, 'r', encoding='utf-8') as infile: data = json.loads(infile.read()) data = merge_translations(data_en, data) diff --git a/installer/languages/nsh2json.py b/installer/languages/nsh2json.py index 4779ae467..bffd7ee25 100755 --- a/installer/languages/nsh2json.py +++ b/installer/languages/nsh2json.py @@ -40,13 +40,16 @@ def extract_strings(f): def main(): scriptdir = os.path.dirname(os.path.abspath(__file__)) + sourcesdir = os.path.join(scriptdir, 'sources') + outdir = os.path.join(scriptdir, 'out') - for path in glob.glob(os.path.join(scriptdir, '*.nsh')): + for path in glob.glob(os.path.join(outdir, '*.nsh')): language, language_code = language_from_filename(path) if not language_code: print(f'Unknown language "{language}", skipping') continue - target_file = os.path.join(scriptdir, 'sources', f'{language_code}.json') + target_file = os.path.join(sourcesdir, f'{language_code}.json') + print(f'{path} => {target_file}') with open(path, 'r', encoding='utf-8') as infile: output = {} for identifier, text in extract_strings(infile): diff --git a/installer/picard-setup.nsi.in b/installer/picard-setup.nsi.in index 0587ffd1e..d7201496e 100644 --- a/installer/picard-setup.nsi.in +++ b/installer/picard-setup.nsi.in @@ -80,7 +80,7 @@ ReserveFile "${NSISDIR}\Plugins\x86-unicode\InstallOptions.dll" ; Language handling !macro LOAD_LANGUAGE LANGUAGE !insertmacro MUI_LANGUAGE "${LANGUAGE}" - !include "languages\${LANGUAGE}.nsh" + !include "languages\out\${LANGUAGE}.nsh" !macroend ; Language files diff --git a/setup.py b/setup.py index fb1ed1b72..2d8893699 100644 --- a/setup.py +++ b/setup.py @@ -274,6 +274,9 @@ class picard_build(build): } if os.path.isfile('installer/picard-setup.nsi.in'): generate_file('installer/picard-setup.nsi.in', 'installer/picard-setup.nsi', {**args, **installer_args}) + log.info('generating NSIS translation files') + self.spawn(['python', 'installer/languages/json2nsh.py']) + version_args = { 'filevers': str(file_version), 'prodvers': str(file_version), From 5f4e52431863fd106498060fcc5df500093e6304 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sat, 5 Sep 2020 17:43:21 +0200 Subject: [PATCH 06/10] Renamed installer/languages to installer/i18n --- .gitignore | 2 +- .tx/config | 4 ++-- installer/{languages => i18n}/json2nsh.py | 0 installer/{languages => i18n}/nsh2json.py | 0 installer/{languages => i18n}/nshutil.py | 0 installer/{languages => i18n}/sources/de.json | 0 installer/{languages => i18n}/sources/en.json | 0 installer/{languages => i18n}/sources/fr.json | 0 installer/{languages => i18n}/sources/it.json | 0 installer/{languages => i18n}/sources/nl.json | 0 installer/picard-setup.nsi.in | 2 +- setup.py | 2 +- 12 files changed, 5 insertions(+), 5 deletions(-) rename installer/{languages => i18n}/json2nsh.py (100%) rename installer/{languages => i18n}/nsh2json.py (100%) rename installer/{languages => i18n}/nshutil.py (100%) rename installer/{languages => i18n}/sources/de.json (100%) rename installer/{languages => i18n}/sources/en.json (100%) rename installer/{languages => i18n}/sources/fr.json (100%) rename installer/{languages => i18n}/sources/it.json (100%) rename installer/{languages => i18n}/sources/nl.json (100%) diff --git a/.gitignore b/.gitignore index d53a58d4f..e85ad96de 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,7 @@ build/ coverage.xml dist/ installer/picard-setup.nsi -installer/languages/out/*.nsh +installer/i18n/out/*.nsh locale/ org.musicbrainz.Picard.appdata.xml picard.egg-info diff --git a/.tx/config b/.tx/config index 28f1bf48b..4a5facbca 100644 --- a/.tx/config +++ b/.tx/config @@ -14,8 +14,8 @@ source_lang = en type = PO [musicbrainz.picard_installer] -file_filter = installer/languages/sources/.json -source_file = installer/languages/sources/en.json +file_filter = installer/i18n/sources/.json +source_file = installer/i18n/sources/en.json source_lang = en type = KEYVALUEJSON diff --git a/installer/languages/json2nsh.py b/installer/i18n/json2nsh.py similarity index 100% rename from installer/languages/json2nsh.py rename to installer/i18n/json2nsh.py diff --git a/installer/languages/nsh2json.py b/installer/i18n/nsh2json.py similarity index 100% rename from installer/languages/nsh2json.py rename to installer/i18n/nsh2json.py diff --git a/installer/languages/nshutil.py b/installer/i18n/nshutil.py similarity index 100% rename from installer/languages/nshutil.py rename to installer/i18n/nshutil.py diff --git a/installer/languages/sources/de.json b/installer/i18n/sources/de.json similarity index 100% rename from installer/languages/sources/de.json rename to installer/i18n/sources/de.json diff --git a/installer/languages/sources/en.json b/installer/i18n/sources/en.json similarity index 100% rename from installer/languages/sources/en.json rename to installer/i18n/sources/en.json diff --git a/installer/languages/sources/fr.json b/installer/i18n/sources/fr.json similarity index 100% rename from installer/languages/sources/fr.json rename to installer/i18n/sources/fr.json diff --git a/installer/languages/sources/it.json b/installer/i18n/sources/it.json similarity index 100% rename from installer/languages/sources/it.json rename to installer/i18n/sources/it.json diff --git a/installer/languages/sources/nl.json b/installer/i18n/sources/nl.json similarity index 100% rename from installer/languages/sources/nl.json rename to installer/i18n/sources/nl.json diff --git a/installer/picard-setup.nsi.in b/installer/picard-setup.nsi.in index d7201496e..e30bd5e85 100644 --- a/installer/picard-setup.nsi.in +++ b/installer/picard-setup.nsi.in @@ -80,7 +80,7 @@ ReserveFile "${NSISDIR}\Plugins\x86-unicode\InstallOptions.dll" ; Language handling !macro LOAD_LANGUAGE LANGUAGE !insertmacro MUI_LANGUAGE "${LANGUAGE}" - !include "languages\out\${LANGUAGE}.nsh" + !include "i18n\out\${LANGUAGE}.nsh" !macroend ; Language files diff --git a/setup.py b/setup.py index 2d8893699..3b800989d 100644 --- a/setup.py +++ b/setup.py @@ -275,7 +275,7 @@ class picard_build(build): if os.path.isfile('installer/picard-setup.nsi.in'): generate_file('installer/picard-setup.nsi.in', 'installer/picard-setup.nsi', {**args, **installer_args}) log.info('generating NSIS translation files') - self.spawn(['python', 'installer/languages/json2nsh.py']) + self.spawn(['python', 'installer/i18n/json2nsh.py']) version_args = { 'filevers': str(file_version), From 94420d77157b7df6e08fce1f13bb7bf830b9c2ff Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 6 Sep 2020 19:45:22 +0200 Subject: [PATCH 07/10] Renamed setup.py command get_po_files to pull_translations --- RELEASING.md | 2 +- po/README.md | 4 ++-- setup.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index f974f4e84..496ad1753 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -52,7 +52,7 @@ git ls-tree --full-tree -r HEAD --name-only |while read f; do sed -i '1s/^\xEF\x ## Get latest translations from Transifex ```bash -python setup.py get_po_files && git diff --quiet || git commit -m 'Update .po files' -- po/ +python setup.py pull_translations && git diff --quiet || git commit -m 'Update .po files' -- po/ ``` ## Synchronize generated consts diff --git a/po/README.md b/po/README.md index a516c1208..ed29107da 100644 --- a/po/README.md +++ b/po/README.md @@ -45,13 +45,13 @@ To fetch latest translations from Transifex Use the following command: ```bash -$ python setup.py get_po_files +$ python setup.py pull_translations ``` It will fetch all po files from Transifex, but the most incomplete ones. The minimum acceptable percentage of a translation in order to download it can be seen using: ```bash -$ python setup.py get_po_files --help +$ python setup.py pull_translations --help ``` The percentage value is passed to the `tx pull` command. diff --git a/setup.py b/setup.py index 3b800989d..daf289f44 100644 --- a/setup.py +++ b/setup.py @@ -472,7 +472,7 @@ class picard_regen_appdata_pot_file(Command): ]) -class picard_get_po_files(Command): +class picard_pull_translations(Command): description = "Retrieve po files from transifex" minimum_perc_default = 5 user_options = [ @@ -767,7 +767,7 @@ args = { 'install': picard_install, 'install_locales': picard_install_locales, 'update_constants': picard_update_constants, - 'get_po_files': picard_get_po_files, + 'pull_translations': picard_pull_translations, 'regen_pot_file': picard_regen_pot_file, 'patch_version': picard_patch_version, }, From f9dd69dcc8eec2a9694545a061f12e7768a5d2b6 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 6 Sep 2020 20:15:18 +0200 Subject: [PATCH 08/10] PICARD-1929: Extended NSIS language list --- installer/i18n/nshutil.py | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/installer/i18n/nshutil.py b/installer/i18n/nshutil.py index cd70a3fdd..c9a71cb8d 100644 --- a/installer/i18n/nshutil.py +++ b/installer/i18n/nshutil.py @@ -22,35 +22,78 @@ import re +# See list of available NSIS languages at +# https://sourceforge.net/p/nsis/code/HEAD/tree/NSIS/trunk/Contrib/Language%20files/ LANGUAGES = { + 'Afrikaans': 'af', + 'Albanian': 'sq', 'Arabic': 'ar', + 'Asturian': 'ast', + 'Basque': 'eu', + 'Belarusian': 'be', + 'Bosnian': 'bs', + 'Breton': 'br', + 'Bulgarian': 'bg', 'Catalan': 'ca', + 'Cibemba': 'bem', + 'Corsican': 'co', + 'Croation': 'hr', 'Czech': 'cs', 'Danish': 'da', 'Dutch': 'nl', 'English': 'en', + 'Esperanto': 'eo', 'Estonian': 'et', + 'Farsi': 'fa', 'Finnish': 'fi', 'French': 'fr', + 'Galician': 'gl', + 'Georgian': 'ka', 'German': 'de', 'Greek': 'el', 'Hebrew': 'he', + 'Hindi': 'hi', + 'Hungarian': 'hu', + 'Icelandic': 'is', + 'Igbo': 'ig', + 'Indonesian': 'id', + 'Irish': 'ga', 'Italian': 'it', 'Japanese': 'ja', + 'Khmer': 'km', 'Korean': 'ko', + 'Kurdish': 'ku', + 'Latvian': 'lv', + 'Lithuanian': 'lt', + 'Luxembourgish': 'lb', + 'Macedonian': 'mk', + 'Malagasy': 'mg', + 'Malay': 'ms_MY', + 'Mongolian': 'mn', 'Norwegian': 'nb', + 'NorwegianNynorsk': 'nn', 'Polish': 'pl', 'Portuguese': 'pt', 'PortugueseBR': 'pt_BR', + 'Romanian': 'ro', 'Russian': 'ru', + 'ScotsGaelic': 'sco', + 'Serbian': 'sr', 'SimpChinese': 'zh-Hans', 'Slovak': 'sk', 'Slovenian': 'sl', 'Spanish': 'es', + 'Swahili': 'sw', 'Swedish': 'sv', + 'Tatar': 'tt', + 'Thai': 'th', 'TradChinese': 'zh-Hant', 'Turkish': 'tr', 'Ukrainian': 'uk', + 'Uzbek': 'uz', + 'Vietnamese': 'vi', + 'Welsh': 'cy', + 'Yoruba': 'yo', } _R_LANGUAGES = dict([(code, name) for name, code in LANGUAGES.items()]) From 6150e071b0ebe5b9ca76c59ee14a743c993dc168 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 6 Sep 2020 20:26:52 +0200 Subject: [PATCH 09/10] PICARD-1929: Allow unicode characters in NSIS i18n JSON files --- installer/i18n/nsh2json.py | 2 +- installer/i18n/sources/de.json | 20 ++++++++++---------- installer/i18n/sources/fr.json | 16 ++++++++-------- installer/i18n/sources/it.json | 6 +++--- installer/i18n/sources/nl.json | 2 +- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/installer/i18n/nsh2json.py b/installer/i18n/nsh2json.py index bffd7ee25..2f18d3920 100755 --- a/installer/i18n/nsh2json.py +++ b/installer/i18n/nsh2json.py @@ -56,7 +56,7 @@ def main(): output[identifier] = text with open(target_file, 'w+', encoding='utf-8') as outfile: - outfile.write(json.dumps(output, indent=4)) + outfile.write(json.dumps(output, ensure_ascii=False, indent=4)) if __name__ == "__main__": diff --git a/installer/i18n/sources/de.json b/installer/i18n/sources/de.json index 71b0ece12..180f347f2 100644 --- a/installer/i18n/sources/de.json +++ b/installer/i18n/sources/de.json @@ -1,16 +1,16 @@ { - "MsgAlreadyInstalled": "${PRODUCT_NAME} ist bereits installiert. \n\nKlicken Sie \u201eOK\u201c um die vorherige Version zu deinstallieren oder \u201eAbbrechen\u201c um das Update abzubrechen.", - "MsgApplicationRunning": "Die Anwendung ${PRODUCT_NAME} wird ausgef\u00fchrt. Bitte schlie\u00dfen und erneut versuchen.", + "MsgAlreadyInstalled": "${PRODUCT_NAME} ist bereits installiert. \n\nKlicken Sie „OK“ um die vorherige Version zu deinstallieren oder „Abbrechen“ um das Update abzubrechen.", + "MsgApplicationRunning": "Die Anwendung ${PRODUCT_NAME} wird ausgeführt. Bitte schließen und erneut versuchen.", "MsgRequires64Bit": "Diese Version von ${PRODUCT_NAME} erfordert ein 64-bit Windows-System.", - "MuiDescriptionRequired": "Installiert ${PRODUCT_NAME} mit den f\u00fcr die Ausf\u00fchrung erforderlichen Dateien.", - "MuiDescriptionLang": "Installiert \u00dcbersetzungen von ${PRODUCT_NAME} in verschiedenen Sprachen.", - "MuiDescriptionShortcuts": "Installiert Verkn\u00fcpfungen, um ${PRODUCT_NAME} zu starten.", - "MuiDescriptionDesktop": "Installiert eine Verkn\u00fcpfung auf dem Desktop.", - "MuiDescriptionStarteMenu": "Installiert eine Verkn\u00fcpfung im Startmen\u00fc.", - "OptionRemoveSettings": "Einstellungen und pers\u00f6nliche Daten entfernen", + "MuiDescriptionRequired": "Installiert ${PRODUCT_NAME} mit den für die Ausführung erforderlichen Dateien.", + "MuiDescriptionLang": "Installiert Übersetzungen von ${PRODUCT_NAME} in verschiedenen Sprachen.", + "MuiDescriptionShortcuts": "Installiert Verknüpfungen, um ${PRODUCT_NAME} zu starten.", + "MuiDescriptionDesktop": "Installiert eine Verknüpfung auf dem Desktop.", + "MuiDescriptionStarteMenu": "Installiert eine Verknüpfung im Startmenü.", + "OptionRemoveSettings": "Einstellungen und persönliche Daten entfernen", "SectionDesktop": "Desktop", "SectionLanguages": "Sprachen", "SectionRequired": "Programmdateien (erforderlich)", - "SectionShortcuts": "Verkn\u00fcpfungen", - "SectionStartMenu": "Startmen\u00fc" + "SectionShortcuts": "Verknüpfungen", + "SectionStartMenu": "Startmenü" } \ No newline at end of file diff --git a/installer/i18n/sources/fr.json b/installer/i18n/sources/fr.json index da4b201ca..1d84a813f 100644 --- a/installer/i18n/sources/fr.json +++ b/installer/i18n/sources/fr.json @@ -1,16 +1,16 @@ { - "MsgAlreadyInstalled": "${PRODUCT_NAME} est d\u00e9j\u00e0 install\u00e9. \n\nCliquez sur \u00ab\u00a0OK\u00a0\u00bb pour d\u00e9sinstaller la version pr\u00e9c\u00e9dente ou \u00ab\u00a0Annuler\u00a0\u00bb pour annuler cette mise \u00e0 jour.", - "MsgApplicationRunning": "L\u2019application ${PRODUCT_NAME} est en cours d\u2019ex\u00e9cution. Veuillez la stopper et essayer \u00e0 nouveau.", - "MsgRequires64Bit": "Cette version de ${PRODUCT_NAME} requiert un syst\u00e8me Windows 64 bits.", - "MuiDescriptionRequired": "Installe ${PRODUCT_NAME} ainsi que les fichiers n\u00e9cessaires \u00e0 son ex\u00e9cution.", - "MuiDescriptionLang": "Installe les traductions de ${PRODUCT_NAME} dans diff\u00e9rentes langues.", + "MsgAlreadyInstalled": "${PRODUCT_NAME} est déjà installé. \n\nCliquez sur « OK » pour désinstaller la version précédente ou « Annuler » pour annuler cette mise à jour.", + "MsgApplicationRunning": "L’application ${PRODUCT_NAME} est en cours d’exécution. Veuillez la stopper et essayer à nouveau.", + "MsgRequires64Bit": "Cette version de ${PRODUCT_NAME} requiert un système Windows 64 bits.", + "MuiDescriptionRequired": "Installe ${PRODUCT_NAME} ainsi que les fichiers nécessaires à son exécution.", + "MuiDescriptionLang": "Installe les traductions de ${PRODUCT_NAME} dans différentes langues.", "MuiDescriptionShortcuts": "Installe les raccourcis pour lancer ${PRODUCT_NAME}.", "MuiDescriptionDesktop": "Installe un raccourci sur le bureau.", - "MuiDescriptionStarteMenu": "Installe un raccourci dans le menu D\u00e9marrer.", - "OptionRemoveSettings": "Supprimer les pr\u00e9f\u00e9rences et les donn\u00e9es personnelles", + "MuiDescriptionStarteMenu": "Installe un raccourci dans le menu Démarrer.", + "OptionRemoveSettings": "Supprimer les préférences et les données personnelles", "SectionDesktop": "Bureau", "SectionLanguages": "Langues", "SectionRequired": "Fichiers du programme (requis)", "SectionShortcuts": "Raccourcis", - "SectionStartMenu": "Menu D\u00e9marrer" + "SectionStartMenu": "Menu Démarrer" } \ No newline at end of file diff --git a/installer/i18n/sources/it.json b/installer/i18n/sources/it.json index 55956eea3..564334a6c 100644 --- a/installer/i18n/sources/it.json +++ b/installer/i18n/sources/it.json @@ -1,10 +1,10 @@ { - "MsgAlreadyInstalled": "${PRODUCT_NAME} \u00e8 gi\u00e0 installato.\n\nFai clic su 'OK' per disinstallare la versione installata o su 'Annulla' per annullare l'aggiornamento.", - "MsgApplicationRunning": "L'applicazione ${PRODUCT_NAME} \u00e8 in esecuzione.\nChiudi l'applicazione e riprova.", + "MsgAlreadyInstalled": "${PRODUCT_NAME} è già installato.\n\nFai clic su 'OK' per disinstallare la versione installata o su 'Annulla' per annullare l'aggiornamento.", + "MsgApplicationRunning": "L'applicazione ${PRODUCT_NAME} è in esecuzione.\nChiudi l'applicazione e riprova.", "MsgRequires64Bit": "Questa versione di ${PRODUCT_NAME} richiede un sistema Windows a 64bit.", "MuiDescriptionRequired": "Installa ${PRODUCT_NAME} e i relativi file necessari alla sua esecuzione.", "MuiDescriptionLang": "Installa le traduzioni di ${PRODUCT_NAME} per le differenti lingue.", - "MuiDescriptionShortcuts": "Installa collegamento per eseguire ${PRODUCT_NAME}.", + "MuiDescriptionShortcuts": "Installa collegamenti per eseguire ${PRODUCT_NAME}.", "MuiDescriptionDesktop": "Installa collegamento sul desktop.", "MuiDescriptionStarteMenu": "Installa collegamento nel menu Start.", "OptionRemoveSettings": "Elimina impostazioni e dati personali", diff --git a/installer/i18n/sources/nl.json b/installer/i18n/sources/nl.json index 6f4d93cd6..9b182911a 100644 --- a/installer/i18n/sources/nl.json +++ b/installer/i18n/sources/nl.json @@ -1,5 +1,5 @@ { - "MsgAlreadyInstalled": "${PRODUCT_NAME} is al ge\u00efnstalleerd. \n\nKlik op \u201cOK\u201d om de vorige versie te verwijderen of op \u201cAnnuleren\u201d om de installatie te annuleren.", + "MsgAlreadyInstalled": "${PRODUCT_NAME} is al geïnstalleerd. \n\nKlik op “OK” om de vorige versie te verwijderen of op “Annuleren” om de installatie te annuleren.", "MsgApplicationRunning": "De applicatie ${PRODUCT_NAME} is nog actief. Sluit haar af en probeer het opnieuw.", "MsgRequires64Bit": "Voor deze versie van ${PRODUCT_NAME} heb je een 64 bitssysteem nodig.", "MuiDescriptionRequired": "Installeert ${PRODUCT_NAME} en de bestanden die het nodig heeft om te draaien.", From a1d95ddf636cf3d224fda80a36eb0be8c2fcdcb2 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Sun, 6 Sep 2020 20:42:20 +0200 Subject: [PATCH 10/10] NSIS installer Spanish translation --- installer/i18n/sources/es.json | 16 ++++++++++++++++ installer/picard-setup.nsi.in | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 installer/i18n/sources/es.json diff --git a/installer/i18n/sources/es.json b/installer/i18n/sources/es.json new file mode 100644 index 000000000..9de0c099d --- /dev/null +++ b/installer/i18n/sources/es.json @@ -0,0 +1,16 @@ +{ + "MsgAlreadyInstalled": "${PRODUCT_NAME} ya está instalado . \n\nClick \"OK\" para desinstalar la versión anterior o \"Cancel\" para cancelar esta actualización. ", + "MsgApplicationRunning": "La aplicación ${PRODUCT_NAME} está en marcha. Por favor cierrelo e inténtelo de nuevo.", + "MsgRequires64Bit": "La versión de ${PRODUCT_NAME} requiere un Windows de 64-bits.", + "MuiDescriptionRequired": "Instalar ${PRODUCT_NAME} junto con los archivos necesarios para que funcione.", + "MuiDescriptionLang": "Instalar traducciones de ${PRODUCT_NAME} en diferentes lenguajes.", + "MuiDescriptionShortcuts": "Instalar atajos para iniciar ${PRODUCT_NAME}.", + "MuiDescriptionDesktop": "Instalar un atajo en el escritorio", + "MuiDescriptionStarteMenu": "Instalar un atajo en el Menú de Inicio", + "OptionRemoveSettings": "Remover ajustes e información personal", + "SectionDesktop": "Escritorio", + "SectionLanguages": "Idiomas", + "SectionRequired": "Archivos de programa (requerido)", + "SectionShortcuts": "Atajos", + "SectionStartMenu": "Menú de inicio" +} \ No newline at end of file diff --git a/installer/picard-setup.nsi.in b/installer/picard-setup.nsi.in index e30bd5e85..16e40c5ed 100644 --- a/installer/picard-setup.nsi.in +++ b/installer/picard-setup.nsi.in @@ -107,7 +107,7 @@ ReserveFile "${NSISDIR}\Plugins\x86-unicode\InstallOptions.dll" ; !insertmacro LOAD_LANGUAGE "SimpChinese" ; !insertmacro LOAD_LANGUAGE "Slovak" ; !insertmacro LOAD_LANGUAGE "Slovenian" -; !insertmacro LOAD_LANGUAGE "Spanish" +!insertmacro LOAD_LANGUAGE "Spanish" ; !insertmacro LOAD_LANGUAGE "Swedish" ; !insertmacro LOAD_LANGUAGE "TradChinese" ; !insertmacro LOAD_LANGUAGE "Turkish"