From 6489a417aa8d43bd58ec0fd1268d0dd734b0073f Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 15 Feb 2022 18:44:58 +1100 Subject: Fix #966 - DeferredTranslation errors (#976) * Fix #966 * Add types to parameters * Update network configuration * Backwards compability for nic config * Update Co-authored-by: Daniel Girtler --- archinstall/lib/translation.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'archinstall/lib/translation.py') diff --git a/archinstall/lib/translation.py b/archinstall/lib/translation.py index b8a27fed..767d6d36 100644 --- a/archinstall/lib/translation.py +++ b/archinstall/lib/translation.py @@ -8,6 +8,7 @@ from pathlib import Path from typing import List, Dict from .exceptions import TranslationError + class Languages: def __init__(self): self._mappings = self._get_language_mappings() @@ -46,6 +47,13 @@ class DeferredTranslation: def __gt__(self, other) -> bool: return self.message > other + def __add__(self, other) -> DeferredTranslation: + if isinstance(other, str): + other = DeferredTranslation(other) + + concat = self.message + other.message + return DeferredTranslation(concat) + def format(self, *args) -> str: return self.message.format(*args) -- cgit v1.2.3-70-g09d2