From 2c7b6581747d608485739e2bcbeddf9f3d41b315 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Fri, 26 Aug 2022 12:56:52 +0300 Subject: [PATCH 1/2] fix: use user set translator only if project supports that translator --- src/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/default.nix b/src/default.nix index 29abcfe4ce..582901835d 100644 --- a/src/default.nix +++ b/src/default.nix @@ -474,7 +474,12 @@ in let invalidationHash = getInvalidationHash project; key = getProjectKey project; resolved = isResolved self; - translator = project.translator or (l.head project.translators); + translator = + if + (project ? translator) + && l.any (t: project.translator == t) project.translators + then project.translator + else l.head project.translators; }; in self)) From 35d8e4cce153767727739878aaa6d390a24e8861 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Fri, 26 Aug 2022 13:05:13 +0300 Subject: [PATCH 2/2] fix: use user set translator if the discoverer didn't set any translators --- src/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/default.nix b/src/default.nix index 582901835d..ad3b3ce8ee 100644 --- a/src/default.nix +++ b/src/default.nix @@ -477,7 +477,10 @@ in let translator = if (project ? translator) - && l.any (t: project.translator == t) project.translators + && ( + (! project ? translators) + || (l.any (t: project.translator == t) project.translators) + ) then project.translator else l.head project.translators; };