diff --git a/.gitignore b/.gitignore index f346ca8..1a8dac4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ linux/flatpak/.flatpak-builder *.zip **/**.qmlc **/**.jsc +**/**.pyc +**/**.qm *.jsc *.qmlc .DS_Store @@ -27,4 +29,5 @@ docs/html .kdev4 AccountFree.pro AccountFree.pro.user -AccountFree.egg-info/ +*.egg-info/ +*.tar.gz diff --git a/.gitmodules b/.gitmodules index df81e42..8c591d4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "LogarithmPlotter/qml/eu/ad5001/MixedMenu"] path = LogarithmPlotter/qml/eu/ad5001/MixedMenu url = https://git.ad5001.eu/Ad5001/MixedMenu +[submodule "linux/flatpak"] + path = linux/flatpak + url = https://github.com/Ad5001/eu.ad5001.LogarithmPlotter diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1543f..6d48945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog +## v0.1.4 (24 Jan 2022) + + * New feature: LogarithmPlotter detects unsaved changes. + * New feature: LogarithmPlotter is now translated! See https://hosted.weblate.org/engage/logarithmplotter/ to help. + * New translation: English by Ad5001: 100% + * New translation: French by Ad5001: 100% + * New translation: German by Ad5001: 100% + * New translation: Hungarian by Óvári (@ovari on github): 100% + * New translation: Norvegian by Allan Nordhøy (@comradekingu on github): 80% + * Fixed bug: No notification when closing LogarithmPlotter with unsaved changes. + * Fixed bug: π unavailable in symbols. + + -- Ad5001 Wed, 24 Jan 2022 20:00:00 +0100 + +## v0.1.3 (18 Jan 2022) + + * Fixed bug: Confined packages (snapcraft & flatpak) won't show error messages related to update checks. + * FIxed bug: Equations of the form (x + y) / z were not being simplified properly. + + -- Ad5001 Wed, 18 Jan 2022 20:00:00 +0100 + ## v0.1.3 (18 Jan 2022) * Fixed bug: Confined packages (snapcraft & flatpak) won't show error messages related to update checks. diff --git a/LogarithmPlotter/__init__.py b/LogarithmPlotter/__init__.py index 1691f80..1f6178c 100644 --- a/LogarithmPlotter/__init__.py +++ b/LogarithmPlotter/__init__.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -17,13 +17,13 @@ """ from shutil import which -__VERSION__ = "0.1.3" -is_release = False +__VERSION__ = "0.1.4" +is_release = True # Check if development version, if so get the date of the latest git patch # and append it to the version string. -if which('git') is not None and not is_release: +if not is_release and which('git') is not None: from os.path import realpath, join, dirname, exists from subprocess import check_output from datetime import datetime diff --git a/LogarithmPlotter/__main__.py b/LogarithmPlotter/__main__.py index 0b950d2..3797f01 100644 --- a/LogarithmPlotter/__main__.py +++ b/LogarithmPlotter/__main__.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/config.py b/LogarithmPlotter/config.py index db904b7..7dec155 100644 --- a/LogarithmPlotter/config.py +++ b/LogarithmPlotter/config.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -19,12 +19,13 @@ from os import path, environ, makedirs from platform import system from json import load, dumps +from PySide2.QtCore import QLocale, QTranslator + DEFAULT_SETTINGS = { "check_for_updates": True, "reset_redo_stack": True, "last_install_greet": "0", - "lang": "en" } # Create config directory @@ -35,7 +36,10 @@ CONFIG_PATH = { }[system()] CONFIG_FILE = path.join(CONFIG_PATH, "config.json") -CONFIG = DEFAULT_SETTINGS + +initialized = False +current_config= DEFAULT_SETTINGS + def init(): """ @@ -47,13 +51,13 @@ def init(): cfg_data = load(open(CONFIG_FILE, 'r', -1, 'utf8')) for setting_name in cfg_data: setSetting(setting_name, cfg_data[setting_name]) - + def save(): """ Saves the config to the path. """ write_file = open(CONFIG_FILE, 'w', -1, 'utf8') - write_file.write(dumps(CONFIG)) + write_file.write(dumps(current_config)) write_file.close() def getSetting(namespace): @@ -63,7 +67,7 @@ def getSetting(namespace): by using the "test.foo" namespace. """ names = namespace.split(".") - setting = CONFIG + setting = current_config for name in names: if name in setting: setting = setting[name] @@ -79,7 +83,7 @@ def setSetting(namespace, data): by using the "test.foo" namespace. """ names = namespace.split(".") - setting = CONFIG + setting = current_config for name in names: if name != names[-1]: if name in setting: diff --git a/LogarithmPlotter/i18n/lp_de.ts b/LogarithmPlotter/i18n/lp_de.ts new file mode 100644 index 0000000..c385c7a --- /dev/null +++ b/LogarithmPlotter/i18n/lp_de.ts @@ -0,0 +1,682 @@ + + + + + About + + + + About LogarithmPlotter + Über LogarithmPlotter + + + + LogarithmPlotter v%1 + LogarithmPlotter v%1 + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + 2D-Grafiksoftware zur Erstellung von Bode-Diagramms, Folgen und Verteilungsfunktionen. + + + + Report a bug + Bug melden + + + + AppMenuBar + + + &File + &Datei + + + + &Load... + &Laden… + + + + &Save + &Speichern + + + + Save &As... + Speichern &Unter… + + + + &Quit + &Ausfahrt + + + + &Edit + &Bearbeiten + + + + &Undo + &Lösen + + + + &Redo + &Wiederherstellen + + + + &Copy plot + Grafik &Kopieren + + + + &Create + &Erstellen + + + + &Settings + &Einstellungen + + + + Check for updates on startup + Beim Starten auf Updates prüfen + + + + Reset redo stack automaticly + Wiederherstellen-Stapel automatisch zurücksetzen + + + + &Help + &Hilfe + + + + &Source code + &Quellcode + + + + &Report a bug + Fehler &Melden + + + + &Help translating! + &Hilfe beim Übersetzen! + + + + &About + &Übrigens + + + + Save unsaved changes? + Änderungen speichern? + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + Diese Grafik enthält ungespeicherte Änderungen. Dadurch gehen alle ungespeicherten Daten verloren. Fortfahren? + + + + EditorDialog + + + Edit properties of %1 %2 + Eigenschaften von %1 %2 bearbeiten + + + + Name + Name + + + + Label content + Etikett + + + + null + leer + + + + name + Name + + + + name + value + Name + Wert + + + + + + Create new %1 + + Neues %1objekt erstellen + + + + FileDialog + + + Export Logarithm Plot file + Logarithmusgrafik exportieren + + + + Import Logarithm Plot file + Logarithmusgrafik importieren + + + + GreetScreen + + + Welcome to LogarithmPlotter + Willkommen bei LogarithmPlotter + + + + Version %1 + Version %1 + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + Nehmen Sie sich ein paar Sekunden Zeit, um LogarithmPlotter zu konfigurieren. +Diese Einstellungen können jederzeit über das Menü "Einstellungen" geändert werden. + + + + Check for updates on startup (requires online connectivity) + Beim Start nach Updates suchen (Online-Verbindung erforderlich) + + + + Reset redo stack when a new action is added to history + Redo-Stapel zurücksetzen, wenn eine neue Aktion zur Historie hinzugefügt wird + + + + Done + Schließen + + + + HistoryBrowser + + + Redo > + Wiederherstellen > + + + + > Now + > Aktueller Stand + + + + < Undo + < Rückgängig + + + + LogarithmPlotter + + + Objects + Objekte + + + + Settings + Einstellungen + + + + History + Verlauf + + + + Saved plot to '%1'. + Gespeicherte Grafik auf '%1'. + + + + Loading file '%1'. + Laden der Datei '%1'. + + + + Unknown object type: %1. + Unbekannter Objekttyp: %1. + + + + Invalid file provided. + Ungültige Datei angegeben. + + + + Could not save file: + Die Datei konnte nicht gespeichert werden: + + + + Loaded file '%1'. + Geladene Datei '%1'. + + + + Copied plot screenshot to clipboard! + Grafik in die Zwischenablage kopiert! + + + + &Update + &Aktualisieren + + + + &Update LogarithmPlotter + LogarithmPlotter &aktualisieren + + + + ObjectCreationGrid + + + + Create new: + + Neu erstellen: + + + + ObjectLists + + + Hide all %1 + Alle %1 ausblenden + + + + Show all %1 + Alle %1 anzeigen + + + + Hide %1 %2 + Ausblenden %1 %2 + + + + Show %1 %2 + Anzeigen %1 %2 + + + + Set %1 %2 position + Position von %1 %2 einstellen + + + + Delete %1 %2 + %1 %2 löschen + + + + Pick new color for %1 %2 + Neue Farbe für %1 %2 auswählen + + + + PickLocationOverlay + + + Pointer precision: + Genauigkeit des Zeigers: + + + + Snap to grid + Am Gitter einrasten + + + + Settings + + + X Zoom + Zoom auf X + + + + Y Zoom + Zoom auf Y + + + + Min X + Minimum X + + + + Max Y + Maximum Y + + + + Max X + Maximum X + + + + Min Y + Minimum Y + + + + X Axis Step + X-Achsen-Schritt + + + + Y Axis Step + Y-Achsen-Schritt + + + + Line width + Linienbreite + + + + Text size (px) + Textgröße (px) + + + + X Label + Label der X-Achse + + + + Y Label + Label der Y-Achse + + + + X Log scale + Logarithmische Skala in X + + + + Show X graduation + X-Teilung anzeigen + + + + Show Y graduation + Y-Teilung anzeigen + + + + Copy to clipboard + Kopieren in die Zwischenablage + + + + Save plot + Grafik speichern + + + + Save plot as + Grafik speichern unter + + + + Load plot + Grafik laden + + + + function + + + Function + Funktion + + + + Functions + Funktionen + + + + gainbode + + + Bode Magnitude + Bode-Magnitude + + + + Bode Magnitudes + Bode-Magnituden + + + + low-pass + Tiefpass + + + + high-pass + Hochpass + + + + historylib + + + New %1 %2 created. + Neu %1 %2 erstellt. + + + + %1 %2 deleted. + %1 %2 gelöscht. + + + + %1 of %2 %3 changed from "%4" to "%5". + %1 von %2 %3 wurde von "%4" auf "%5" geändert. + + + + %1 %2 shown. + %1 %2 angezeigt. + + + + %1 %2 hidden. + %1 %2 ausgeblendet. + + + + parameters + + + above + ↑ Über + + + + below + ↓ Unter + + + + left + ← Links + + + + right + → Rechts + + + + above-left + ↖ Oben links + + + + above-right + ↗ Oben rechts + + + + below-left + ↙ Unten links + + + + below-right + ↘ Unten rechts + + + + phasebode + + + Bode Phase + Bode-Phase + + + + Bode Phases + Bode-Phasen + + + + point + + + Point + Punkt + + + + Points + Punkte + + + + repartition + + + Repartition + Verteilungsfunktion + + + + Repartition functions + Verteilungsfunktionen + + + + sequence + + + Sequence + Folge + + + + Sequences + Folgen + + + + sommegainsbode + + + + Bode Magnitudes Sum + Bode-Magnituden Summe + + + + sommephasesbode + + + + Bode Phases Sum + Bode-Phasen Summe + + + + text + + + Text + Text + + + + Texts + Texte + + + + update + + + An update for LogarithPlotter (v{}) is available. + Ein Aktualisierung für LogarithPlotter (v{}) ist verfügbar. + + + + No update available. + Keine Aktualisierung verfügbar. + + + + Could not fetch update information: Server error {}. + Es konnten keine Aktualisierungsinformationen abgerufen werden: Server-Fehler {}. + + + + Could not fetch update information: {}. + Es konnten keine Aktualisierungsinformationen abgerufen werden:{}. + + + + xcursor + + + X Cursor + X Zeiger + + + + X Cursors + X Zeiger + + + diff --git a/LogarithmPlotter/i18n/lp_en.ts b/LogarithmPlotter/i18n/lp_en.ts new file mode 100644 index 0000000..5e01455 --- /dev/null +++ b/LogarithmPlotter/i18n/lp_en.ts @@ -0,0 +1,682 @@ + + + + + About + + + + About LogarithmPlotter + About LogarithmPlotter + + + + LogarithmPlotter v%1 + LogarithmPlotter v%1 + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + 2D plotter software to make Bode plots, sequences and distribution functions. + + + + Report a bug + Report a bug + + + + AppMenuBar + + + &File + &File + + + + &Load... + &Load… + + + + &Save + &Save + + + + Save &As... + Save &As… + + + + &Quit + &Quit + + + + &Edit + &Edit + + + + &Undo + &Undo + + + + &Redo + &Redo + + + + &Copy plot + &Copy plot + + + + &Create + &Create + + + + &Settings + &Settings + + + + Check for updates on startup + Check for updates on startup + + + + Reset redo stack automaticly + Reset redo stack automatically + + + + &Help + &Help + + + + &Source code + &Source code + + + + &Report a bug + &Report a bug + + + + &Help translating! + &Help translating! + + + + &About + &About + + + + Save unsaved changes? + Save unsaved changes? + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + + + + EditorDialog + + + Edit properties of %1 %2 + Edit properties of %1 %2 + + + + Name + Name + + + + Label content + Label content + + + + null + null + + + + name + name + + + + name + value + name + value + + + + + + Create new %1 + + Create new %1 + + + + FileDialog + + + Export Logarithm Plot file + Export Logarithm Plot file + + + + Import Logarithm Plot file + Import Logarithm Plot file + + + + GreetScreen + + + Welcome to LogarithmPlotter + Welcome to LogarithmPlotter + + + + Version %1 + Version %1 + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + + + + Check for updates on startup (requires online connectivity) + Check for updates on startup (requires online connectivity) + + + + Reset redo stack when a new action is added to history + Reset redo stack when a new action is added to history + + + + Done + Done + + + + HistoryBrowser + + + Redo > + Redo > + + + + > Now + > Now + + + + < Undo + < Undo + + + + LogarithmPlotter + + + Objects + Objects + + + + Settings + Settings + + + + History + History + + + + Saved plot to '%1'. + Saved plot to '%1'. + + + + Loading file '%1'. + Loading file '%1'. + + + + Unknown object type: %1. + Unknown object type: %1. + + + + Invalid file provided. + Invalid file provided. + + + + Could not save file: + Could not save file: + + + + Loaded file '%1'. + Loaded file '%1'. + + + + Copied plot screenshot to clipboard! + Copied plot screenshot to clipboard! + + + + &Update + &Update + + + + &Update LogarithmPlotter + &Update LogarithmPlotter + + + + ObjectCreationGrid + + + + Create new: + + Create new: + + + + ObjectLists + + + Hide all %1 + Hide all %1 + + + + Show all %1 + Show all %1 + + + + Hide %1 %2 + Hide %1 %2 + + + + Show %1 %2 + Show %1 %2 + + + + Set %1 %2 position + Set %1 %2 position + + + + Delete %1 %2 + Delete %1 %2 + + + + Pick new color for %1 %2 + Pick new color for %1 %2 + + + + PickLocationOverlay + + + Pointer precision: + Pointer precision: + + + + Snap to grid + Snap to grid + + + + Settings + + + X Zoom + X Zoom + + + + Y Zoom + Y Zoom + + + + Min X + Min X + + + + Max Y + Max Y + + + + Max X + Max X + + + + Min Y + Min Y + + + + X Axis Step + X Axis Step + + + + Y Axis Step + Y Axis Step + + + + Line width + Line width + + + + Text size (px) + Text size (px) + + + + X Label + X Label + + + + Y Label + Y Label + + + + X Log scale + X Log scale + + + + Show X graduation + Show X graduation + + + + Show Y graduation + Show Y graduation + + + + Copy to clipboard + Copy to clipboard + + + + Save plot + Save plot + + + + Save plot as + Save plot as + + + + Load plot + Load plot + + + + function + + + Function + Function + + + + Functions + Functions + + + + gainbode + + + Bode Magnitude + Bode Magnitude + + + + Bode Magnitudes + Bode Magnitudes + + + + low-pass + low-pass + + + + high-pass + high-pass + + + + historylib + + + New %1 %2 created. + New %1 %2 created. + + + + %1 %2 deleted. + %1 %2 deleted. + + + + %1 of %2 %3 changed from "%4" to "%5". + %1 of %2 %3 changed from "%4" to "%5". + + + + %1 %2 shown. + %1 %2 shown. + + + + %1 %2 hidden. + %1 %2 hidden. + + + + parameters + + + above + ↑ Above + + + + below + ↓ Below + + + + left + ← Left + + + + right + → Right + + + + above-left + ↖ Above left + + + + above-right + ↗ Above right + + + + below-left + ↙ Below left + + + + below-right + ↘ Below right + + + + phasebode + + + Bode Phase + Bode Phase + + + + Bode Phases + Bode Phases + + + + point + + + Point + Point + + + + Points + Points + + + + repartition + + + Repartition + Distribution + + + + Repartition functions + Distribution functions + + + + sequence + + + Sequence + Sequence + + + + Sequences + Sequences + + + + sommegainsbode + + + + Bode Magnitudes Sum + Bode Magnitudes Sum + + + + sommephasesbode + + + + Bode Phases Sum + Bode Phases Sum + + + + text + + + Text + Text + + + + Texts + Texts + + + + update + + + An update for LogarithPlotter (v{}) is available. + An update for LogarithPlotter (v{}) is available. + + + + No update available. + No update available. + + + + Could not fetch update information: Server error {}. + Could not fetch update information: Server error {}. + + + + Could not fetch update information: {}. + Could not fetch update information: {}. + + + + xcursor + + + X Cursor + X Cursor + + + + X Cursors + X Cursors + + + diff --git a/LogarithmPlotter/i18n/lp_es.ts b/LogarithmPlotter/i18n/lp_es.ts new file mode 100644 index 0000000..3c31b1b --- /dev/null +++ b/LogarithmPlotter/i18n/lp_es.ts @@ -0,0 +1,681 @@ + + + + + About + + + + About LogarithmPlotter + + + + + LogarithmPlotter v%1 + + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + + + + + Report a bug + + + + + AppMenuBar + + + &File + + + + + &Load... + + + + + &Save + + + + + Save &As... + + + + + &Quit + + + + + &Edit + + + + + &Undo + + + + + &Redo + + + + + &Copy plot + + + + + &Create + + + + + &Settings + + + + + Check for updates on startup + + + + + Reset redo stack automaticly + + + + + &Help + + + + + &Source code + + + + + &Report a bug + + + + + &Help translating! + + + + + &About + + + + + Save unsaved changes? + + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + + + + + EditorDialog + + + Edit properties of %1 %2 + + + + + Name + + + + + Label content + + + + + null + + + + + name + + + + + name + value + + + + + + + Create new %1 + + + + + FileDialog + + + Export Logarithm Plot file + + + + + Import Logarithm Plot file + + + + + GreetScreen + + + Welcome to LogarithmPlotter + + + + + Version %1 + + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + + + + + Check for updates on startup (requires online connectivity) + + + + + Reset redo stack when a new action is added to history + + + + + Done + + + + + HistoryBrowser + + + Redo > + + + + + > Now + + + + + < Undo + + + + + LogarithmPlotter + + + Objects + + + + + Settings + + + + + History + + + + + Saved plot to '%1'. + + + + + Loading file '%1'. + + + + + Unknown object type: %1. + + + + + Invalid file provided. + + + + + Could not save file: + + + + + Loaded file '%1'. + + + + + Copied plot screenshot to clipboard! + + + + + &Update + + + + + &Update LogarithmPlotter + + + + + ObjectCreationGrid + + + + Create new: + + + + + ObjectLists + + + Hide all %1 + + + + + Show all %1 + + + + + Hide %1 %2 + + + + + Show %1 %2 + + + + + Set %1 %2 position + + + + + Delete %1 %2 + + + + + Pick new color for %1 %2 + + + + + PickLocationOverlay + + + Pointer precision: + + + + + Snap to grid + + + + + Settings + + + X Zoom + + + + + Y Zoom + + + + + Min X + + + + + Max Y + + + + + Max X + + + + + Min Y + + + + + X Axis Step + + + + + Y Axis Step + + + + + Line width + + + + + Text size (px) + + + + + X Label + + + + + Y Label + + + + + X Log scale + + + + + Show X graduation + + + + + Show Y graduation + + + + + Copy to clipboard + + + + + Save plot + + + + + Save plot as + + + + + Load plot + + + + + function + + + Function + + + + + Functions + + + + + gainbode + + + Bode Magnitude + + + + + Bode Magnitudes + + + + + low-pass + + + + + high-pass + + + + + historylib + + + New %1 %2 created. + + + + + %1 %2 deleted. + + + + + %1 of %2 %3 changed from "%4" to "%5". + + + + + %1 %2 shown. + + + + + %1 %2 hidden. + + + + + parameters + + + above + + + + + below + + + + + left + + + + + right + + + + + above-left + + + + + above-right + + + + + below-left + + + + + below-right + + + + + phasebode + + + Bode Phase + + + + + Bode Phases + + + + + point + + + Point + + + + + Points + + + + + repartition + + + Repartition + + + + + Repartition functions + + + + + sequence + + + Sequence + + + + + Sequences + + + + + sommegainsbode + + + + Bode Magnitudes Sum + + + + + sommephasesbode + + + + Bode Phases Sum + + + + + text + + + Text + + + + + Texts + + + + + update + + + An update for LogarithPlotter (v{}) is available. + + + + + No update available. + + + + + Could not fetch update information: Server error {}. + + + + + Could not fetch update information: {}. + + + + + xcursor + + + X Cursor + + + + + X Cursors + + + + diff --git a/LogarithmPlotter/i18n/lp_fr.ts b/LogarithmPlotter/i18n/lp_fr.ts new file mode 100644 index 0000000..e6c9ada --- /dev/null +++ b/LogarithmPlotter/i18n/lp_fr.ts @@ -0,0 +1,690 @@ + + + + + About + + + + About LogarithmPlotter + À propos de LogarithmPlotter + + + + LogarithmPlotter v%1 + LogarithmPlotter v%1 + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + Logiciel de traçage 2D pour les diagrammes de Bode, les suites et les fonctions de répartition. + + + + Report a bug + Rapport de bug + + + + AppMenuBar + + + &File + &Fichier + + + + &Load... + &Ouvrir… + + + + &Save + &Sauvegarder + + + + Save &As... + Sauvegarde &Sous… + + + + &Quit + &Quitter + + + + &Edit + &Édition + + + + &Undo + &Annuler + + + + &Redo + &Rétablir + + + + &Copy plot + &Copier le graphe + + + + &Create + &Créer + + + + &Settings + &Paramètres + + + + Check for updates on startup + Vérifier la présence de mise à jour au démarrage + + + + Reset redo stack automaticly + Légèrement long, et pas forcément très compréhensible. + Réinitialiser la pile d'action "Rétablir" automatiquement + + + + &Help + &Aide + + + + &Source code + &Code source + + + + &Report a bug + Rapport de bug + + + + &Help translating! + &Aider à la traduction ! + + + + &About + &À propos + + + + Save unsaved changes? + Sauvegarder les modifications ? + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + Ce graphe contient des modifications non sauvegardées. En faisant cela, toutes les données non sauvegardées seront perdues. Continuer ? + + + + EditorDialog + + + Edit properties of %1 %2 + Changer les propriétés de %1 %2 + + + + Name + Nom + + + + Label content + Étiquette + + + + null + vide + + + + name + nom + + + + name + value + nom + valeur + + + + + + Create new %1 + Traduction non litéralle pour éviter les problèmes de genre. + + Créer un nouvel objet %1 + + + + FileDialog + + + Export Logarithm Plot file + Exporter le graphe Logarithmique + + + + Import Logarithm Plot file + Importer un graphe Logarithmique + + + + GreetScreen + + + Welcome to LogarithmPlotter + Bienvenue sur LogarithmPlotter + + + + Version %1 + Version %1 + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + Prenez quelques secondes pour configurer LogarithmPlotter. +Ces paramètres peuvent être modifiés à tout moment à partir du menu "Paramètres". + + + + Done + Fermer + + + Take a few seconds to configure LogarithmPlotter. +These settings can always be changed at any time from the "Settings" menu. + Take a few seconds to configure LogarithmPlotter. +These settings can always be changed at any time from the "Settings" menu. + + + + Check for updates on startup (requires online connectivity) + Vérifier les mises à jour au démarrage (nécessite d'être connecté à internet) + + + + Reset redo stack when a new action is added to history + Réinitialiser la pile d'action "Rétablir" lorsqu'une nouvelle action est ajoutée à l'historique + + + + HistoryBrowser + + + Redo > + Rétablir > + + + + > Now + > État actuel + + + + < Undo + < Annuler + + + + LogarithmPlotter + + + Objects + Objets + + + + Settings + Paramètres + + + + History + Historique + + + + Saved plot to '%1'. + Graphe sauvegardé dans '%1'. + + + + Loading file '%1'. + Chargement du fichier '%1'. + + + + Unknown object type: %1. + Type d'objet inconnu : %1. + + + + Invalid file provided. + Fichier fourni invalide. + + + + Could not save file: + Impossible de sauvegarder le fichier : + + + + Loaded file '%1'. + Fichier '%1' chargé. + + + + Copied plot screenshot to clipboard! + Image du graphe copiée dans le presse-papiers ! + + + + &Update + &Mise à jour + + + + &Update LogarithmPlotter + &Mettre à jour LogarithmPlotter + + + + ObjectCreationGrid + + + + Create new: + + Créer : + + + + ObjectLists + + + Hide all %1 + Cacher tous les %1 + + + + Show all %1 + Montrer tous les %1 + + + + Hide %1 %2 + Cacher l'objet %1 %2 + + + + Show %1 %2 + Montrer l'objet %1 %2 + + + + Set %1 %2 position + Définir la position de l'objet %1 %2 + + + + Delete %1 %2 + Supprimer l'objet %1 %2 + + + + Pick new color for %1 %2 + Choisissez une nouvelle couleur pour %1 %2 + + + + PickLocationOverlay + + + Pointer precision: + Précision du pointeur : + + + + Snap to grid + Placement sur la grille + + + + Settings + + + X Zoom + Zoom en X + + + + Y Zoom + Zoom en Y + + + + Min X + Min X + + + + Max Y + Max Y + + + + Max X + Max X + + + + Min Y + Min Y + + + + X Axis Step + Pas de l'axe X + + + + Y Axis Step + Pas de l'axe Y + + + + Line width + Taille des lignes + + + + Text size (px) + Taille du texte (px) + + + + X Label + Label de l'axe X + + + + Y Label + Label de l'axe Y + + + + X Log scale + Échelle logarithmique en X + + + + Show X graduation + Montrer la graduation de l'axe X + + + + Show Y graduation + Montrer la graduation de l'axe Y + + + + Copy to clipboard + Copier vers le presse-papiers + + + + Save plot + Sauvegarder le graphe + + + + Save plot as + Sauvegarder le graphe sous + + + + Load plot + Charger un graphe + + + + function + + + Function + Fonction + + + + Functions + Fonctions + + + + gainbode + + + Bode Magnitude + Gain de Bode + + + + Bode Magnitudes + Gains de Bode + + + + low-pass + passe-bas + + + + high-pass + passe-haut + + + + historylib + + + New %1 %2 created. + Nouveau %1 %2 créé(e). + + + + %1 %2 deleted. + %1 %2 supprimé(e). + + + + %1 of %2 %3 changed from "%4" to "%5". + %1 de %2 %3 modifiée de "%4" à "%5". + + + + %1 %2 shown. + %1 %2 affiché(e). + + + + %1 %2 hidden. + %1 %2 cachée(e). + + + + parameters + + + above + ↑ Au dessus + + + + below + ↓ En dessous + + + + left + ← À gauche + + + + right + → À droite + + + + above-left + ↖ Au dessus à gauche + + + + above-right + ↗ Au dessus à droite + + + + below-left + ↙ En dessous à gauche + + + + below-right + ↘ En dessous à droite + + + + phasebode + + + Bode Phase + Phase de Bode + + + + Bode Phases + Phases de Bode + + + + point + + + Point + Point + + + + Points + Points + + + + repartition + + + Repartition + Répartition + + + + Repartition functions + Fonctions de répartition + + + + sequence + + + Sequence + Suite + + + + Sequences + Suites + + + + sommegainsbode + + + + Bode Magnitudes Sum + Sommes des gains de Bode + + + + sommephasesbode + + + + Bode Phases Sum + Somme des phases de Bode + + + + text + + + Text + Texte + + + + Texts + Textes + + + + update + + + An update for LogarithPlotter (v{}) is available. + Une mise à jour de LogarithmPlotter (v{}) est disponible. + + + + No update available. + À jour. + + + + Could not fetch update information: Server error {}. + Impossible de récupérer les informations de mise à jour. Erreur du serveur {}. + + + + Could not fetch update information: {}. + Impossible de récupérer les informations de mise à jour. {}. + + + + xcursor + + + X Cursor + Curseur X + + + + X Cursors + Curseurs X + + + diff --git a/LogarithmPlotter/i18n/lp_hu.ts b/LogarithmPlotter/i18n/lp_hu.ts new file mode 100644 index 0000000..3ba62fa --- /dev/null +++ b/LogarithmPlotter/i18n/lp_hu.ts @@ -0,0 +1,682 @@ + + + + + About + + + + About LogarithmPlotter + LogarithmPlotter névjegye + + + + LogarithmPlotter v%1 + LogarithmPlotter %1 verzió + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + Síkbeli ábrázolásszoftver Bode-ábrák, sorozatok és eloszlási funkciók készítéséhez. + + + + Report a bug + Hiba bejelentése + + + + AppMenuBar + + + &File + &Fájl + + + + &Load... + &Betöltés… + + + + &Save + &Mentés + + + + Save &As... + Me&ntés másként… + + + + &Quit + &Kilépés + + + + &Edit + S&zerkesztés + + + + &Undo + &Visszavonás + + + + &Redo + &Ismétlés + + + + &Copy plot + Ábra má&solása + + + + &Create + &Létrehozás + + + + &Settings + &Beállítások + + + + Check for updates on startup + Frissítések keresése indításkor + + + + Reset redo stack automaticly + Ismétlési verem önműködő visszaállítása + + + + &Help + &Súgó + + + + &Source code + &Forráskód + + + + &Report a bug + &Hiba bejelentése + + + + &Help translating! + &Segítség a fordításban! + + + + &About + &Névjegy + + + + Save unsaved changes? + Menti a változtatásokat? + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + Ez az ábra nem mentett változtatásokat tartalmaz. Ezzel az összes nem mentett adat elveszik. Folytatja? + + + + EditorDialog + + + Edit properties of %1 %2 + %1 %2 tulajdonságainak szerkesztése + + + + Name + Név + + + + Label content + Címke tartalom + + + + null + üres + + + + name + név + + + + name + value + név + érték + + + + + + Create new %1 + + Új %1 létrehozása + + + + FileDialog + + + Export Logarithm Plot file + Logaritmus-ábra-fájl exportálása + + + + Import Logarithm Plot file + Logaritmus-ábra-fájl importálása + + + + GreetScreen + + + Welcome to LogarithmPlotter + Isten hozott a LogarithmPlotter! + + + + Version %1 + %1 verzió + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + Szánjon néhány másodpercet a LogarithmPlotter beállításához. +Ezek a beállítások bármikor módosíthatók a „Beállítások” menüben. + + + + Check for updates on startup (requires online connectivity) + Frissítések keresése indításkor (online kapcsolat szükséges) + + + + Reset redo stack when a new action is added to history + Ismétlési verem alaphelyzet visszaállítása, ha új műveletet adnak az előzményekhez + + + + Done + Kész + + + + HistoryBrowser + + + Redo > + Ismétlés > + + + + > Now + > Most + + + + < Undo + < Visszavonás + + + + LogarithmPlotter + + + Objects + Tárgyak + + + + Settings + Beállítások + + + + History + Előzmények + + + + Saved plot to '%1'. + Ábra mentve ide: „%1”. + + + + Loading file '%1'. + A(z) „%1” fájl betöltése folyamatban van. + + + + Unknown object type: %1. + Ismeretlen objektumtípus: %1. + + + + Invalid file provided. + A megadott fájl érvénytelen. + + + + Could not save file: + A fájl mentése nem sikerült: + + + + Loaded file '%1'. + A(z) „%1” fájl betöltve. + + + + Copied plot screenshot to clipboard! + Ábra képernyőkép vágólapra másolva! + + + + &Update + &Frissítés + + + + &Update LogarithmPlotter + A LogarithmPlotter &frissítése + + + + ObjectCreationGrid + + + + Create new: + + Új létrehozása: + + + + ObjectLists + + + Hide all %1 + Összes %1 elrejtése + + + + Show all %1 + Összes %1 megjelenítése + + + + Hide %1 %2 + %1 %2 elrejtése + + + + Show %1 %2 + %1 %2 megjelenítése + + + + Set %1 %2 position + %1 %2 helye beállítása + + + + Delete %1 %2 + %1 %2 törlése + + + + Pick new color for %1 %2 + Válasszon új színt a következőhöz: %1 %2 + + + + PickLocationOverlay + + + Pointer precision: + Mutató pontossága: + + + + Snap to grid + Rácshoz illesztés + + + + Settings + + + X Zoom + X-nagyítás + + + + Y Zoom + Y-nagyítás + + + + Min X + Legkisebb X + + + + Max Y + Legnagyobb Y + + + + Max X + Legnagyobb X + + + + Min Y + Legkisebb Y + + + + X Axis Step + X tengely lépésköze + + + + Y Axis Step + Y tengely lépésköze + + + + Line width + Vonalvastagság + + + + Text size (px) + Szövegméret (képpont) + + + + X Label + X címke + + + + Y Label + Y címke + + + + X Log scale + X tengely logaritmikus skálával + + + + Show X graduation + X érettségi megjelenítése + + + + Show Y graduation + Y érettségi megjelenítése + + + + Copy to clipboard + Másolás a vágólapra + + + + Save plot + Ábra mentése + + + + Save plot as + Ábra mentése másként + + + + Load plot + Ábra betöltése + + + + function + + + Function + Függvény + + + + Functions + Függvények + + + + gainbode + + + Bode Magnitude + Bode-nagyságrend + + + + Bode Magnitudes + Bode-nagyságrendek + + + + low-pass + aluláteresztő + + + + high-pass + felüláteresztő + + + + historylib + + + New %1 %2 created. + Új %1 %2 létrehozva. + + + + %1 %2 deleted. + %1 %2 törölve. + + + + %1 of %2 %3 changed from "%4" to "%5". + %1/%2 %3 megváltozott. Régi érték: %4, új érték: %5. + + + + %1 %2 shown. + %1 %2 megjelenítve. + + + + %1 %2 hidden. + %1 %2 rejtve. + + + + parameters + + + above + ↑ Felett + + + + below + ↓ Alatt + + + + left + ← Balra + + + + right + → Jobbra + + + + above-left + ↖ Felett, balra + + + + above-right + ↗ Felett, jobbra + + + + below-left + ↙ Alatt, balra + + + + below-right + ↘ Alatt, jobbra + + + + phasebode + + + Bode Phase + Bode-fázis + + + + Bode Phases + Bode-fázisok + + + + point + + + Point + Pont + + + + Points + Pontok + + + + repartition + + + Repartition + Elosztás + + + + Repartition functions + Elosztási függvények + + + + sequence + + + Sequence + Sorozat + + + + Sequences + Sorozatok + + + + sommegainsbode + + + + Bode Magnitudes Sum + Bode-nagyságrendek összege + + + + sommephasesbode + + + + Bode Phases Sum + Bode-fázisok összege + + + + text + + + Text + Szöveg + + + + Texts + Szövegek + + + + update + + + An update for LogarithPlotter (v{}) is available. + Elérhető a Logaritmus-ábrázoló ({} verzió) frissítése. + + + + No update available. + Nincs telepíthető frissítés. + + + + Could not fetch update information: Server error {}. + Nem sikerült lekérni a frissítési adatokat: Kiszolgálóhiba: {}. + + + + Could not fetch update information: {}. + Nem sikerült lekérni a frissítési adatokat: {}. + + + + xcursor + + + X Cursor + X kurzor + + + + X Cursors + X kurzorok + + + diff --git a/LogarithmPlotter/i18n/lp_nb_NO.ts b/LogarithmPlotter/i18n/lp_nb_NO.ts new file mode 100644 index 0000000..6f7eb19 --- /dev/null +++ b/LogarithmPlotter/i18n/lp_nb_NO.ts @@ -0,0 +1,682 @@ + + + + + About + + + + About LogarithmPlotter + Om + + + + LogarithmPlotter v%1 + LogarithmPlotter v%1 + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + 2D-plotterprogramvare laget for opprettelse av Bode-diagram, sekvenser, og distribusjonsfunksjoner. + + + + Report a bug + Rapporter en feil + + + + AppMenuBar + + + &File + &Fil + + + + &Load... + &Last inn … + + + + &Save + &Lagre + + + + Save &As... + Lagre &som … + + + + &Quit + &Avslutt + + + + &Edit + &Rediger + + + + &Undo + &Angre + + + + &Redo + &Gjenta + + + + &Copy plot + &Kopier plott + + + + &Create + &Opprett + + + + &Settings + &Innstillinger + + + + Check for updates on startup + Se etter nye versjoner ved programstart + + + + Reset redo stack automaticly + Tilbakestill angrehistorikk automatisk + + + + &Help + &Hjelp + + + + &Source code + + + + + &Report a bug + + + + + &Help translating! + + + + + &About + &Om + + + + Save unsaved changes? + + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + + + + + EditorDialog + + + Edit properties of %1 %2 + Rediger egenskaper for %1 %2 + + + + Name + Navn + + + + Label content + Etikett-innhold + + + + null + NULL + + + + name + navn + + + + name + value + navn + veri + + + + + + Create new %1 + + Opprett nytt %1 + + + + FileDialog + + + Export Logarithm Plot file + Eksporter logaritmeplott-fil + + + + Import Logarithm Plot file + Importer logaritmeplott-fil + + + + GreetScreen + + + Welcome to LogarithmPlotter + Velkommen til LogarithmPlotter + + + + Version %1 + Versjon %1 + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + Sett opp LogarithmPlotter. +Disse innstillingene kan endres når som helst fra «Innstillinger»-menyen. + + + + Check for updates on startup (requires online connectivity) + Se etter nye versjoner ved programstart. (Krever tilkobling til Internett.) + + + + Reset redo stack when a new action is added to history + Tilbakesitll angrehistorikk når en ny handling legges til + + + + Done + + + + + HistoryBrowser + + + Redo > + Angre > + + + + > Now + > Nå + + + + < Undo + < Angre + + + + LogarithmPlotter + + + Objects + Objekter + + + + Settings + Innstillinger + + + + History + Historikk + + + + Saved plot to '%1'. + Lagret plott i «%1». + + + + Loading file '%1'. + Laster inn «%1»-fil. + + + + Unknown object type: %1. + Ukjent objekttype: %1. + + + + Invalid file provided. + Ugyldig fil angitt. + + + + Could not save file: + Kunne ikke lagre fil: + + + + Loaded file '%1'. + Lastet inn filen «%1». + + + + Copied plot screenshot to clipboard! + Kopierte plott-skjermavbildning til utklippstavlen! + + + + &Update + &Oppdater + + + + &Update LogarithmPlotter + &Installer ny versjon av LogartimePlotter + + + + ObjectCreationGrid + + + + Create new: + + Opprett ny: + + + + ObjectLists + + + Hide all %1 + Skjul alle %1 + + + + Show all %1 + Vis alle %1 + + + + Hide %1 %2 + Skjul %1 %2 + + + + Show %1 %2 + Vis %1 %2 + + + + Set %1 %2 position + Sett %1 %2 posisjon + + + + Delete %1 %2 + Slett %1 %2 + + + + Pick new color for %1 %2 + Velg ny farge for %1 %2 + + + + PickLocationOverlay + + + Pointer precision: + Peker-presisjon: + + + + Snap to grid + Fest til rutenett + + + + Settings + + + X Zoom + X-forstørrelse + + + + Y Zoom + Y-forstørrelse + + + + Min X + Min. X + + + + Max Y + Maks. Y + + + + Max X + Maks. X + + + + Min Y + Min. Y + + + + X Axis Step + X-aksesteg + + + + Y Axis Step + Y-aksesteg + + + + Line width + Linjebredde + + + + Text size (px) + Tekststørrelse (piksler) + + + + X Label + Navn på X-akse + + + + Y Label + Navn på Y-akse + + + + X Log scale + Logaritmisk skala i x + + + + Show X graduation + Vis X-inndeling + + + + Show Y graduation + Vis Y-inndeling + + + + Copy to clipboard + Kopier til utklippstavle + + + + Save plot + Lagre plott + + + + Save plot as + Lagre plott som + + + + Load plot + Last inn plott + + + + function + + + Function + Funksjon + + + + Functions + Funksjoner + + + + gainbode + + + Bode Magnitude + Bode-magnitude + + + + Bode Magnitudes + Bode-magnituder + + + + low-pass + lavpass + + + + high-pass + høypass + + + + historylib + + + New %1 %2 created. + Ny %1 %2 opprettet. + + + + %1 %2 deleted. + %1 %2 slettet. + + + + %1 of %2 %3 changed from "%4" to "%5". + %1 av %2 %3 endret fra «%4» til «%5». + + + + %1 %2 shown. + %1 %2 vist. + + + + %1 %2 hidden. + %1 %2 skjult. + + + + parameters + + + above + + + + + below + + + + + left + + + + + right + + + + + above-left + + + + + above-right + + + + + below-left + + + + + below-right + + + + + phasebode + + + Bode Phase + Bode-fase + + + + Bode Phases + Bode-faser + + + + point + + + Point + Punkt + + + + Points + Punkter + + + + repartition + + + Repartition + Distribusjon + + + + Repartition functions + Distribusjonsfunksjoner + + + + sequence + + + Sequence + Følge + + + + Sequences + Følger + + + + sommegainsbode + + + + Bode Magnitudes Sum + Bode-magnitudesum + + + + sommephasesbode + + + + Bode Phases Sum + Bode-fasesum + + + + text + + + Text + Tekst + + + + Texts + Tekster + + + + update + + + An update for LogarithPlotter (v{}) is available. + En ny versjon av LogartimePlotter (v{}) er tilgjengelig + + + + No update available. + Ingen nye versjoner. + + + + Could not fetch update information: Server error {}. + Fant ikke ut om det er noen nye versjoner. Tjenerfeil {}. + + + + Could not fetch update information: {}. + Kunne ikke hente info om hvorvidt det er nye versjoner: {}. + + + + xcursor + + + X Cursor + X-peker + + + + X Cursors + X-pekere + + + diff --git a/LogarithmPlotter/i18n/lp_template.ts b/LogarithmPlotter/i18n/lp_template.ts new file mode 100644 index 0000000..689d033 --- /dev/null +++ b/LogarithmPlotter/i18n/lp_template.ts @@ -0,0 +1,681 @@ + + + + + About + + + + About LogarithmPlotter + + + + + LogarithmPlotter v%1 + + + + + 2D plotter software to make BODE plots, sequences and repartition functions. + + + + + Report a bug + + + + + AppMenuBar + + + &File + + + + + &Load... + + + + + &Save + + + + + Save &As... + + + + + &Quit + + + + + &Edit + + + + + &Undo + + + + + &Redo + + + + + &Copy plot + + + + + &Create + + + + + &Settings + + + + + Check for updates on startup + + + + + Reset redo stack automaticly + + + + + &Help + + + + + &Source code + + + + + &Report a bug + + + + + &Help translating! + + + + + &About + + + + + Save unsaved changes? + + + + + This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue? + + + + + EditorDialog + + + Edit properties of %1 %2 + + + + + Name + + + + + Label content + + + + + null + + + + + name + + + + + name + value + + + + + + + Create new %1 + + + + + FileDialog + + + Export Logarithm Plot file + + + + + Import Logarithm Plot file + + + + + GreetScreen + + + Welcome to LogarithmPlotter + + + + + Version %1 + + + + + Take a few seconds to configure LogarithmPlotter. +These settings can be changed at any time from the "Settings" menu. + + + + + Check for updates on startup (requires online connectivity) + + + + + Reset redo stack when a new action is added to history + + + + + Done + + + + + HistoryBrowser + + + Redo > + + + + + > Now + + + + + < Undo + + + + + LogarithmPlotter + + + Objects + + + + + Settings + + + + + History + + + + + Saved plot to '%1'. + + + + + Loading file '%1'. + + + + + Unknown object type: %1. + + + + + Invalid file provided. + + + + + Could not save file: + + + + + Loaded file '%1'. + + + + + Copied plot screenshot to clipboard! + + + + + &Update + + + + + &Update LogarithmPlotter + + + + + ObjectCreationGrid + + + + Create new: + + + + + ObjectLists + + + Hide all %1 + + + + + Show all %1 + + + + + Hide %1 %2 + + + + + Show %1 %2 + + + + + Set %1 %2 position + + + + + Delete %1 %2 + + + + + Pick new color for %1 %2 + + + + + PickLocationOverlay + + + Pointer precision: + + + + + Snap to grid + + + + + Settings + + + X Zoom + + + + + Y Zoom + + + + + Min X + + + + + Max Y + + + + + Max X + + + + + Min Y + + + + + X Axis Step + + + + + Y Axis Step + + + + + Line width + + + + + Text size (px) + + + + + X Label + + + + + Y Label + + + + + X Log scale + + + + + Show X graduation + + + + + Show Y graduation + + + + + Copy to clipboard + + + + + Save plot + + + + + Save plot as + + + + + Load plot + + + + + function + + + Function + + + + + Functions + + + + + gainbode + + + Bode Magnitude + + + + + Bode Magnitudes + + + + + low-pass + + + + + high-pass + + + + + historylib + + + New %1 %2 created. + + + + + %1 %2 deleted. + + + + + %1 of %2 %3 changed from "%4" to "%5". + + + + + %1 %2 shown. + + + + + %1 %2 hidden. + + + + + parameters + + + above + + + + + below + + + + + left + + + + + right + + + + + above-left + + + + + above-right + + + + + below-left + + + + + below-right + + + + + phasebode + + + Bode Phase + + + + + Bode Phases + + + + + point + + + Point + + + + + Points + + + + + repartition + + + Repartition + + + + + Repartition functions + + + + + sequence + + + Sequence + + + + + Sequences + + + + + sommegainsbode + + + + Bode Magnitudes Sum + + + + + sommephasesbode + + + + Bode Phases Sum + + + + + text + + + Text + + + + + Texts + + + + + update + + + An update for LogarithPlotter (v{}) is available. + + + + + No update available. + + + + + Could not fetch update information: Server error {}. + + + + + Could not fetch update information: {}. + + + + + xcursor + + + X Cursor + + + + + X Cursors + + + + diff --git a/LogarithmPlotter/i18n/release.sh b/LogarithmPlotter/i18n/release.sh new file mode 100755 index 0000000..93475b5 --- /dev/null +++ b/LogarithmPlotter/i18n/release.sh @@ -0,0 +1,2 @@ +#!/bin/bash +lrelease *.ts diff --git a/LogarithmPlotter/i18n/update.sh b/LogarithmPlotter/i18n/update.sh new file mode 100755 index 0000000..aa48415 --- /dev/null +++ b/LogarithmPlotter/i18n/update.sh @@ -0,0 +1,2 @@ +#!/bin/bash +lupdate -extensions js,qs,qml,py -recursive .. -ts lp_*.ts diff --git a/LogarithmPlotter/logarithmplotter.py b/LogarithmPlotter/logarithmplotter.py index 2b105b8..bdb09e6 100644 --- a/LogarithmPlotter/logarithmplotter.py +++ b/LogarithmPlotter/logarithmplotter.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -22,7 +22,7 @@ start_time = time() from PySide2.QtWidgets import QApplication, QFileDialog from PySide2.QtQml import QQmlApplicationEngine, qmlRegisterType -from PySide2.QtCore import Qt, QObject, Signal, Slot, Property +from PySide2.QtCore import Qt, QObject, Signal, Slot, Property, QTranslator, QLocale, QCoreApplication from PySide2.QtGui import QIcon, QImage, QKeySequence from PySide2 import __version__ as PySide2_version @@ -46,8 +46,8 @@ if path.realpath(path.join(getcwd(), "..")) not in sys_path: from LogarithmPlotter import config, native, __VERSION__ from LogarithmPlotter.update import check_for_updates -config.init() +config.init() def get_linux_theme(): des = { @@ -63,6 +63,10 @@ def get_linux_theme(): return "Material" class Helper(QObject): + + def __init__(self, engine: QQmlApplicationEngine): + QObject.__init__(self) + self.engine = engine; @Slot(str, str) def write(self, filename, filedata): @@ -80,6 +84,7 @@ class Helper(QObject): def load(self, filename): chdir(pwd) data = '{}' + from PySide2.QtWidgets import QMessageBox if path.exists(path.realpath(filename)): f = open(path.realpath(filename), 'r', -1, 'utf8') data = f.read() @@ -93,13 +98,12 @@ class Helper(QObject): else: raise Exception("Invalid LogarithmPlotter file.") except Exception as e: # If file can't be loaded - from PySide2.QtWidgets import QMessageBox - QMessageBox.warning(None, 'LogarithmPlotter', 'Could not open file "{}":\n{}'.format(filename, e), QMessageBox.Ok) # Cannot parse file + QMessageBox.warning(None, 'LogarithmPlotter', QCoreApplication.translate('main','Could not open file "{}":\n{}').format(filename, e), QMessageBox.Ok) # Cannot parse file else: - QMessageBox.warning(None, 'LogarithmPlotter', 'Could not open file: "{}"\nFile does not exist.'.format(filename), QMessageBox.Ok) # Cannot parse file + QMessageBox.warning(None, 'LogarithmPlotter', QCoreApplication.translate('main','Could not open file: "{}"\nFile does not exist.').format(filename), QMessageBox.Ok) # Cannot parse file chdir(path.dirname(path.realpath(__file__))) return data - + @Slot(result=str) def gettmpfile(self): global tmpfile @@ -131,12 +135,16 @@ class Helper(QObject): def setSettingBool(self, namespace, value): return config.setSetting(namespace, value) + @Slot(str) + def setLanguage(self, new_lang): + config.setSetting("language", new_lang) + @Slot(result=str) def getDebugInfos(self): """ Returns the version info about Qt, PySide2 & Python """ - return "Built with PySide2 (Qt) v{} and python v{}".format(PySide2_version, sys_version.split("\n")[0]) + return QCoreApplication.translate('main',"Built with PySide2 (Qt) v{} and python v{}").format(PySide2_version, sys_version.split("\n")[0]) @Slot(str) def openUrl(self, url): @@ -166,6 +174,14 @@ def run(): app.setOrganizationName("Ad5001") app.setWindowIcon(QIcon(path.realpath(path.join(getcwd(), "logarithmplotter.svg")))) + # Installing translators + translator = QTranslator() + # Check if lang is forced. + forcedlang = [p for p in argv if p[:7]=="--lang="] + locale = QLocale(forcedlang[0][7:]) if len(forcedlang) > 0 else QLocale() + if (translator.load(locale, "lp", "_", path.realpath(path.join(getcwd(), "i18n")))): + app.installTranslator(translator); + # Installing macOS file handler. macOSFileOpenHandler = None if platform == "darwin": @@ -173,13 +189,16 @@ def run(): app.installEventFilter(macOSFileOpenHandler) engine = QQmlApplicationEngine() - helper = Helper() + helper = Helper(engine) engine.rootContext().setContextProperty("Helper", helper) engine.rootContext().setContextProperty("TestBuild", "--test-build" in argv) engine.rootContext().setContextProperty("StartTime", dep_time) + + app.translate("About","About LogarithmPlotter") # FOR SOME REASON, if this isn't included, Qt refuses to load the QML file. engine.addImportPath(path.realpath(path.join(getcwd(), "qml"))) engine.load(path.realpath(path.join(getcwd(), "qml", "eu", "ad5001", "LogarithmPlotter", "LogarithmPlotter.qml"))) + if not engine.rootObjects(): print("No root object", path.realpath(path.join(getcwd(), "qml"))) diff --git a/LogarithmPlotter/native.py b/LogarithmPlotter/native.py index e867c8b..28e58e0 100644 --- a/LogarithmPlotter/native.py +++ b/LogarithmPlotter/native.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/About.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/About.qml index eb5e32f..29fd3f7 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/About.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/About.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -23,7 +23,7 @@ import QtQuick.Controls 2.12 D.Dialog { id: about - title: `About LogarithmPlotter` + title: qsTr("About LogarithmPlotter") width: 400 height: 600 @@ -49,7 +49,7 @@ D.Dialog { width: parent.width wrapMode: Text.WordWrap font.pixelSize: 25 - text: "LogarithmPlotter v" + Helper.getVersion() + text: qsTr("LogarithmPlotter v%1").arg(Helper.getVersion()) } Label { @@ -61,7 +61,7 @@ D.Dialog { width: parent.width wrapMode: Text.WordWrap font.pixelSize: 18 - text: "Create graphs with logarithm scales." + text: qsTr("2D plotter software to make BODE plots, sequences and repartition functions.") } Label { @@ -100,7 +100,7 @@ You should have received a copy of the GNU General Public License along with thi anchors.top: copyrightInfos.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.topMargin: 10 - text: 'Report a bug' + text: qsTr('Report a bug') icon.name: 'bug' onClicked: Helper.openUrl('https://git.ad5001.eu/Ad5001/LogarithmPlotter') } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Alert.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Alert.qml index 5309eec..0378b53 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Alert.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Alert.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml index 653f482..bce122e 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/AppMenuBar.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -17,6 +17,7 @@ */ import QtQuick 2.12 +import QtQuick.Dialogs 1.3 import eu.ad5001.MixedMenu 1.1 import "js/objects.js" as Objects import "js/historylib.js" as HistoryLib @@ -49,7 +50,13 @@ MenuBar { Action { text: qsTr("&Quit") shortcut: StandardKey.Quit - onTriggered: Qt.quit() + onTriggered: { + if(settings.saved) + Qt.quit() + else + saveUnsavedChangesDialog.visible = true; + } + icon.name: 'application-exit' } } @@ -126,6 +133,22 @@ MenuBar { Menu { title: qsTr("&Help") + Action { + text: qsTr("&Source code") + icon.name: 'code' + onTriggered: Helper.openUrl("https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues") + } + Action { + text: qsTr("&Report a bug") + icon.name: 'bug' + onTriggered: Helper.openUrl("https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues") + } + Action { + text: qsTr("&Help translating!") + icon.name: 'translator' + onTriggered: Helper.openUrl("https://hosted.weblate.org/engage/logarithmplotter/") + } + MenuSeparator { } Action { text: qsTr("&About") shortcut: StandardKey.HelpContents @@ -133,4 +156,17 @@ MenuBar { onTriggered: about.open() } } + + MessageDialog { + id: saveUnsavedChangesDialog + title: qsTr("Save unsaved changes?") + icon: StandardIcon.Question + text: qsTr("This plot contains unsaved changes. By doing this, all unsaved data will be lost. Continue?") + standardButtons: StandardButton.Yes | StandardButton.No + onYes: Qt.quit() + } + + function showSaveUnsavedChangesDialog() { + saveUnsavedChangesDialog.visible = true + } } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ComboBoxSetting.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ComboBoxSetting.qml index 6cda799..ece456b 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ComboBoxSetting.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ComboBoxSetting.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml index eeaa69b..c2f4530 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/FileDialog.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -23,10 +23,9 @@ D.FileDialog { property bool exportMode: false - title: exportMode ? "Export Logarithm Plot file" : "Import Logarithm Plot file" + title: exportMode ? qsTr("Export Logarithm Plot file") : qsTr("Import Logarithm Plot file") nameFilters: ["Logarithm Plot File (*.lpf)", "All files (*)"] folder: shortcuts.documents selectExisting: !exportMode - } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/GreetScreen.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/GreetScreen.qml index 2758b24..9518767 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/GreetScreen.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/GreetScreen.qml @@ -1,6 +1,6 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -24,7 +24,7 @@ Popup { id: greetingPopup x: (parent.width-width)/2 y: Math.max(20, (parent.height-height)/2) - width: 600 + width: Math.max(welcome.width, checkForUpdatesSetting.width, resetRedoStackSetting.width)+20 height: Math.min(parent.height-40, 500) modal: true focus: true @@ -55,7 +55,7 @@ Popup { //width: parent.width wrapMode: Text.WordWrap font.pixelSize: 32 - text: "Welcome to LogarithmPlotter" + text: qsTr("Welcome to LogarithmPlotter") } } @@ -69,7 +69,7 @@ Popup { width: implicitWidth font.pixelSize: 18 font.italic: true - text: "Version " + Helper.getVersion() + text: qsTr("Version %1").arg(Helper.getVersion()) } Label { @@ -81,7 +81,7 @@ Popup { wrapMode: Text.WordWrap font.pixelSize: 14 width: parent.width - 50 - text: "Take a few seconds to configure LogarithmPlotter.\nThese settings can always be changed at any time from the \"Settings\" menu." + text: qsTr("Take a few seconds to configure LogarithmPlotter.\nThese settings can be changed at any time from the \"Settings\" menu.") } CheckBox { @@ -90,7 +90,7 @@ Popup { anchors.top: helpText.bottom anchors.topMargin: 10 checked: Helper.getSettingBool("check_for_updates") - text: 'Check for updates on startup (requires online connectivity)' + text: qsTr('Check for updates on startup (requires online connectivity)') onClicked: { Helper.setSettingBool("check_for_updates", checked) checkForUpdatesMenuSetting.checked = checked @@ -102,7 +102,7 @@ Popup { anchors.horizontalCenter: parent.horizontalCenter anchors.top: checkForUpdatesSetting.bottom checked: Helper.getSettingBool("reset_redo_stack") - text: 'Reset redo stack when a new action is added to history' + text: qsTr('Reset redo stack when a new action is added to history') onClicked: { Helper.setSettingBool("reset_redo_stack", checked) resetRedoStackMenuSetting.checked = checked @@ -110,7 +110,7 @@ Popup { } Button { - text: "Done" + text: qsTr("Done") font.pixelSize: 20 anchors.bottom: parent.bottom anchors.bottomMargin: 10 diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml index 8d00ecf..b6deebb 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/History.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -29,6 +29,8 @@ Item { property int redoCount: 0 property var undoStack: [] property var redoStack: [] + // Only true when no modification was done to the current working file. + property bool saved: true function clear() { undoStack = [] @@ -71,6 +73,7 @@ Item { redoStack = [] redoCount = 0 } + saved = false } } @@ -82,6 +85,7 @@ Item { redoStack.push(action) undoCount--; redoCount++; + saved = false } } @@ -93,17 +97,22 @@ Item { undoStack.push(action) undoCount++; redoCount--; + saved = false } } function undoMultipleDefered(toUndoCount) { undoTimer.toUndoCount = toUndoCount; undoTimer.start() + if(toUndoCount > 0) + saved = false } function redoMultipleDefered(toRedoCount) { redoTimer.toRedoCount = toRedoCount; redoTimer.start() + if(toRedoCount > 0) + saved = false } Timer { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/HistoryBrowser.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/HistoryBrowser.qml index 27caabb..6be99ba 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/HistoryBrowser.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/HistoryBrowser.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -60,7 +60,7 @@ ScrollView { Text { anchors.left: parent.left anchors.bottom: nowRect.top - text: "Redo >" + text: qsTr("Redo >") color: sysPaletteIn.windowText transform: Rotation { origin.x: 30; origin.y: 30; angle: 270} height: 70 @@ -79,7 +79,7 @@ ScrollView { anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: 5 - text: "> Now" + text: qsTr("> Now") color: sysPalette.windowText } } @@ -113,7 +113,7 @@ ScrollView { Text { anchors.left: parent.left anchors.top: undoColumn.top - text: "< Undo" + text: qsTr("< Undo") color: sysPaletteIn.windowText transform: Rotation { origin.x: 30; origin.y: 30; angle: 270} height: 60 diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Icon.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Icon.qml index 1a24031..68f9c53 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Icon.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Icon.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogGraphCanvas.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogGraphCanvas.qml index 5488fe0..96814d5 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogGraphCanvas.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogGraphCanvas.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml index 2311c4d..3c13c2d 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/LogarithmPlotter.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -34,11 +34,12 @@ ApplicationWindow { width: 1000 height: 500 color: sysPalette.window - title: "LogarithmPlotter " + (settings.saveFilename != "" ? " - " + settings.saveFilename.split('/').pop() : "") + title: "LogarithmPlotter " + (settings.saveFilename != "" ? " - " + settings.saveFilename.split('/').pop() : "") + (history.saved ? "" : "*") SystemPalette { id: sysPalette; colorGroup: SystemPalette.Active } SystemPalette { id: sysPaletteIn; colorGroup: SystemPalette.Disabled } + menuBar: appMenu.trueItem GreetScreen {} @@ -193,12 +194,13 @@ ApplicationWindow { "objects": objs, "type": "logplotv1" })) - alert.show("Saved plot to '" + filename.split("/").pop() + "'.") + alert.show(qsTr("Saved plot to '%1'.").arg(filename.split("/").pop())) + history.saved = true } function loadDiagram(filename) { let basename = filename.split("/").pop() - alert.show("Loading file '" + basename + "'.") + alert.show(qsTr("Loading file '%1'.").arg(basename)) let data = JSON.parse(Helper.load(filename)) let error = ""; if(Object.keys(data).includes("type") && data["type"] == "logplotv1") { @@ -237,7 +239,7 @@ ApplicationWindow { Objects.currentObjects[objType].push(obj) } } else { - error += "Unknown object type: " +objType + "\n"; + error += qsTr("Unknown object type: %1.").arg(objType) + "\n"; } } // Refreshing sidebar @@ -251,15 +253,17 @@ ApplicationWindow { objectLists.update() } } else { - error = "Invalid file provided." + error = qsTr("Invalid file provided.") } if(error != "") { console.log(error) - alert.show("Could not save file: " + error) + alert.show(qsTr("Could not save file: ") + error) // TODO: Error handling + return } drawCanvas.requestPaint() - alert.show("Loaded file '" + basename + "'.") + alert.show(qsTr("Loaded file '%1'.").arg(basename)) + history.saved = true } Timer { @@ -276,11 +280,18 @@ ApplicationWindow { onTriggered: Qt.quit() // Quit after paint on test build } + onClosing: { + if(!history.saved) { + close.accepted = false + appMenu.showSaveUnsavedChangesDialog() + } + } + function copyDiagramToClipboard() { var file = Helper.gettmpfile() drawCanvas.save(file) Helper.copyImageToClipboard() - alert.show("Copied plot screenshot to clipboard!") + alert.show(qsTr("Copied plot screenshot to clipboard!")) } function showAlert(alertText) { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml index 89a39ae..7990ac0 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/EditorDialog.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ D.Dialog { anchors.left: parent.left anchors.top: parent.top verticalAlignment: TextInput.AlignVCenter - text: `Edit properties of ${objEditor.objType} ${objEditor.obj.name}` + text: qsTr("Edit properties of %1 %2").arg(Objects.types[objEditor.objType].displayType()).arg(objEditor.obj.name) font.pixelSize: 20 color: sysPalette.windowText } @@ -56,7 +56,7 @@ D.Dialog { TextSetting { id: nameProperty height: 30 - label: "Name" + label: qsTr("Name") icon: "icons/settings/custom/label.svg" min: 1 width: dlgProperties.width @@ -65,7 +65,6 @@ D.Dialog { var newName = Utils.parseName(newValue) if(newName != '' && objEditor.obj.name != newName) { if(Objects.getObjectByName(newName) != null) { - console.log(Objects.getObjectByName(newName).name, newName) newName = ObjectsCommons.getNewName(newName) } history.addToHistory(new HistoryLib.NameChanged( @@ -82,13 +81,14 @@ D.Dialog { id: labelContentProperty height: 30 width: dlgProperties.width - label: "Label content" - model: ["null", "name", "name + value"] + label: qsTr("Label content") + model: [qsTr("null"), qsTr("name"), qsTr("name + value")] + property var idModel: ["null", "name", "name + value"] icon: "icons/settings/custom/label.svg" - currentIndex: model.indexOf(objEditor.obj.labelContent) + currentIndex: idModel.indexOf(objEditor.obj.labelContent) onActivated: function(newIndex) { - if(model[newIndex] != objEditor.obj.labelContent) { - objEditor.obj.labelContent = model[newIndex] + if(idModel[newIndex] != objEditor.obj.labelContent) { + objEditor.obj.labelContent = idModel[newIndex] objectListList.update() } } @@ -109,7 +109,7 @@ D.Dialog { width: parent.width height: visible ? implicitHeight : 0 visible: modelData[0].startsWith('comment') - text: visible ? modelData[1].replace(/\{name\}/g, objEditor.obj.name) : '' + text: visible ? (modelData[1].replace(/\{name\}/g, objEditor.obj.name)) : '' //color: sysPalette.windowText wrapMode: Text.WordWrap } @@ -180,23 +180,25 @@ D.Dialog { // True to select an object of type, false for enums. property bool selectObjMode: paramTypeIn(modelData[1], ['ObjectType']) - model: visible ? - (selectObjMode ? Objects.getObjectsName(modelData[1].objType).concat(['+ Create new ' + modelData[1].objType]) : modelData[1].values) + property var baseModel: visible ? + (selectObjMode ? Objects.getObjectsName(modelData[1].objType).concat([qsTr("+ Create new %1").arg(Objects.types[modelData[1].objType].displayType())]) : modelData[1].values) : [] + // Translate the model if necessary. + model: selectObjMode ? baseModel : baseModel.map(x => qsTr(x)) visible: paramTypeIn(modelData[1], ['ObjectType', 'Enum']) - currentIndex: model.indexOf(selectObjMode ? objEditor.obj[modelData[0]].name : objEditor.obj[modelData[0]]) + currentIndex: baseModel.indexOf(selectObjMode ? objEditor.obj[modelData[0]].name : objEditor.obj[modelData[0]]) onActivated: function(newIndex) { if(selectObjMode) { // This is only done when what we're selecting are Objects. // Setting object property. - var selectedObj = Objects.getObjectByName(model[newIndex], modelData[1].objType) + var selectedObj = Objects.getObjectByName(baseModel[newIndex], modelData[1].objType) if(selectedObj == null) { // Creating new object. selectedObj = Objects.createNewRegisteredObject(modelData[1].objType) history.addToHistory(new HistoryLib.CreateNewObject(selectedObj.name, modelData[1].objType, selectedObj.export())) - model = Objects.getObjectsName(modelData[1].objType).concat(['+ Create new ' + modelData[1].objType]) - currentIndex = model.indexOf(selectedObj.name) + baseModel = Objects.getObjectsName(modelData[1].objType).concat([qsTr("+ Create new %1").arg(Objects.types[modelData[1].objType].displayType())]) + currentIndex = baseModel.indexOf(selectedObj.name) } //Objects.currentObjects[objEditor.objType][objEditor.objIndex].requiredBy = objEditor.obj[modelData[0]].filter((obj) => objEditor.obj.name != obj.name) objEditor.obj.requiredBy = objEditor.obj.requiredBy.filter((obj) => objEditor.obj.name != obj.name) @@ -206,13 +208,13 @@ D.Dialog { objEditor.obj[modelData[0]], selectedObj )) objEditor.obj[modelData[0]] = selectedObj - } else if(model[newIndex] != objEditor.obj[modelData[0]]) { + } else if(baseModel[newIndex] != objEditor.obj[modelData[0]]) { // Ensuring new property is different to not add useless history entries. history.addToHistory(new HistoryLib.EditedProperty( objEditor.obj.name, objEditor.objType, modelData[0], - objEditor.obj[modelData[0]], model[newIndex] + objEditor.obj[modelData[0]], baseModel[newIndex] )) - objEditor.obj[modelData[0]] = model[newIndex] + objEditor.obj[modelData[0]] = baseModel[newIndex] } // Refreshing Objects.currentObjects[objEditor.objType][objEditor.objIndex].update() diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml index 25a256d..b99641a 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectCreationGrid.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ Column { Label { id: createTitle verticalAlignment: TextInput.AlignVCenter - text: '+ Create new:' + text: qsTr('+ Create new:') font.pixelSize: 20 } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectLists.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectLists.qml index c3b5310..085d5b4 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectLists.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/ObjectLists/ObjectLists.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -60,7 +60,7 @@ ListView { } ToolTip.visible: hovered - ToolTip.text: checked ? `Hide all ${Objects.types[objType].displayTypeMultiple()}` : `Show all ${Objects.types[objType].displayTypeMultiple()}` + ToolTip.text: checked ? qsTr("Hide all %1").arg(Objects.types[objType].displayTypeMultiple()) : qsTr("Show all %1").arg(Objects.types[objType].displayTypeMultiple()) } Label { @@ -96,7 +96,9 @@ ListView { } ToolTip.visible: hovered - ToolTip.text: checked ? `Hide ${objType} ${obj.name}` : `Show ${objType} ${obj.name}` + ToolTip.text: checked ? + qsTr("Hide %1 %2").arg(Objects.types[objType].displayType()).arg(obj.name) : + qsTr("Show %1 %2").arg(Objects.types[objType].displayType()).arg(obj.name) } Label { @@ -134,7 +136,7 @@ ListView { property bool hasYProp: Objects.types[objType].properties().hasOwnProperty('y') visible: hasXProp || hasYProp ToolTip.visible: hovered - ToolTip.text: 'Set ' + Objects.types[objType].displayType() + ' position.' + ToolTip.text: qsTr("Set %1 %2 position").arg(Objects.types[objType].displayType()).arg(obj.name) onClicked: { positionPicker.objType = objType @@ -159,7 +161,7 @@ ListView { icon.source: '../icons/delete.svg' icon.color: sysPalette.buttonText ToolTip.visible: hovered - ToolTip.text: 'Delete ' + Objects.types[objType].displayType() + '.' + ToolTip.text: qsTr("Delete %1 %2").arg(Objects.types[objType].displayType()).arg(obj.name) onClicked: { history.addToHistory(new HistoryLib.DeleteObject( @@ -191,8 +193,8 @@ ListView { D.ColorDialog { id: pickColor - color: obj.color - title: `Pick new color for ${objType} ${obj.name}` + color: obj.color.arg(obj.name) + title: qsTr("Pick new color for %1 %2").arg(Objects.types[objType].displayType()) onAccepted: { history.addToHistory(new HistoryLib.EditedProperty( obj.name, objType, "color", diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml index c684836..6a5399a 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/PickLocationOverlay.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -85,7 +85,7 @@ Item { Row { height: precisionSlider.height Text { - text: " Pointer precision: " + text: " "+ qsTr("Pointer precision:") + " " color: 'black' anchors.verticalCenter: parent.verticalCenter } @@ -105,7 +105,7 @@ Item { CheckBox { id: snapToGridCheckbox - text: "Snap to grid" + text: qsTr("Snap to grid") checked: false } } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml index 38a30c0..0903271 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/Settings.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -18,6 +18,7 @@ import QtQuick.Controls 2.12 import QtQuick 2.12 +import QtQuick.Dialogs 1.1 import "js/utils.js" as Utils ScrollView { @@ -70,7 +71,7 @@ ScrollView { id: zoomX height: 30 isDouble: true - label: "X Zoom" + label: qsTr("X Zoom") min: 1 icon: "icons/settings/xzoom.svg" width: settings.settingWidth @@ -85,7 +86,7 @@ ScrollView { id: zoomY height: 30 isDouble: true - label: "Y Zoom" + label: qsTr("Y Zoom") icon: "icons/settings/yzoom.svg" width: settings.settingWidth value: settings.yzoom.toFixed(2) @@ -101,7 +102,7 @@ ScrollView { height: 30 isDouble: true min: -Infinity - label: "Min X" + label: qsTr("Min X") icon: "icons/settings/xmin.svg" width: settings.settingWidth defValue: settings.xmin @@ -120,7 +121,7 @@ ScrollView { height: 30 isDouble: true min: -Infinity - label: "Max Y" + label: qsTr("Max Y") icon: "icons/settings/ymax.svg" width: settings.settingWidth defValue: settings.ymax @@ -135,7 +136,7 @@ ScrollView { height: 30 isDouble: true min: -Infinity - label: "Max X" + label: qsTr("Max X") icon: "icons/settings/xmax.svg" width: settings.settingWidth value: canvas.px2x(canvas.canvasSize.width).toFixed(2) @@ -154,7 +155,7 @@ ScrollView { height: 30 isDouble: true min: -Infinity - label: "Min Y" + label: qsTr("Min Y") icon: "icons/settings/ymin.svg" width: settings.settingWidth defValue: canvas.px2y(canvas.canvasSize.height).toFixed(2) @@ -171,7 +172,7 @@ ScrollView { TextSetting { id: xAxisStep height: 30 - label: "X Axis Step" + label: qsTr("X Axis Step") icon: "icons/settings/xaxisstep.svg" width: settings.settingWidth defValue: settings.xaxisstep @@ -185,7 +186,7 @@ ScrollView { TextSetting { id: yAxisStep height: 30 - label: "Y Axis Step" + label: qsTr("Y Axis Step") icon: "icons/settings/yaxisstep.svg" width: settings.settingWidth defValue: settings.yaxisstep @@ -199,7 +200,7 @@ ScrollView { id: lineWidth height: 30 isDouble: true - label: "Line width" + label: qsTr("Line width") min: 1 icon: "icons/settings/linewidth.svg" width: settings.settingWidth @@ -214,7 +215,7 @@ ScrollView { id: textSize height: 30 isDouble: true - label: "Text size (px)" + label: qsTr("Text size (px)") min: 1 icon: "icons/settings/textsize.svg" width: settings.settingWidth @@ -229,7 +230,7 @@ ScrollView { id: xAxisLabel height: 30 width: settings.settingWidth - label: 'X Label' + label: qsTr('X Label') icon: "icons/settings/xlabel.svg" model: ListModel { ListElement { text: "" } @@ -255,7 +256,7 @@ ScrollView { id: yAxisLabel height: 30 width: settings.settingWidth - label: 'Y Label' + label: qsTr('Y Label') icon: "icons/settings/ylabel.svg" model: ListModel { ListElement { text: "" } @@ -283,7 +284,7 @@ ScrollView { CheckBox { id: logScaleX checked: settings.logscalex - text: 'X Log scale' + text: qsTr('X Log scale') onClicked: { settings.logscalex = checked settings.changed() @@ -293,7 +294,7 @@ ScrollView { CheckBox { id: showXGrad checked: settings.showxgrad - text: 'Show X graduation' + text: qsTr('Show X graduation') onClicked: { settings.showxgrad = checked settings.changed() @@ -303,7 +304,7 @@ ScrollView { CheckBox { id: showYGrad checked: settings.showygrad - text: 'Show Y graduation' + text: qsTr('Show Y graduation') onClicked: { settings.showygrad = checked settings.changed() @@ -314,7 +315,7 @@ ScrollView { id: copyToClipboard height: 30 width: settings.settingWidth - text: "Copy to clipboard" + text: qsTr("Copy to clipboard") icon.name: 'editcopy' onClicked: root.copyDiagramToClipboard() } @@ -323,7 +324,7 @@ ScrollView { id: saveDiagram height: 30 width: settings.settingWidth - text: "Save plot" + text: qsTr("Save plot") icon.name: 'document-save' onClicked: save() } @@ -332,7 +333,7 @@ ScrollView { id: saveDiagramAs height: 30 width: settings.settingWidth - text: "Save plot as" + text: qsTr("Save plot as") icon.name: 'document-save-as' onClicked: saveAs() } @@ -341,7 +342,7 @@ ScrollView { id: loadDiagram height: 30 width: settings.settingWidth - text: "Load plot" + text: qsTr("Load plot") icon.name: 'document-open' onClicked: load() } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/TextSetting.qml b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/TextSetting.qml index 5c20f36..b1941f5 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/TextSetting.qml +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/TextSetting.qml @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -107,14 +107,14 @@ Item { property var insertChars: [ "α","β","γ","δ","ε","ζ","η", - "θ","κ","λ","μ","ξ","ρ","ς", - "σ","τ","φ","χ","ψ","ω","Γ", - "Δ","Θ","Λ","Ξ","Π","Σ","Φ", - "Ψ","Ω","ₐ","ₑ","ₒ","ₓ","ₕ", - "ₖ","ₗ","ₘ","ₙ","ₚ","ₛ","ₜ", - "¹","²","³","⁴","⁵","⁶","⁷", - "⁸","⁹","⁰","₁","₂","₃","₄", - "₅","₆","₇","₈","₉","₀"," " + "π","θ","κ","λ","μ","ξ","ρ", + "ς","σ","τ","φ","χ","ψ","ω", + "Γ","Δ","Θ","Λ","Ξ","Π","Σ", + "Φ","Ψ","Ω","ₐ","ₑ","ₒ","ₓ", + "ₕ","ₖ","ₗ","ₘ","ₙ","ₚ","ₛ", + "ₜ","¹","²","³","⁴","⁵","⁶", + "⁷","⁸","⁹","⁰","₁","₂","₃", + "₄","₅","₆","₇","₈","₉","₀" ] Repeater { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/historylib.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/historylib.js index cae0769..d72bc17 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/historylib.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/historylib.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -74,7 +74,7 @@ class CreateNewObject extends Action { } getReadableString() { - return `New ${this.targetType} ${this.targetName} created.` + return qsTr("New %1 %2 created.").arg(Objects.types[this.targetType].displayType()).arg(this.targetName) } } @@ -91,7 +91,7 @@ class DeleteObject extends CreateNewObject { } getReadableString() { - return `${this.targetType} ${this.targetName} deleted.` + return qsTr("%1 %2 deleted.").arg(Objects.types[this.targetType].displayType()).arg(this.targetName) } } @@ -130,7 +130,7 @@ class EditedProperty extends Action { getReadableString() { var prev = this.previousValue == null ? ""+this.previousValue : this.previousValue.toString() var next = this.newValue == null ? ""+this.newValue : this.newValue.toString() - return `${this.targetPropertyReadable} of ${this.targetType} ${this.targetName} changed from "${prev}" to "${next}".` + return qsTr('%1 of %2 %3 changed from "%4" to "%5".').arg(this.targetPropertyReadable).arg(Objects.types[this.targetType].displayType()).arg(this.targetName).arg(prev).arg(next) } } @@ -144,9 +144,9 @@ class EditedVisibility extends EditedProperty { getReadableString() { if(this.newValue) { - return `${this.targetType} ${this.targetName} shown.` + return qsTr('%1 %2 shown.').arg(this.targetType).arg(this.targetName) } else { - return `${this.targetType} ${this.targetName} hidden.` + return qsTr('%1 %2 hidden.').arg(this.targetType).arg(this.targetName) } } } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/latex.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/latex.js new file mode 100644 index 0000000..772a376 --- /dev/null +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/latex.js @@ -0,0 +1,160 @@ +/** + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. + * Copyright (C) 2022 Ad5001 + * + * 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 . + */ + + +.import "expr-eval.js" as ExprEval + +// Puts element within parenthesis +function par(elem) { + return '(' + elem + ')' +} + +// checks if the element contains a string, and returns the parenthesis version if so. +function parif(elem, contents) { + return contents.some(elem.includes) ? par(elem) : elem +} + +// Adpation of expressionToString for latex +function expressionToLatex(tokens) { + var nstack = []; + var n1, n2, n3; + var f, args, argCount; + for (var i = 0; i < tokens.length; i++) { + var item = tokens[i]; + var type = item.type; + + switch(type) { + case ExprEval.INUMBER: + if (typeof item.value === 'number' && item.value < 0) { + nstack.push(par(item.value)); + } else if (Array.isArray(item.value)) { + nstack.push('[' + item.value.map(escapeValue).join(', ') + ']'); + } else { + nstack.push(escapeValue(item.value)); + } + break; + case ExprEval.IOP2: + n2 = nstack.pop(); + n1 = nstack.pop(); + f = item.value; + switch(f) { + case '-': + case '+': + nstack.push(n1 + this.ope + n2); + break; + case '||': + case 'or': + case '&&': + case 'and': + case '==': + case '!=': + nstack.push(par(n1) + this.ope + par(n2)); + break; + case '*': + nstack.push(parif(n1,['+','-']) + " \\times " + parif(n2,['+','-'])); + break; + case '/': + nstack.push("\\frac{" + n1 + "}{" + n2 + "}"); + break; + case '^': + nstack.push(parif(n1,['+','-','*','/','!']) + "^{" + n2 + "}"); + break; + case '%': + nstack.push(parif(n1,['+','-','*','/','!','^']) + " \\mathrm{mod} " + parif(n2,['+','-','*','/','!','^'])); + break; + case '[': + nstack.push(n1 + '[' + n2 + ']'); + break; + default: + throw new EvalError("Unknown operator " + ope + "."); + } + break; + case ExprEval.IOP3: // Thirdiary operator + n3 = nstack.pop(); + n2 = nstack.pop(); + n1 = nstack.pop(); + f = item.value; + if (f === '?') { + nstack.push('(' + n1 + ' ? ' + n2 + ' : ' + n3 + ')'); + } else { + throw new EvalError('Unknown operator ' + ope + '.'); + } + break; + case ExprEval.IVAR: + case ExprEval.IVARNAME: + nstack.push(item.value); + break; + case ExprEval.IOP1: // Unary operator + n1 = nstack.pop(); + f = item.value; + switch(f) { + case '-': + case '+': + nstack.push(par(f + n1)); + break; + case '!': + nstack.push(parif(n1,['+','-','*','/','^']) + '!'); + break; + default: + nstack.push(f + parif(n1,['+','-','*','/','^'])); + break; + } + break; + case ExprEval.IFUNCALL: + argCount = item.value; + args = []; + while (argCount-- > 0) { + args.unshift(nstack.pop()); + } + f = nstack.pop(); + nstack.push(f + '(' + args.join(', ') + ')'); + break; + case ExprEval.IFUNDEF: + nstack.push(par(n1 + '(' + args.join(', ') + ') = ' + n2)); + break; + case ExprEval.IMEMBER: + n1 = nstack.pop(); + nstack.push(n1 + '.' + item.value); + break; + case ExprEval.IARRAY: + argCount = item.value; + args = []; + while (argCount-- > 0) { + args.unshift(nstack.pop()); + } + nstack.push('[' + args.join(', ') + ']'); + break; + case ExprEval.IEXPR: + nstack.push('(' + expressionToLatex(item.value) + ')'); + break; + case ExprEval.IENDSTATEMENT: + break; + default: + throw new EvalError('invalid Expression'); + break; + } + } + if (nstack.length > 1) { + if (toJS) { + nstack = [ nstack.join(',') ]; + } else { + nstack = [ nstack.join(';') ]; + } + } + return Utils.makeExpressionReadable(String(nstack[0])); +} diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/mathlib.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/mathlib.js index 2c52844..30d93cb 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/mathlib.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/mathlib.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -373,7 +373,6 @@ class SpecialDomain extends Domain { class DomainSet extends SpecialDomain { constructor(values) { super('', x => true, x => x, true) - console.log(values) var newVals = {} this.executedValues = [] for(var value of values) { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objects.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objects.js index 52bfde8..27681a0 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objects.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objects.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -53,7 +53,6 @@ function getObjectsName(objType) { types.forEach(function(elemType){ elementNames = elementNames.concat(currentObjects[elemType].map(obj => obj.name)) }) - console.log(elementNames) return elementNames } if(currentObjects[objType] == undefined) return [] diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/autoload.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/autoload.js index 7ab6308..02a6646 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/autoload.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/autoload.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/common.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/common.js index 7cbfaab..32fda9d 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/common.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/common.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js index 8b11990..09b8701 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/function.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -26,20 +26,32 @@ class Function extends Common.ExecutableObject { static type(){return 'Function'} - static displayType(){return 'Function'} - static displayTypeMultiple(){return 'Functions'} + static displayType(){return qsTr('Function')} + static displayTypeMultiple(){return qsTr('Functions')} static properties() {return { - 'expression': 'Expression', - 'definitionDomain': 'Domain', - 'destinationDomain': 'Domain', - 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}', - 'labelPosition': new P.Enum('above', 'below', 'left', 'right', 'above-left', 'above-right', 'below-left', 'below-right'), - 'displayMode': new P.Enum('application', 'function'), - 'labelX': 'number', - 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)', - 'drawPoints': 'boolean', - 'drawDashedLines': 'boolean' + 'expression': 'Expression', + 'definitionDomain': 'Domain', + 'destinationDomain': 'Domain', + 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}', + 'labelPosition': P.Enum.Position, + 'displayMode': new P.Enum('application', 'function'), + 'labelX': 'number', + 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)', + 'drawPoints': 'boolean', + 'drawDashedLines': 'boolean' }} + /*static properties() {return { + [QT_TR_NOOP('expression')]: 'Expression', + [QT_TR_NOOP('definitionDomain')]: 'Domain', + [QT_TR_NOOP('destinationDomain')]: 'Domain', + 'comment1': 'Ex: R+* (ℝ⁺*), N (ℕ), Z-* (ℤ⁻*), ]0;1[, {3;4;5}', + [QT_TR_NOOP('labelPosition')]: P.Enum.Position, + [QT_TR_NOOP('displayMode')]: new P.Enum('application', 'function'), + [QT_TR_NOOP('labelX')]: 'number', + 'comment2': 'The following parameters are used when the definition domain is a non-continuous set. (Ex: ℕ, ℤ, sets like {0;3}...)', + [QT_TR_NOOP('drawPoints')]: 'boolean', + [QT_TR_NOOP('drawDashedLines')]: 'boolean' + }}*/ constructor(name = null, visible = true, color = null, labelContent = 'name + value', expression = 'x', definitionDomain = 'RPE', destinationDomain = 'R', @@ -146,7 +158,6 @@ class Function extends Common.ExecutableObject { if(currentX === null) break; if((definitionDomain.includes(currentX) || definitionDomain.includes(previousX)) && (destinationDomain.includes(currentY) || destinationDomain.includes(previousY))) { - console.log(drawDash, drawPoints) if(drawDash) canvas.drawDashedLine(ctx, canvas.x2px(previousX), canvas.y2px(previousY), canvas.x2px(currentX), canvas.y2px(currentY)) if(drawPoints) { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/gainbode.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/gainbode.js index 7ecd963..a3e5a35 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/gainbode.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/gainbode.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -28,8 +28,8 @@ class GainBode extends Common.ExecutableObject { static type(){return 'Gain Bode'} - static displayType(){return 'Bode Magnitude'} - static displayTypeMultiple(){return 'Bode Magnitudes'} + static displayType(){return qsTr('Bode Magnitude')} + static displayTypeMultiple(){return qsTr('Bode Magnitudes')} static properties() {return { 'om_0': new P.ObjectType('Point'), 'pass': new P.Enum('high', 'low'), @@ -69,7 +69,8 @@ class GainBode extends Common.ExecutableObject { } getReadableString() { - return `${this.name}: ${this.pass}-pass; ${this.om_0.name} = ${this.om_0.x}\n ${' '.repeat(this.name.length)}${this.gain.toString(true)} dB/dec` + let pass = this.pass == "low" ? qsTr("low-pass") : qsTr("high-pass"); + return `${this.name}: ${pass}; ${this.om_0.name} = ${this.om_0.x}\n ${' '.repeat(this.name.length)}${this.gain.toString(true)} dB/dec` } export() { diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/phasebode.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/phasebode.js index 63dba8b..c747c22 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/phasebode.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/phasebode.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -27,8 +27,8 @@ class PhaseBode extends Common.ExecutableObject { static type(){return 'Phase Bode'} - static displayType(){return 'Bode Phase'} - static displayTypeMultiple(){return 'Bode Phases'} + static displayType(){return qsTr('Bode Phase')} + static displayTypeMultiple(){return qsTr('Bode Phases')} static properties() {return { 'om_0': new P.ObjectType('Point'), 'phase': 'Expression', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/point.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/point.js index db3839a..a2e9e54 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/point.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/point.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,8 @@ class Point extends Common.DrawableObject { static type(){return 'Point'} - static displayType(){return 'Point'} - static displayTypeMultiple(){return 'Points'} + static displayType(){return qsTr('Point')} + static displayTypeMultiple(){return qsTr('Points')} static properties() {return { 'x': 'Expression', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/repartition.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/repartition.js index 2d29d0d..9baed2b 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/repartition.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/repartition.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -23,8 +23,8 @@ class RepartitionFunction extends Common.ExecutableObject { static type(){return 'Repartition'} - static displayType(){return 'Repartition'} - static displayTypeMultiple(){return 'Repartition functions'} + static displayType(){return qsTr('Repartition')} + static displayTypeMultiple(){return qsTr('Repartition functions')} static properties() {return { 'beginIncluded': 'boolean', 'drawLineEnds': 'boolean', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sequence.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sequence.js index bbd53b2..e1fd800 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sequence.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sequence.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,8 @@ class Sequence extends Common.ExecutableObject { static type(){return 'Sequence'} - static displayType(){return 'Sequence'} - static displayTypeMultiple(){return 'Sequences'} + static displayType(){return qsTr('Sequence')} + static displayTypeMultiple(){return qsTr('Sequences')} static properties() {return { 'drawPoints': 'boolean', 'drawDashedLines': 'boolean', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommegainsbode.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommegainsbode.js index 57f0ec7..20f1edb 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommegainsbode.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommegainsbode.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -27,8 +27,8 @@ class SommeGainsBode extends Common.DrawableObject { static type(){return 'Somme gains Bode'} - static displayType(){return 'Bode Magnitudes Sum'} - static displayTypeMultiple(){return 'Bode Magnitudes Sum'} + static displayType(){return qsTr('Bode Magnitudes Sum')} + static displayTypeMultiple(){return qsTr('Bode Magnitudes Sum')} static createable() {return false} static properties() {return { 'labelPosition': new P.Enum('above', 'below', 'left', 'right', 'above-left', 'above-right', 'below-left', 'below-right'), diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommephasesbode.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommephasesbode.js index 4d0c6f8..7617521 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommephasesbode.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/sommephasesbode.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,8 @@ class SommePhasesBode extends Common.ExecutableObject { static type(){return 'Somme phases Bode'} - static displayType(){return 'Bode Phases Sum'} - static displayTypeMultiple(){return 'Bode Phases Sum'} + static displayType(){return qsTr('Bode Phases Sum')} + static displayTypeMultiple(){return qsTr('Bode Phases Sum')} static createable() {return false} static properties() {return { 'labelPosition': new P.Enum('above', 'below', 'left', 'right', 'above-left', 'above-right', 'below-left', 'below-right'), diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js index 45fd633..b67932c 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/text.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -25,8 +25,8 @@ class Text extends Common.DrawableObject { static type(){return 'Text'} - static displayType(){return 'Text'} - static displayTypeMultiple(){return 'Texts'} + static displayType(){return qsTr('Text')} + static displayTypeMultiple(){return qsTr('Texts')} static properties() {return { 'x': 'Expression', 'y': 'Expression', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js index c6eae5d..09e548b 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/objs/xcursor.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -26,8 +26,8 @@ class XCursor extends Common.DrawableObject { static type(){return 'X Cursor'} - static displayType(){return 'X Cursor'} - static displayTypeMultiple(){return 'X Cursors'} + static displayType(){return qsTr('X Cursor')} + static displayTypeMultiple(){return qsTr('X Cursors')} static properties() { return { 'x': 'Expression', diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js index 1eca5ae..b9d6690 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parameters.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -54,3 +54,16 @@ class Dictionary { this.forbidAdding = forbidAdding } } + +// Common parameters of them: + +Enum.Position = new Enum( + QT_TR_NOOP('above'), + QT_TR_NOOP('below'), + QT_TR_NOOP('left'), + QT_TR_NOOP('right'), + QT_TR_NOOP('above-left'), + QT_TR_NOOP('above-right'), + QT_TR_NOOP('below-left'), + QT_TR_NOOP('below-right') +) diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/ast.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/ast.js index 011f887..78eb31b 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/ast.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/ast.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ .pragma library -import "reference.js" as Reference +.import "reference.js" as Reference const DERIVATION_PRECISION = 0.01 diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/builder.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/builder.js index a9ad80f..9a2a7ee 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/builder.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/builder.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/common.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/common.js index 120411f..1d10237 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/common.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/common.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -45,7 +45,7 @@ class InputExpression { } raise(message) { - throw new SyntaxError(message + " at " + this.position ".") + throw new SyntaxError(message + " at " + this.position + ".") } } diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/reference.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/reference.js index cfd14f3..6eac856 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/reference.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/reference.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/tokenizer.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/tokenizer.js index dbb7abd..f0e02c7 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/tokenizer.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/parsing/tokenizer.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ .pragma library -import "reference.js" as Reference +.import "reference.js" as Reference const WHITESPACES = " \t\n\r" const STRING_LIMITORS = '"\'`'; diff --git a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/utils.js b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/utils.js index 27757a6..a86a0fa 100644 --- a/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/utils.js +++ b/LogarithmPlotter/qml/eu/ad5001/LogarithmPlotter/js/utils.js @@ -1,5 +1,5 @@ /** - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify diff --git a/LogarithmPlotter/update.py b/LogarithmPlotter/update.py index 35df66f..7e525a1 100644 --- a/LogarithmPlotter/update.py +++ b/LogarithmPlotter/update.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . """ -from PySide2.QtCore import Qt, QRunnable, QThreadPool, QThread, QObject, Signal +from PySide2.QtCore import Qt, QRunnable, QThreadPool, QThread, QObject, Signal, QCoreApplication from urllib.request import urlopen from urllib.error import HTTPError, URLError from sys import argv @@ -51,17 +51,16 @@ class UpdateCheckerRunnable(QRunnable): current_version_tuple = self.current_version.split(".") is_version_newer = version_tuple > current_version_tuple if is_version_newer: - msg_text = "An update for LogarithPlotter (v" + version + ") is available." + msg_text = QCoreApplication.translate("update","An update for LogarithPlotter (v{}) is available.").format(version) update_available = True else: show_alert = False - msg_text = "No update available." + msg_text = QCoreApplication.translate("update","No update available.") except HTTPError as e: - msg_text = "Could not fetch update information: Server error " + str(e.code) + "." + msg_text = QCoreApplication.translate("update","Could not fetch update information: Server error {}.").format(str(e.code)) except URLError as e: - msg_text = "Could not fetch update information: Could not connect to the update server. " + str(e.reason) + "." - print(msg_text) + msg_text = QCoreApplication.translate("update","Could not fetch update information: {}.").format(str(e.reason)) self.callback.got_update_info.emit(show_alert, msg_text,update_available) def check_for_updates(current_version, window): diff --git a/README.md b/README.md index bcf5d1d..6a2f769 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # ![icon](https://git.ad5001.eu/Ad5001/LogarithmPlotter/raw/branch/master/logplotter.svg) LogarithmPlotter [![Build Status](https://ci.ad5001.eu/api/badges/Ad5001/LogarithmPlotter/status.svg)](https://ci.ad5001.eu/Ad5001/LogarithmPlotter) -[![On flathub](https://img.shields.io/flathub/v/eu.ad5001.LogarithmPlotter?label=on%20flathub)](https://flathub.org/apps/details/eu.ad5001.LogarithmPlotter) -[![On Snapcraft](https://badgen.net/snapcraft/v/logarithmplotter?label=on%20snapcraft)](https://snapcraft.io/logarithmplotter) +[![Translation status](https://hosted.weblate.org/widgets/logarithmplotter/-/logarithmplotter/svg-badge.svg)](https://hosted.weblate.org/engage/logarithmplotter/) +[![On flathub](https://img.shields.io/flathub/v/eu.ad5001.LogarithmPlotter?label=on%20flathub&logo=Flathub&logoColor=white&color=4A86CF)](https://flathub.org/apps/details/eu.ad5001.LogarithmPlotter) +[![On Snapcraft](https://badgen.net/snapcraft/v/logarithmplotter?label=on%20snapstore&color=82BEA0&icon=https://ad5001.eu/icons/skills/snapcraft.svg)](https://snapcraft.io/logarithmplotter) -Create graphs with logarithm scales, namely BODE diagrams. +2D plotter software to make Bode plots, sequences and distribution functions. ## Run You can simply run LogarithmPlotter using `python3 run.py`. +In order to test translations, you can use the `--lang=` command line option to force the detected locale of LogarithmPlotter. + ## Install ### Generate installers: @@ -34,9 +37,17 @@ For all builds, you need [Python 3](https://python.org) with [PySide2](https://p Run `bash linux/install_local.sh` +## Contribute + +There are several ways to contribute to LogarithmPlotter. +- You can help to translate [the project on Hosted Weblate](https://hosted.weblate.org/engage/logarithmplotter/): +[![Translation status](https://hosted.weblate.org/widgets/logarithmplotter/-/logarithmplotter/multi-auto.svg)](https://hosted.weblate.org/engage/logarithmplotter/) + +- You can help the development of LogarithmPlotter. In order to get started, take a look at the [wiki](https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki/_pages). + ## Legal notice - LogarithmPlotter - Create graphs with logarithm scales. - Copyright (C) 2021 Ad5001 + LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. + Copyright (C) 2022 Ad5001 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 @@ -50,3 +61,7 @@ Run `bash linux/install_local.sh` You should have received a copy of the GNU General Public License along with this program. If not, see . + +Language files translations located at LogarithmPlotter/i18n are licensed under GNU GPL3.0+ and are copyrighted by their original authors. See LICENSE.md for more details: +- Novergian translation by [Allan Nordhøy](https://github.com/comradekingu) +- Hungarian translation by [Óvári](https://github.com/ovari) diff --git a/build-macosx.sh b/build-macosx.sh index 5e17dff..08554ce 100755 --- a/build-macosx.sh +++ b/build-macosx.sh @@ -2,7 +2,14 @@ rm $(find . -name "*.qmlc") rm $(find . -name "*.pyc") python3 -m pip install -U pyinstaller + +# Building translations +cd "LogarithmPlotter/i18n/" +bash release.sh +cd ../../ + pyinstaller --add-data "LogarithmPlotter/qml:qml" \ + --add-data "LogarithmPlotter/i18n:i18n" \ --add-data "LICENSE.md:." \ --add-data "mac/logarithmplotterfile.icns:." \ --add-data "README.md:." \ diff --git a/build-windows.bat b/build-windows.bat index ed31a37..a29d291 100644 --- a/build-windows.bat +++ b/build-windows.bat @@ -1,3 +1,9 @@ rem Need pyinstaller >= 4.3, or there is an issue regarding the PATH of the building. python -m pip install -U pyinstaller>=4.3 -pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter + +rem Building translations +cd "LogarithmPlotter\i18n" +cmd release.sh +cd ..\.. + +pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --add-data "LogarithmPlotter/i18n;i18n" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter diff --git a/build-wine.sh b/build-wine.sh index e802ac5..bdbbe5a 100644 --- a/build-wine.sh +++ b/build-wine.sh @@ -3,4 +3,10 @@ rm $(find . -name "*.qmlc") rm $(find . -name "*.pyc") wine python -m pip install -U pyinstaller -wine pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter + +# Building translations +cd "LogarithmPlotter/i18n/" +bash release.sh +cd ../../ + +wine pyinstaller --add-data "logplotter.svg;." --add-data "LogarithmPlotter/qml;qml" --add-data "LogarithmPlotter/i18n;i18n" --noconsole LogarithmPlotter/logarithmplotter.py --icon=win/logarithmplotter.ico -n logarithmplotter diff --git a/linux/debian/changelog b/linux/debian/changelog index 3be2375..6071d24 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -1,3 +1,17 @@ +logarithmplotter (0.1.4) stable; urgency=medium + + * New feature: LogarithmPlotter detects unsaved changes. + * New feature: LogarithmPlotter is now translated! See https://hosted.weblate.org/engage/logarithmplotter/ to help. + * New translation: English by Ad5001: 100% + * New translation: French by Ad5001: 100% + * New translation: German by Ad5001: 100% + * New translation: Hungarian by Óvári (@ovari on github): 100% + * New translation: Norvegian by Allan Nordhøy (@comradekingu on github): 80% + * Fixed bug: No notification when closing LogarithmPlotter with unsaved changes. + * Fixed bug: π unavailable in symbols. + + -- Ad5001 Wed, 24 Jan 2022 20:00:00 +0100 + logarithmplotter (0.1.3) stable; urgency=medium * Fixed bug: Confined packages (snapcraft & flatpak) won't show error messages related to update checks. diff --git a/linux/debian/control b/linux/debian/control index 54e8d0a..1f41106 100644 --- a/linux/debian/control +++ b/linux/debian/control @@ -1,6 +1,6 @@ Package: logarithmplotter Source: logarithmplotter -Version: 0.1.2 +Version: 0.1.4 Architecture: all Maintainer: Ad5001 Depends: python3, python3-pip, qml-module-qtquick-controls2 (>= 5.12.0), qml-module-qtmultimedia (>= 5.12.0), qml-module-qtgraphicaleffects (>= 5.12.0), qml-module-qtquick2 (>= 5.12.0), qml-module-qtqml-models2 (>= 5.12.0), qml-module-qtquick-controls (>= 5.12.0), python3-pyside2.qtcore (>= 5.12.0), python3-pyside2.qtqml (>= 5.12.0), python3-pyside2.qtgui (>= 5.12.0), python3-pyside2.qtquick (>= 5.12.0), python3-pyside2.qtwidgets (>= 5.12.0), python3-pyside2.qtmultimedia (>= 5.12.0), python3-pyside2.qtnetwork (>= 5.12.0) diff --git a/linux/debian/copyright b/linux/debian/copyright index 0752f06..2d22f6e 100644 --- a/linux/debian/copyright +++ b/linux/debian/copyright @@ -3,6 +3,6 @@ Upstream-Name: logarithmplotter Upstream-Contact: Ad5001 Files: * -Copyright: 2020, Ad5001 -License: GPL-3 +Copyright: 2022, Ad5001 +License: GPL-3.0+ diff --git a/linux/eu.ad5001.LogarithmPlotter.metainfo.flatpak.xml b/linux/eu.ad5001.LogarithmPlotter.metainfo.flatpak.xml index cf5d55f..7b584fb 100644 --- a/linux/eu.ad5001.LogarithmPlotter.metainfo.flatpak.xml +++ b/linux/eu.ad5001.LogarithmPlotter.metainfo.flatpak.xml @@ -1,5 +1,5 @@ - + eu.ad5001.LogarithmPlotter eu.ad5001.LogarithmPlotter.desktop @@ -9,9 +9,15 @@ LogarithmPlotter LogarithmPlotter - http://apps.ad5001.eu/icons/apps/logarithmplotter.svg - 2D plotter software to make BODE plots, sequences and repartition functions - Logiciel de traçage 2D pour les diagrammes de BODE, les suites et les fonctions de répartition + LogarithmPlotter + LogarithmPlotter + LogarithmPlotter + http://apps.ad5001.eu/icons/apps/svg/logarithmplotter.svg + 2D plotter software to make Bode plots, sequences and repartition functions + Logiciel de traçage 2D pour les diagrammes de Bode, les suites et les fonctions de répartition + 2D-Grafiksoftware zur Erstellung von Bode-Diagramms, Folgen und Verteilungsfunktionen + 2D-plotterprogramvare laget for opprettelse av Bode-diagram, sekvenser, og distribusjonsfunksjoner + Síkbeli ábrázolásszoftver Bode-ábrák, sorozatok és eloszlási funkciók készítéséhez

