Commit 80b09745 authored by emmapeel's avatar emmapeel

added comments for translators to skip translating variable names.

this comments appear on the translation files and help translators do
their work.
parent fc9db8fd
......@@ -92,6 +92,7 @@ class ASPConfigApplicationWindow(Gtk.ApplicationWindow):
Gtk.DialogFlags.DESTROY_WITH_PARENT,
Gtk.MessageType.QUESTION,
Gtk.ButtonsType.NONE,
# Translators: Don't translate {package}, it's a placeholder and will be replaced.
_("Remove {package} from your additional software? "
"This will stop installing the package "
"automatically.").format(package=package_name))
......@@ -102,6 +103,7 @@ class ASPConfigApplicationWindow(Gtk.ApplicationWindow):
self.remove_asp_func(package_name)
except subprocess.CalledProcessError as e:
self.__show_exception_dialog(
# Translators: Don't translate {pkg}, it's a placeholder and will be replaced.
_("Failed to remove {pkg}").format(pkg=package_name),
e)
dialog.destroy()
......@@ -148,6 +150,7 @@ class ASPConfigApplicationWindow(Gtk.ApplicationWindow):
Gtk.IconSize.SMALL_TOOLBAR)
remove_button.set_relief(Gtk.ReliefStyle.NONE)
remove_button.set_tooltip_text(
# Translators: Don't translate {package}, it's a placeholder and will be replaced.
_("Stop installing {package} "
"automatically").format(package=package_name))
remove_button.connect(
......
......@@ -53,12 +53,18 @@ class Volume(object):
block_label = self.udisks_object.get_block().props.id_label
partition = self.udisks_object.get_partition()
if block_label:
# Translators: Don't translate {volume_label} or {volume_size},
# it's a placeholder and will be replaced.
return _("{volume_label} ({volume_size})").format(volume_label=block_label,
volume_size=self.size_for_display)
elif partition and partition.props.name:
# Translators: Don't translate {partition_name} or {partition_size},
# it's a placeholder and will be replaced.
return _("{partition_name} ({partition_size})").format(partition_name=partition.props.name,
partition_size=self.size_for_display)
else:
# Translators: Don't translate {volume_size}, it's a placeholder
# and will be replaced.
return _("{volume_size} Volume").format(volume_size=self.size_for_display)
@property
......
......@@ -129,6 +129,7 @@ class VolumeManager(object):
try:
fd = os.open(path, os.O_RDONLY)
warning["title"] = _("Container opened read-only")
# Translators: Don't translate {path}, it's a placeholder and will be replaced.
warning["body"] = _("The file container {path} could not be opened with write access. "
"It was opened read-only instead. You will not be able to modify the "
"content of the container.\n"
......
......@@ -213,6 +213,7 @@ def _format_iterable(iterable):
if len(iterable) == 1:
return iterable[0]
elif len(iterable) > 1:
# Translators: Don't translate {beginning} or {last}, they are placeholders and will be replaced.
return _("{beginning} and {last}").format(
beginning=_(", ").join(iterable[:-1]), last=iterable[-1])
else:
......@@ -278,6 +279,7 @@ def handle_installed_packages(packages):
"""
logging.info("New packages manually installed: %s" % packages)
if has_unlocked_persistence(search_new_persistence=True):
# Translators: Don't translate {packages}, it's a placeholder and will be replaced.
if _notify(_("Add {packages} to your additional software?").format(
packages=_format_iterable(packages)),
_("To install it automatically from your persistent "
......@@ -342,8 +344,10 @@ def handle_removed_packages(packages):
actually remove them if requested.
"""
logging.info("Additional packages removed: %s" % packages)
# Translators: Don't translate {packages}, it's a placeholder and will be replaced.
if _notify(_("Remove {packages} from your additional software?").format(
packages=_format_iterable(packages)),
# Translators: Don't translate {packages}, it's a placeholder and will be replaced.
_("This will stop installing {packages} automatically.").format(
packages=_format_iterable(packages)),
_("Remove"),
......
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