Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/translation.py
diff options
context:
space:
mode:
authorDaniel <blackrabbit256@gmail.com>2022-02-15 18:44:58 +1100
committerGitHub <noreply@github.com>2022-02-15 08:44:58 +0100
commit6489a417aa8d43bd58ec0fd1268d0dd734b0073f (patch)
tree476033ff0d6a2650ff5202f42b248e7b4bbe2f8d /archinstall/lib/translation.py
parentd9118a33b3a25839fde8626cde313115ddb79376 (diff)
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 <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/translation.py')
-rw-r--r--archinstall/lib/translation.py8
1 files changed, 8 insertions, 0 deletions
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)