trojita: enable localization
This commit is contained in:
parent
e30fea932c
commit
ffdb3d65e4
@ -1,6 +1,7 @@
|
|||||||
{ akonadi-contacts
|
{ akonadi-contacts
|
||||||
, cmake
|
, cmake
|
||||||
, fetchgit
|
, fetchgit
|
||||||
|
, fetchsvn
|
||||||
, gnupg
|
, gnupg
|
||||||
, gpgme
|
, gpgme
|
||||||
, kcontacts
|
, kcontacts
|
||||||
@ -15,11 +16,14 @@
|
|||||||
, qtkeychain
|
, qtkeychain
|
||||||
, qttools
|
, qttools
|
||||||
, qtwebkit
|
, qtwebkit
|
||||||
|
, qttranslations
|
||||||
|
, substituteAll
|
||||||
|
, withI18n ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
mkDerivation rec {
|
mkDerivation rec {
|
||||||
pname = "trojita";
|
pname = "trojita";
|
||||||
version = "0.7.20200706";
|
version = "unstable-2020-07-06";
|
||||||
|
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://anongit.kde.org/trojita.git";
|
url = "https://anongit.kde.org/trojita.git";
|
||||||
@ -27,6 +31,18 @@ mkDerivation rec {
|
|||||||
sha256 = "0r8nmlqwgsqkk0k8xh32fkwvv6iylj35xq2h8b7l3g03yc342kbn";
|
sha256 = "0r8nmlqwgsqkk0k8xh32fkwvv6iylj35xq2h8b7l3g03yc342kbn";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
l10n = fetchsvn {
|
||||||
|
url = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5";
|
||||||
|
rev = "1566642";
|
||||||
|
sha256 = "0y45fjib153za085la3hqpryycx33dkj3cz8kwzn2w31kvldfl1q";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = (substituteAll {
|
||||||
|
# See https://github.com/NixOS/nixpkgs/issues/86054
|
||||||
|
src = ./fix-qttranslations-path.patch;
|
||||||
|
inherit qttranslations;
|
||||||
|
});
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
akonadi-contacts
|
akonadi-contacts
|
||||||
gpgme
|
gpgme
|
||||||
@ -48,6 +64,14 @@ mkDerivation rec {
|
|||||||
gnupg
|
gnupg
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = "echo ${version} > src/trojita-version"
|
||||||
|
+ lib.optionalString withI18n ''
|
||||||
|
mkdir -p po
|
||||||
|
for f in `find ${l10n} -name "trojita_common.po"`; do
|
||||||
|
cp $f po/trojita_common_$(echo $f | cut -d/ -f5).po
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A Qt IMAP e-mail client";
|
description = "A Qt IMAP e-mail client";
|
||||||
homepage = "http://trojita.flaska.net/";
|
homepage = "http://trojita.flaska.net/";
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
diff --git i/src/Gui/main.cpp w/src/Gui/main.cpp
|
||||||
|
index 851db4f1..e997f46e 100644
|
||||||
|
--- i/src/Gui/main.cpp
|
||||||
|
+++ w/src/Gui/main.cpp
|
||||||
|
@@ -52,7 +52,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
|
QTranslator qtTranslator;
|
||||||
|
qtTranslator.load(QLatin1String("qt_") + QLocale::system().name(),
|
||||||
|
- QLibraryInfo::location(QLibraryInfo::TranslationsPath));
|
||||||
|
+ QLatin1String("@qttranslations@/translations"));
|
||||||
|
app.installTranslator(&qtTranslator);
|
||||||
|
|
||||||
|
QLatin1String localeSuffix("/locale");
|
Loading…
x
Reference in New Issue
Block a user