gtk: interface GTK4, préférences, versions, traductions, licence MIT
- interface gtkmm-4 : véhicules, ajout par VIN, mises à jour, dossier, téléchargement avec reprise et arrêt, choix de la clé, confirmation, écriture avec progression, fin avec guide d'installation ; travail dans un thread, résultats renvoyés via Glib::Dispatcher - préférences : dossier de téléchargement, langue (système par défaut), recherche automatique de nouvelle version d'OpenPU - recherche de nouvelle version (releases GitHub, format tags Gitea accepté) avec ouverture de la page dans le navigateur ; openpu-cli app-update - versions : project(VERSION) + git describe régénéré à chaque build, openpu-cli --version, À propos, User-Agent, CHANGELOG, tools/release.sh (étiquette annotée, push vers tous les remotes, release GitHub) - traductions gettext : textes anglais, fr.po complet (96 chaînes), extracteur de secours sans xgettext - core : module job (téléchargement licence/fw/carte), liens des guides PDF, ordre des véhicules conservé (ordered_json) - licence MIT (LICENSE, en-têtes SPDX) ; dépôt principal sur GitHub - validé dans WSLg : parcours complet jusqu'à l'écriture d'une clé loop (FAT32 propre, fichiers téléchargés supprimés) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDASLCiN764v685boRVYar
This commit is contained in:
1 parent
6a7a2f1ee9
commit
384aaf78c6
62 files changed
+3029
-20
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""Fallback string extractor when xgettext is not available.
|
||||
|
||||
Collects _("...") calls (with adjacent literal concatenation) from C++ sources and writes a
|
||||
gettext template. Prefer `cmake --build <dir> --target pot` (xgettext) when gettext is installed.
|
||||
|
||||
usage: python3 tools/extract_strings.py po/openpu.pot src/ui-gtk/main_window.cpp ...
|
||||
"""
|
||||
import re
|
||||
import sys
|
||||
|
||||
CALL = re.compile(r'\b_\(\s*((?:"(?:[^"\\]|\\.)*"\s*)+)\)', re.S)
|
||||
LITERAL = re.compile(r'"((?:[^"\\]|\\.)*)"')
|
||||
|
||||
|
||||
def main():
|
||||
out, *sources = sys.argv[1:]
|
||||
seen = {}
|
||||
for path in sources:
|
||||
text = open(path, encoding="utf-8").read()
|
||||
for m in CALL.finditer(text):
|
||||
msgid = "".join(LITERAL.findall(m.group(1)))
|
||||
line = text.count("\n", 0, m.start()) + 1
|
||||
seen.setdefault(msgid, []).append(f"{path}:{line}")
|
||||
with open(out, "w", encoding="utf-8", newline="\n") as f:
|
||||
f.write('msgid ""\nmsgstr ""\n"Project-Id-Version: openpu\\n"\n'
|
||||
'"Content-Type: text/plain; charset=UTF-8\\n"\n"Content-Transfer-Encoding: 8bit\\n"\n')
|
||||
for msgid, refs in seen.items():
|
||||
f.write("\n#: " + " ".join(refs) + "\n")
|
||||
if "%1" in msgid:
|
||||
f.write("#, qt-format\n")
|
||||
f.write(f'msgid "{msgid}"\nmsgstr ""\n')
|
||||
print(f"{len(seen)} strings -> {out}")
|
||||
|
||||
|
||||
main()
|
||||
Reference in new issue
Block a user