LogarithmPlotter is, as it's name suggests, a plotter made with logarithm scales in mind. With an object system similar to Geogebra's, it allows dynamic creation of plots with very few limitations. @@ -36,14 +42,16 @@ https://apps.ad5001.eu/logarithmplotter/ https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues/ https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki/ + https://hosted.weblate.org/engage/logarithmplotter/ https://apps.ad5001.eu/img/full/logarithmplotter.png https://apps.ad5001.eu/img/en/logarithmplotter/welcome.png - - + + + diff --git a/linux/eu.ad5001.LogarithmPlotter.metainfo.xml b/linux/eu.ad5001.LogarithmPlotter.metainfo.xml index 7253dfa..beb5cd4 100644 --- a/linux/eu.ad5001.LogarithmPlotter.metainfo.xml +++ b/linux/eu.ad5001.LogarithmPlotter.metainfo.xml @@ -1,5 +1,5 @@ - + eu.ad5001.LogarithmPlotter eu.ad5001.LogarithmPlotter.desktop @@ -9,9 +9,15 @@ LogarithmPlotter LogarithmPlotter - http://apps.ad5001.eu/icons/apps/logarithmplotter.svg -

2D plotter software to make BODE plots, sequences and repartition functions - Logiciel de traçage 2D pour les diagrammes de BODE, les suites et les fonctions de répartition + LogarithmPlotter + LogarithmPlotter + LogarithmPlotter + http://apps.ad5001.eu/icons/apps/svg/logarithmplotter.svg + 2D plotter software to make Bode plots, sequences and repartition functions + Logiciel de traçage 2D pour les diagrammes de Bode, les suites et les fonctions de répartition + 2D-Grafiksoftware zur Erstellung von Bode-Diagramms, Folgen und Verteilungsfunktionen + 2D-plotterprogramvare laget for opprettelse av Bode-diagram, sekvenser, og distribusjonsfunksjoner + Síkbeli ábrázolásszoftver Bode-ábrák, sorozatok és eloszlási funkciók készítéséhez

LogarithmPlotter is, as it's name suggests, a plotter made with logarithm scales in mind. With an object system similar to Geogebra's, it allows dynamic creation of plots with very few limitations. @@ -36,14 +42,16 @@ https://apps.ad5001.eu/logarithmplotter/ https://git.ad5001.eu/Ad5001/LogarithmPlotter/issues/ https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki/ + https://hosted.weblate.org/engage/logarithmplotter/ https://apps.ad5001.eu/img/full/logarithmplotter.png https://apps.ad5001.eu/img/en/logarithmplotter/welcome.png - - + + + diff --git a/linux/flatpak b/linux/flatpak new file mode 160000 index 0000000..f2b7490 --- /dev/null +++ b/linux/flatpak @@ -0,0 +1 @@ +Subproject commit f2b749016badccb23548d18041bfd0d3370daa15 diff --git a/linux/flatpak/eu.ad5001.LogarithmPlotter.json b/linux/flatpak/eu.ad5001.LogarithmPlotter.json deleted file mode 100644 index 4ca208e..0000000 --- a/linux/flatpak/eu.ad5001.LogarithmPlotter.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "app-id": "eu.ad5001.LogarithmPlotter", - "runtime": "org.kde.Platform", - "runtime-version": "5.15", - "sdk": "org.kde.Sdk", - "finish-args": [ - "--share=ipc", - "--device=dri", - "--socket=x11", - "--socket=wayland", - "--talk-name=org.freedesktop.DBus.Proprieties", - "--talk-name=org.freedesktop.IBus", - "--talk-name=org.freedestkop.portal.*", - "--filesystem=home" - ], - "command": "logarithmplotter", - "rename-desktop-file": "logarithmplotter.desktop", - "rename-icon": "logplotter", - "rename-appdata-file": "eu.ad5001.LogarithmPlotter.metainfo.xml", - "cleanup": [ ], - "post-install": [ - "install -D mimetypes /app/share/mime/packages/x-logarithm-plot.xml" - ], - "modules": [ - "python3-pyside2.json", - { - "name": "LogarithmPlotter", - "buildsystem": "simple", - "config-opts": ["no-debuginfo-compression"], - "build-commands": [ - "rm -rf .git", - "PREFIX=\"/app/share\" FLATPAK_INSTALL=1 python3 setup.py install --prefix=/app" - ], - "sources": [ - { - "type": "git", - "url": "https://git.ad5001.eu/Ad5001/LogarithmPlotter" - } - ] - } - ] -} diff --git a/linux/flatpak/python3-pyside2.json b/linux/flatpak/python3-pyside2.json deleted file mode 100644 index 7865949..0000000 --- a/linux/flatpak/python3-pyside2.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "python3-pyside2", - "buildsystem": "simple", - "build-commands": [], - "config-opts": [], - "modules": [ - { - "name": "PySide2", - "buildsystem": "cmake-ninja", - "builddir": true, - "config-opts": [ - "-DCMAKE_BUILD_TYPE=Release", - "-DBUILD_TESTS=OFF" - ], - "sources": [ - { - "type": "archive", - "url": "https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.2-src/pyside-setup-opensource-src-5.15.2.tar.xz", - "sha256": "b306504b0b8037079a8eab772ee774b9e877a2d84bab2dbefbe4fa6f83941418" - }, - { - "type": "shell", - "commands": [ - "mkdir -p /app/include/qt5tmp && cp -R /usr/include/Qt* /app/include/qt5tmp # https://bugreports.qt.io/broswse/PYSIDE-787", - "sed -i 's|--include-paths=|--include-paths=/app/include/qt5tmp:|' sources/pyside2/cmake/Macros/PySideModules.cmake" - ] - } - ] - - } - ] -} diff --git a/linux/logarithmplotter.desktop b/linux/logarithmplotter.desktop index 791b897..cb9b52f 100644 --- a/linux/logarithmplotter.desktop +++ b/linux/logarithmplotter.desktop @@ -4,8 +4,13 @@ Type=Application Name=LogarithmPlotter GenericName=2D plotter software GenericName[fr]=Logiciel de traçage 2D -Comment=Create BODE diagrams, sequences and repartition functions. -Comment[fr]=Créer des diagrammes de BODE, des suites et des fonctions de répartition. +GenericName[de]=2D-Grafiksoftware +GenericName[no]=2D-plotterprogramvare +GenericName[hu]=Síkbeli ábrázolásszoftver +Comment=Create BODE diagrams, sequences and distribution functions +Comment[fr]=Créer des diagrammes de BODE, des suites et des fonctions de répartition +Comment[de]=Erstellung von Bode-Diagramms, Folgen und Verteilungsfunktionen +Comment[hu]=Bode-ábrák, sorozatok és újraosztási függvények létrehozása TryExec=logarithmplotter Exec=logarithmplotter %f @@ -13,4 +18,4 @@ Icon=logarithmplotter MimeType=application/x-logarithm-plot; Terminal=false StartupNotify=false -Categories=Math +Categories=Science diff --git a/linux/logplotter.desktop b/linux/logplotter.desktop index fcfb08d..1c46f8f 100644 --- a/linux/logplotter.desktop +++ b/linux/logplotter.desktop @@ -4,12 +4,17 @@ Type=Application Name=LogarithmPlotter GenericName=2D plotter software GenericName[fr]=Logiciel de traçage 2D -Comment=Create BODE diagrams, sequences and repartition functions. -Comment[fr]=Créer des diagrammes de BODE, des suites et des fonctions de répartition. +GenericName[de]=2D-Grafiksoftware +GenericName[no]=2D-plotterprogramvare +GenericName[hu]=Síkbeli ábrázolásszoftver +Comment=Create BODE diagrams, sequences and distribution functions +Comment[fr]=Créer des diagrammes de BODE, des suites et des fonctions de répartition +Comment[de]=Erstellung von Bode-Diagramms, Folgen und Verteilungsfunktionen +Comment[hu]=Bode-ábrák, sorozatok és újraosztási függvények létrehozása Exec=/usr/bin/python3 ROOTFOLDER/run.py %f Icon=logarithmplotter MimeType=application/x-logarithm-plot; Terminal=false StartupNotify=false -Categories=Math +Categories=Science diff --git a/package-linux.sh b/package-linux.sh index 361161a..b29636e 100755 --- a/package-linux.sh +++ b/package-linux.sh @@ -1,8 +1,14 @@ #!/bin/bash +# Building translations +cd "LogarithmPlotter/i18n/" +bash release.sh +cd ../../ + +# Deb python3 setup.py --remove-git-version --command-packages=stdeb.command sdist_dsc \ - --package logarithmplotter --copyright-file linux/debian/copyright --suite sid --depends3 "$(cat linux/debian/depends)" --section science \ - --debian-version "ppa1" bdist_deb + --package logarithmplotter --copyright-file linux/debian/copyright --suite impish --depends3 "$(cat linux/debian/depends)" --section science \ + bdist_deb # Flatpak building FLATPAK_BUILDER=$(which flatpak-builder) diff --git a/package-macosx.sh b/package-macosx.sh index 6e07cac..efa9057 100644 --- a/package-macosx.sh +++ b/package-macosx.sh @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=0.1-dev0 +VERSION=0.1.4 title="LogarithmPlotter v${VERSION} Setup" finalDMGName="LogarithmPlotter-v${VERSION}-setup.dmg" applicationName=LogarithmPlotter diff --git a/run.py b/run.py index ead8e33..3849b2f 100644 --- a/run.py +++ b/run.py @@ -1,5 +1,32 @@ +""" + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. + * Copyright (C) 2022 Ad5001 + * + * 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 . +""" +def update_translations(): + """ + Updates all binary translations + """ + from os import system, getcwd, chdir, path + pwd = getcwd() + chdir(path.join("LogarithmPlotter", "i18n")) + system("./release.sh") + chdir(pwd) def run(): + update_translations() from LogarithmPlotter import logarithmplotter logarithmplotter.run() diff --git a/setup.py b/setup.py index 75b474f..069fd34 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ """ - * LogarithmPlotter - Create graphs with logarithm scales. + * LogarithmPlotter - 2D plotter software to make BODE plots, sequences and repartition functions. * Copyright (C) 2022 Ad5001 * * This program is free software: you can redistribute it and/or modify @@ -125,7 +125,7 @@ setuptools.setup( name='logarithmplotter', version=pkg_version, - description='Create graphs with logarithm scales.', + description='2D plotter software to make BODE plots, sequences and repartition functions.', long_description=read_file("README.md"), keywords='logarithm plotter graph creator bode diagram', diff --git a/snapcraft.yaml b/snapcraft.yaml index 1c505cb..79be335 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -1,7 +1,7 @@ name: logarithmplotter title: LogarithmPlotter -version: '0.1.3' -summary: 2D plotter software to make BODE plots, sequences and repartition functions. +version: '0.1.4' +summary: 2D plotter software to make Bode plots, sequences and repartition functions. description: | LogarithmPlotter is, as it's name suggests, a plotter made with logarithm scales in mind. With an object system similar to [Geogebra](https://geogebra.org)'s, it allows dynamic creation of plots with very few limitations. It's primary use is to quickly create [asymptotic Bode plots](https://en.wikipedia.org/wiki/Bode_plot), but it's extensible nature and ability to switch to non-logarithmic scales allow it to create other things with it, like sequences or statistical repartition functions. diff --git a/win/installer.nsi b/win/installer.nsi index 662a659..d1eae3c 100644 --- a/win/installer.nsi +++ b/win/installer.nsi @@ -11,8 +11,9 @@ Unicode True !define PROG_ID "LogarithmPlotter.File.1" !define DEV_NAME "Ad5001" !define WEBSITE "https://apps.ad5001.eu/logarithmplotter" -!define APP_VERSION "0.1.0.0" -!define COPYRIGHT "Ad5001 (c) 2021" +!define VERSION_SHORT "0.1.4" +!define APP_VERSION "${VERSION_SHORT}.0" +!define COPYRIGHT "Ad5001 (c) 2022" !define DESCRIPTION "Create graphs with logarithm scales." !define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\LogarithmPlotter" @@ -25,7 +26,7 @@ Unicode True Name "${APP_NAME}" Caption "${APP_NAME}" BrandingText "${APP_NAME}" -OutFile "logarithmplotter-setup.exe" +OutFile "logarithmplotter-v${VERSION_SHORT}-setup.exe" RequestExecutionLevel admin ;Default installation folder @@ -45,10 +46,10 @@ VIAddVersionKey "FileVersion" "${APP_VERSION}" ;-------------------------------- ;defines MUST come before pages to apply to them -!define MUI_PAGE_HEADER_TEXT "${APP_NAME} v${APP_VERSION}" +!define MUI_PAGE_HEADER_TEXT "${APP_NAME} v${VERSION_SHORT}" !define MUI_PAGE_HEADER_SUBTEXT "${COPYRIGHT}" -!define MUI_WELCOMEPAGE_TITLE "Install ${APP_NAME} v${APP_VERSION}" +!define MUI_WELCOMEPAGE_TITLE "Install ${APP_NAME} v${VERSION_SHORT}" !define MUI_WELCOMEPAGE_TEXT "Welcome to the ${APP_NAME} installer! Follow the steps provided by this installer to install ${APP_NAME}" !define MUI_HEADERIMAGE_RIGHT ;Extra space for the title area @@ -88,9 +89,9 @@ Icon "logarithmplotter.ico" ;!define MUI_DIRECTORYPAGE_VARIABLE $INSTDIR !define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "Success!" -!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "${APP_NAME} v${APP_VERSION} was installed on your computer" +!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "${APP_NAME} v${VERSION_SHORT} was installed on your computer" !define MUI_INSTFILESPAGE_ABORTHEADER_TEXT "There was an error during the installation process." -!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "${APP_NAME} v${APP_VERSION} was not installed on your computer." +!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "${APP_NAME} v${VERSION_SHORT} was not installed on your computer." !define MUI_FINISHPAGE_TITLE "Finished!" ;!define MUI_FINISHPAGE_TITLE_3LINES