diff sat/core/i18n.py @ 3877:00212260f659

plugin XEP-0420: Implementation of Stanza Content Encryption: Includes implementation of XEP-0082 (XMPP date and time profiles) and tests for both new plugins. Everything is type checked, linted, format checked and unit tested. Adds new dependency xmlschema. fix 377
author Syndace <me@syndace.dev>
date Tue, 23 Aug 2022 12:04:11 +0200
parents be6d91572633
children 524856bd7b19
line wrap: on
line diff
--- a/sat/core/i18n.py	Tue Aug 23 23:37:22 2022 +0200
+++ b/sat/core/i18n.py	Tue Aug 23 12:04:11 2022 +0200
@@ -17,6 +17,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+from typing import Callable, cast
 
 from sat.core.log import getLogger
 
@@ -40,10 +41,10 @@
 except ImportError:
 
     log.warning("gettext support disabled")
-    _ = lambda msg: msg  # Libervia doesn't support gettext
+    _ = cast(Callable[[str], str], lambda msg: msg)  # Libervia doesn't support gettext
 
     def languageSwitch(lang=None):
         pass
 
 
-D_ = lambda msg: msg  # used for deferred translations
+D_ = cast(Callable[[str], str], lambda msg: msg)  # used for deferred translations