From c364e4fc38f2520135c235805badc4ac57b0e797 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 19 Apr 2019 17:08:53 +0200 Subject: [PATCH] [dracut] [fstab] Translate module names and error messages --- src/modules/dracut/main.py | 16 ++++++++++++++-- src/modules/fstab/main.py | 11 +++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/modules/dracut/main.py b/src/modules/dracut/main.py index 64dcd4e8e..a929ac70b 100644 --- a/src/modules/dracut/main.py +++ b/src/modules/dracut/main.py @@ -6,6 +6,7 @@ # Copyright 2014-2015, Philip Müller # Copyright 2014, Teo Mrnjavac # Copyright 2017, Alf Gaida +# Copyright 2019, Adriaan de Groot # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,6 +25,17 @@ import libcalamares from libcalamares.utils import target_env_call +import gettext +_ = gettext.translation("calamares-python", + localedir=libcalamares.utils.gettext_path(), + languages=libcalamares.utils.gettext_languages(), + fallback=True).gettext + + +def pretty_name(): + return _("Creating initramfs with dracut.") + + def run_dracut(): """ Creates initramfs, even when initramfs already exists. @@ -43,5 +55,5 @@ def run(): return_code = run_dracut() if return_code != 0: - return ("Failed to run dracut on the target", - "The exit code was {}".format(return_code)) + return ( _("Failed to run dracut on the target"), + _("The exit code was {}").format(return_code) ) diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index b3a092924..1aea5523e 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -6,6 +6,7 @@ # Copyright 2014, Aurélien Gâteau # Copyright 2016, Teo Mrnjavac # Copyright 2017, Alf Gaida +# Copyright 2019, Adriaan de Groot # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +27,16 @@ import subprocess import libcalamares +import gettext +_ = gettext.translation("calamares-python", + localedir=libcalamares.utils.gettext_path(), + languages=libcalamares.utils.gettext_languages(), + fallback=True).gettext + + +def pretty_name(): + return _("Writing fstab.") + FSTAB_HEADER = """# /etc/fstab: static file system information. #