feat(i18n): translate the interface and the journal at runtime
The language setting was plumbing with nothing behind it: no catalogue shipped, and every label was a bare QStringLiteral, so picking English changed nothing. A catalogue is now a JSON file read as it is, translations/<code>.json, keyed by the French source string. No Linguist, no lrelease, no build step: a new language costs one file. The catalogues the application ships with are compiled into the binary, so the chosen language works whatever the install layout is, while one dropped into a translations folder still wins over it. "System" reads what the FWS install left behind — LC_ALL, LC_MESSAGES, LANG, then the LANG= line of /etc/locale.conf — so the interface follows the language chosen at install time without the user configuring anything. Fixes #16
This commit is contained in:
9 files changed
+882
-42
No files matched your search
@@ -57,11 +57,15 @@ public:
|
||||
void setDragDropEnabled(bool enabled);
|
||||
|
||||
// ---- Language ----
|
||||
// "system" to follow the desktop, or one of knownLanguages(). Unknown codes
|
||||
// fall back to "fr", the language the interface is written in.
|
||||
// "system" to follow the language the system asks for, or one of
|
||||
// knownLanguages(). Unknown codes fall back to "fr", the language the
|
||||
// interface is written in.
|
||||
QString language() const;
|
||||
void setLanguage(const QString& code);
|
||||
static QStringList knownLanguages();
|
||||
// Endonym of a known code, so the list reads in its own language whatever
|
||||
// the interface is set to. Falls back to the code itself.
|
||||
static QString languageName(const QString& code);
|
||||
static QString sanitizeLanguage(const QString& code);
|
||||
|
||||
// ---- Application updates (PacManager itself, not the system packages) ----
|
||||
|
||||
Reference in new issue
Block a user