On Fri, Jul 19, 2019 at 02:29:52PM +0200, pelzflorian (Florian Pelz) wrote: > I will try writing a custom xgettext that combines > nested·s-expressions·that are marked for translation with G_ > to·a·single·msgstr that gets written to the·PO·file. This combined > string will not be part of the source code but will be generated from > a nested sexp. The PO file containing the combined strings can then > be translated as usual. For reading the translation, the combined > msgstr will be constructed again by the marking procedure G_ and > looked up by reading from an MO file. >
I have implemented a working translation tool. Sexp-xgettext generates from an SHTML or other Scheme file with marked s-expressions a POT file which can be translated and turned into an MO file from which the code generates a localized HTML builder. The advantage is that existing SHTML will just have to be marked with G_ and no format string has to be written, although sometimes the SHTML should be adapted to produce a less complicated message in the POT file. Find attached an example of a marked Scheme file home.scm generating guix-website.pot, which after manual translation generates the attached guix.de_DE.html. Marking a string for translation behaves like normal gettext. Marking a parenthesized expression (i.e. a list or procedure call) extracts each string from the parenthesized expression. If a symbol, keyword or other parenthesized expression occurs between the strings, it is extracted as an XML element. Expressions before or after all strings are not extracted. If strings from a parenthesized sub-expression shall be extracted too, the sub-expression must again be marked with G_ unless it is the only sub-expression or it follows a quote, unquote, quasiquote or unquote-splicing. The order of XML elements can be changed in the translation to produce a different ordering inside a parenthesized expression. If a string shall not be extracted from a marked expression, it must be wrapped, for example by a call to the identity procedure. But there are still some bugs like missing line numbers and non-working pgettext and the code is not clear enough yet. I will send a patch series tomorrow after I fixed these issues (even though the documentation won’t be near as good as sirgazil’s format strings). Regards, Florian
home.scm
Description: Lotus Screencam
guix-website.pot
Description: MS-Powerpoint presentation
Guix
Zusammenfassung
- Befreiend. Guix ist eine fortgeschrittende Distribution des GNU-Betriebssystems, das vom GNU-Projekt entwickelt wurde und die Freiheit der Benutzer von Rechengeräten respektiert.
- Verlässlich. Guix unterstützt transaktionelle Aktualisierungen und Rücksetzungen, „unprivilegierte“ Paketverwaltung für Nutzer ohne besondere Berechtigungen und noch mehr. Wenn es als eigenständige Distribution verwendet wird, unterstützt Guix eine deklarative Konfiguration des Systems für transparente und reproduzierbare Betriebssysteme.
- Hackbar. Programmierschnittstellen (APIs) in Guile Scheme werden zur Verfügung gestellt, einschließlich hochsprachlicher eingebetteter domänenspezifischer Sprachen (Embedded Domain-Specific Languages, EDSLs), mit denen Sie Pakete definieren und Konfigurationen des gesamten Systems festlegen können.
Entdecken Sie Guix
Mit Guix kommen Tausende von Paketen. Dazu gehören Anwendungen, Systemwerkzeuge, Dokumentation, Schriftarten, sowie andere digitale Güter, die jederzeit zur Installation mit dem Paketverwaltungswerkzeug GNU Guix bereitstehen.
GNU Guix in Ihrem Bereich
Lesen Sie ein paar Erfahrungen, wie die Leute GNU Guix in ihrem täglichen Leben benutzen.
GNU Guix auf anderen GNU/Linux-Distributionen
Wenn Sie GNU Guix nicht als eine eigenständige GNU/Linux-Distribution verwenden, können Sie es trotzdem zur Paketverwaltung benutzen, aufgesetzt auf eine beliebige bestehende GNU/Linux-Distribution. Auf diese Weise können Sie all seine Vorteile genießen.
Guix und das Paketverwaltungswerkzeug, das mit Ihrer Distribution ausgeliefert wird, werden sich gegenseitig nicht stören. Sie können friedlich koexistieren.
Blog
Towards Guix for DevOps
Juli 12, 2019
Hey, there! I'm Jakob, a Google Summer of Code intern and new contributor to Guix. Since May, I've been working on a DevOps automation tool for the Guix System, which…
Substitutes are now available as lzip
Juni 17, 2019
For a long time, our build farm at ci.guix.gnu.org has been delivering substitutes (pre-built binaries) compressed with gzip. Gzip was never the best choice in terms of compression…
Creating and using a custom Linux kernel on Guix System
Mai 21, 2019
Guix is, at its core, a source based distribution with substitutes , and as such building packages from their source code is an expected part of regular package installations and…
Kontakt
IRC Channel
Join the #guix channel on the Freenode IRC network to chat with the community about GNU Guix or to get help in …
Info Mailing List
Subscribe to the info-guix low-traffic mailing list to receive important announcements sent by the project maintainers (in English). …
Help Mailing List
Subscribe to the Help mailing list to get support from the GNU Guix community via email. You can post messages in English though we also accept other languages.…