Commit 52d1b828 authored by segfault's avatar segfault

Translate and change style of transaction status messages

parent 7a4e684a
......@@ -119,28 +119,28 @@ class OnionService(DBusObject, metaclass=abc.ABCMeta):
logger.info("Installing service %r", self.Name)
self.Status = Status.INSTALLING
try:
self.TransactionStatus = "starting container to install packages"
self.TransactionStatus = _("Starting container to install packages")
self.container.create()
with self.container.run():
self.container.install_packages(self.packages)
self.TransactionStatus = "service configuration"
self.TransactionStatus = _("Configuring service")
self.create_state_dir()
self.create_data_files()
self.Address = self.private_key.derive_onion_address()
self.configure()
self.TransactionStatus = "bind-mounting config files"
self.TransactionStatus = _("Bind-mounting config files")
# XXX: We could mount during the same container run where we install packages,
# to reduce installation time.
with self.container.run():
self.mount()
self.TransactionStatus = "initializing options"
self.TransactionStatus = _("Initializing options")
self.initialize_options()
self.TransactionStatus = "more service configuration"
self.TransactionStatus = _("Configuring options")
self.configure_options()
self.is_installed_file.touch()
......@@ -159,13 +159,13 @@ class OnionService(DBusObject, metaclass=abc.ABCMeta):
if self.IsPublished:
TorManager(self).stop_hidden_service()
self.TransactionStatus = "stopping container"
self.TransactionStatus = _("Stopping container")
self.container.stop()
self.TransactionStatus = "destroying container"
self.TransactionStatus = _("Destroying container")
self.container.destroy()
self.TransactionStatus = "remove service state directory"
self.TransactionStatus = _("Removing service state directory")
self.remove_state_dir()
self.remove_options()
......@@ -190,7 +190,7 @@ class OnionService(DBusObject, metaclass=abc.ABCMeta):
self.Status = Status.STARTING
if not self.container.is_running():
self.TransactionStatus = "starting container"
self.TransactionStatus = _("Starting container")
self.container.start()
if not self.IsRunning:
......
......@@ -6,6 +6,7 @@ from contextlib import contextmanager
import stem
from stem.control import Controller, EventType
from onionkit import _
from onionkit.util import process_mainloop_events
# Only required for type hints
......@@ -49,7 +50,7 @@ class TorManager(object):
key_content = self.onion_service.private_key.read()
key_type = "RSA1024"
self.onion_service.TransactionStatus = "start hidden service"
self.onion_service.TransactionStatus = _("Creating onion service")
with self.hs_desc_listener():
response = self.controller.create_ephemeral_hidden_service(
......@@ -67,7 +68,7 @@ class TorManager(object):
raise HSException("Onion address %r does not match precalculated address %r" % (address, self.onion_service.Address))
self._wait_for_publication(response)
self.onion_service.TransactionStatus = "hidden service created"
self.onion_service.TransactionStatus = _("Onion service created")
def stop_hidden_service(self):
self.onion_service.TransactionStatus = "remove hidden service"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment