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-06 21:30:26 +1100
committerGitHub <noreply@github.com>2022-02-06 11:30:26 +0100
commit9fb8d3164ce07e6cd08fe60f2e6f1203ccb8991a (patch)
tree8e525e9d65ab48da74602bec20e68e5cae51d754 /archinstall/lib/translation.py
parentec73bdab4cf124aba16e10293e5e75a3bc89afb8 (diff)
Update nationalization (#944)
* Update nationalization * Update translations * Finish german translation * Fix errors #943 * Add remaining translations * Fix alignment in menu * Update README * Update translations: * Fix flake8 * Update tz function Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/translation.py')
-rw-r--r--archinstall/lib/translation.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/archinstall/lib/translation.py b/archinstall/lib/translation.py
index 1ae6989d..16556fbe 100644
--- a/archinstall/lib/translation.py
+++ b/archinstall/lib/translation.py
@@ -28,7 +28,7 @@ class Languages:
class DeferredTranslation:
- def __init__(self, message):
+ def __init__(self, message: str):
self.message = message
def __len__(self) -> int:
@@ -40,6 +40,15 @@ class DeferredTranslation:
return self.message
return translate(self.message)
+ def __lt__(self, other) -> bool:
+ return self.message < other
+
+ def __gt__(self, other) -> bool:
+ return self.message > other
+
+ def format(self, *args) -> str:
+ return self.message.format(*args)
+
@classmethod
def install(cls):
import builtins
@@ -48,8 +57,6 @@ class DeferredTranslation:
class Translation:
def __init__(self, locales_dir):
- DeferredTranslation.install()
-
self._languages = {}
for name in self.get_all_names():