summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2020-09-14 09:57:15 +0000
committerintrigeri <intrigeri@boum.org>2020-09-22 15:05:01 +0000
commite5f4f1be391835bdf577e34d38baeca0b211a293 (patch)
tree1177ea028baf9dace78235d4091dda92cbf624da /config/chroot_local-includes
parente11416527553ade809135301da0b7036fde0753e (diff)
Upgrader, Persistence wizard: set the UTF-8 flag on all strings returned by Locale::TextDomain
… so we don't have to manually decode them anymore.
Diffstat (limited to 'config/chroot_local-includes')
-rw-r--r--config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm156
-rw-r--r--config/chroot_local-includes/usr/src/perl5lib/lib/Tails/RunningSystem.pm10
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Presets.pm72
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Setting.pm2
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Setup.pm26
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Bootstrap.pm66
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Configure.pm22
-rw-r--r--config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Delete.pm22
8 files changed, 180 insertions, 196 deletions
diff --git a/config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm b/config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm
index e21762c..bdf9ccc 100644
--- a/config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm
+++ b/config/chroot_local-includes/usr/src/iuk/lib/Tails/IUK/Frontend.pm
@@ -17,6 +17,9 @@ use English qw{-no_match_vars};
use Env;
use Function::Parameters;
use IPC::Run;
+use Locale::Messages qw{bind_textdomain_codeset
+ bind_textdomain_filter
+ turn_utf_8_on};
use Number::Format qw(:subs);
use Path::Tiny;
use POSIX;
@@ -30,6 +33,11 @@ use Try::Tiny;
use Types::Path::Tiny qw{AbsDir AbsFile};
use Types::Standard qw(ArrayRef Bool CodeRef Defined HashRef InstanceOf Int Maybe Str);
+BEGIN {
+ bind_textdomain_filter 'tails', \&turn_utf_8_on;
+ bind_textdomain_codeset 'tails', 'utf-8';
+}
+
no Moo::sification;
use Moo;
use MooX::HandlesVia;
@@ -184,10 +192,10 @@ method fatal_run_cmd (Str :$error_msg, ArrayRef :$cmd, Maybe[Str] :$as = undef,
$success or $self->fatal(
errf("<b>%{error_msg}s</b>\n\n%{details}s",
{
- error_msg => $error_msg, # was already decoded
- details => $self->encoding->decode(__(
+ error_msg => $error_msg,
+ details => __(
q{For debugging information, execute the following command: sudo tails-debugging-info}
- )),
+ ),
},
),
title => $error_title,
@@ -251,15 +259,13 @@ method refresh_signing_key () {
or $success = 0;
$exit_code = $?;
$success or $self->fatal(
- $self->encoding->decode(__(
+ __(
q{<b>An error occured while updating the signing key.</b>\n\n}.
q{<b>This prevents determining whether an upgrade is available from our website.</b>\n\n}.
q{Check your network connection, and restart Tails to try upgrading again.\n\n}.
q{If the problem persists, go to file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html},
- )),
- title => $self->encoding->decode(__(
- q{Error while updating the signing key}
- )),
+ ),
+ title => __(q{Error while updating the signing key}),
debugging_info => $self->encoding->decode(errf(
"exit code: %{exit_code}i\n\n".
"stdout:\n%{stdout}s\n\n".
@@ -286,14 +292,12 @@ method get_upgrade_description () {
}
my ($stdout, $stderr, $success, $exit_code) = $self->fatal_run_cmd(
cmd => [ 'tails-iuk-get-upgrade-description-file', @args ],
- error_title => $self->encoding->decode(__(
- q{Error while checking for upgrades}
- )),
- error_msg => $self->encoding->decode(__(
+ error_title => __(q{Error while checking for upgrades}),
+ error_msg => __(
"<b>Could not determine whether an upgrade is available from our website.</b>\n\n".
"Check your network connection, and restart Tails to try upgrading again.\n\n".
"If the problem persists, go to file:///usr/share/doc/tails/website/doc/upgrade/error/check.en.html",
- )));
+ ));
return ($stdout, $stderr, $success, $exit_code);
}
@@ -330,10 +334,10 @@ method no_incremental_explanation (Str $no_incremental_reason) {
);
}
else {
- $self->debug($self->encoding->decode(__x(
+ $self->debug(__x(
q{No explanation available for reason '{reason}'.},
reason => $no_incremental_reason,
- )));
+ ));
$explanation = $no_incremental_reason;
}
@@ -352,13 +356,13 @@ method run () {
$self->checked_upgrades_file->touch;
unless ($upgrade_description->contains_upgrade_path) {
- $self->info($self->encoding->decode(__("The system is up-to-date")));
+ $self->info(__("The system is up-to-date"));
exit(0);
}
- $self->info($self->encoding->decode(__(
+ $self->info(__(
'This version of Tails is outdated, and may have security issues.'
- )));
+ ));
my ($upgrade_path, $upgrade_type, $no_incremental_reason);
if ($self->running_system->started_from_writable_device) {
@@ -387,25 +391,25 @@ method run () {
}
else {
$no_incremental_reason = 'not-enough-free-space';
- $self->info($self->encoding->decode(__x(
+ $self->info(__x(
"The available incremental upgrade requires ".
"{space_needed} ".
"of free space on Tails system partition, ".
" but only {free_space} is available.",
space_needed => format_bytes($space_needed, mode => "iec", precision => 0),
free_space => format_bytes($free_space, mode => "iec", precision => 0),
- )));
+ ));
}
}
else {
$no_incremental_reason = 'not-enough-free-memory';
- $self->info($self->encoding->decode(__x(
+ $self->info(__x(
"The available incremental upgrade requires ".
"{memory_needed} of free memory, but only ".
"{free_memory} is available.",
memory_needed => format_bytes($memory_needed, mode => "iec", precision => 0),
free_memory => format_bytes($free_memory, mode => "iec", precision => 0),
- )));
+ ));
}
}
@@ -418,20 +422,20 @@ method run () {
}
else {
$self->fatal(
- $self->encoding->decode(__(
+ __(
"An incremental upgrade is available, but no full upgrade is.\n".
"This should not happen. Please report a bug."
- )),
- title => $self->encoding->decode(__(
+ ),
+ title => __(
q{Error while detecting available upgrades}
- )),
+ ),
);
}
}
if ($upgrade_type eq 'incremental') {
exit(0) unless($self->dialog(
- $self->encoding->decode(__x(
+ __x(
"<b>You should upgrade to {name} {version}.</b>\n\n".
"For more information about this new version, go to {details_url}\n\n".
"We recommend you close all other applications during the upgrade.\n".
@@ -443,16 +447,16 @@ method run () {
version => $upgrade_path->{version},
size => format_bytes($upgrade_path->{'total-size'},
mode => "iec", precision => 0),
- )),
- title => $self->encoding->decode(__(q{Upgrade available})),
- ok_label => $self->encoding->decode(__(q{Upgrade now})),
- cancel_label => $self->encoding->decode(__(q{Upgrade later})),
+ ),
+ title => __(q{Upgrade available}),
+ ok_label => __(q{Upgrade now}),
+ cancel_label => __(q{Upgrade later}),
));
$self->do_incremental_upgrade($upgrade_path);
}
else {
exit(0) unless($self->dialog(
- $self->encoding->decode(__x(
+ __x(
"<b>You should do a manual upgrade to {name} {version}.</b>\n\n".
"For more information about this new version, go to {details_url}\n\n".
"It is not possible to automatically upgrade ".
@@ -463,8 +467,8 @@ method run () {
name => $upgrade_description->product_name,
version => $upgrade_path->{version},
explanation => $self->no_incremental_explanation($no_incremental_reason),
- )),
- title => $self->encoding->decode(__(q{New version available})),
+ ),
+ title => __(q{New version available}),
type => 'info',
));
$self->do_full_upgrade($upgrade_path);
@@ -545,12 +549,12 @@ fun space_needed (HashRef $upgrade_path) {
}
method get_target_files (HashRef $upgrade_path, CodeRef $url_transform, AbsDir $destdir) {
- my $title = $self->encoding->decode(__("Downloading upgrade"));
- my $info = $self->encoding->decode(__x(
+ my $title = __("Downloading upgrade");
+ my $info = __x(
"Downloading the upgrade to {name} {version}...",
name => $self->product_name,
version => $upgrade_path->{version},
- ));
+ );
$self->info($info);
foreach my $target_file (target_files($upgrade_path, $destdir)) {
@@ -581,7 +585,7 @@ method get_target_files (HashRef $upgrade_path, CodeRef $url_transform, AbsDir $
}
$success or $self->fatal(
- $self->encoding->decode(errf("<b>%{error_msg}s</b>\n\n%{details}s",
+ errf("<b>%{error_msg}s</b>\n\n%{details}s",
{
error_msg => __(
q{<b>The upgrade could not be downloaded.</b>\n\n}.
@@ -594,10 +598,8 @@ method get_target_files (HashRef $upgrade_path, CodeRef $url_transform, AbsDir $
q{For debugging information, execute the following command: sudo tails-debugging-info}
),
}
- )),
- title => $self->encoding->decode(__(
- q{Error while downloading the upgrade}
- )),
+ ),
+ title => __(q{Error while downloading the upgrade}),
debugging_info => $self->encoding->decode(errf(
"exit code: %{exit_code}i\n\n".
"stderr:\n%{stderr}s",
@@ -606,15 +608,13 @@ method get_target_files (HashRef $upgrade_path, CodeRef $url_transform, AbsDir $
);
-e $target_file->{output_file} or $self->fatal(
- $self->encoding->decode(__x(
+ __x(
q{Output file '{output_file}' does not exist, but }.
q{tails-iuk-get-target-file did not complain. }.
q{Please report a bug.},
output_file => $target_file->{output_file},
- )),
- title => $self->encoding->decode(__(
- q{Error while downloading the upgrade}
- )),
+ ),
+ title => __(q{Error while downloading the upgrade}),
);
}
}
@@ -624,12 +624,12 @@ method do_incremental_upgrade (HashRef $upgrade_path) {
my ($target_files_tempdir) = $self->fatal_run_cmd(
cmd => ['tails-iuk-mktemp-get-target-file'],
- error_title => $self->encoding->decode(__(
+ error_title => __(
q{Error while creating temporary downloading directory}
- )),
- error_msg => $self->encoding->decode(__(
+ ),
+ error_msg => __(
"Failed to create temporary download directory"
- )),
+ ),
as => 'tails-iuk-get-target-file',
);
chomp $target_files_tempdir;
@@ -651,13 +651,11 @@ method do_incremental_upgrade (HashRef $upgrade_path) {
)->transformURL($url);
} catch {
$self->fatal(
- $self->encoding->decode(__(
+ __(
"<b>Could not choose a download server.</b>\n\n".
"This should not happen. Please report a bug.",
- )),
- title => $self->encoding->decode(__(
- q{Error while choosing a download server}
- )),
+ ),
+ title => __(q{Error while choosing a download server}),
debugging_info => $self->encoding->decode($_),
);
};
@@ -670,30 +668,28 @@ method do_incremental_upgrade (HashRef $upgrade_path) {
);
$self->dialog(
- $self->encoding->decode(__(
+ __(
"The upgrade was successfully downloaded.\n\n".
"The network connection will now be disabled.\n\n".
"Please save your work and close all other applications."
- )),
+ ),
type => 'info',
- title => $self->encoding->decode(__(
- q{Upgrade successfully downloaded}
- )),
- ok_label => $self->encoding->decode(__(q{Apply upgrade})),
+ title => __(q{Upgrade successfully downloaded}),
+ ok_label => __(q{Apply upgrade}),
);
$self->install_iuk($upgrade_path, path($target_files_tempdir));
$self->dialog(
- $self->encoding->decode(__(
+ __(
"<b>Your Tails device was successfully upgraded.</b>\n\n".
"Some security features were temporarily disabled.\n".
"You should restart Tails on the new version as soon as possible.\n\n".
"Do you want to restart now?"
- )),
- title => $self->encoding->decode(__(q{Restart Tails})),
- ok_label => $self->encoding->decode(__(q{Restart now})),
- cancel_label => $self->encoding->decode(__(q{Restart later})),
+ ),
+ title => __(q{Restart Tails}),
+ ok_label => __(q{Restart now}),
+ cancel_label => __(q{Restart later}),
) && $self->restart_system;
exit(0);
@@ -703,12 +699,8 @@ method restart_system () {
$self->info("Restarting the system");
$self->fatal_run_cmd(
cmd => ['/sbin/reboot'],
- error_title => $self->encoding->decode(__(
- q{Error while restarting the system}
- )),
- error_msg => $self->encoding->decode(__(
- q{Failed to restart the system}
- )),
+ error_title => __(q{Error while restarting the system}),
+ error_msg => __(q{Failed to restart the system}),
as => 'root',
) unless $ENV{HARNESS_ACTIVE};
}
@@ -721,22 +713,18 @@ method shutdown_network () {
$self->info("Shutting down network connection");
$self->fatal_run_cmd(
cmd => ['tails-shutdown-network'],
- error_title => $self->encoding->decode(__(
- q{Error while shutting down the network}
- )),
- error_msg => $self->encoding->decode(__(
- q{Failed to shutdown network}
- )),
+ error_title => __(q{Error while shutting down the network}),
+ error_msg => __(q{Failed to shutdown network}),
as => 'root',
) unless $ENV{HARNESS_ACTIVE};
}
method install_iuk (HashRef $upgrade_path, AbsDir $target_files_tempdir) {
- my $title = $self->encoding->decode(__("Upgrading the system"));
- my $info = $self->encoding->decode(__(
+ my $title = __("Upgrading the system");
+ my $info = __(
"<b>Your Tails device is being upgraded...</b>\n\n".
"For security reasons, the networking is now disabled."
- ));
+ );
$self->info($info);
$self->shutdown_network;
@@ -777,9 +765,7 @@ method install_iuk (HashRef $upgrade_path, AbsDir $target_files_tempdir) {
),
},
)),
- title => $self->encoding->decode(__(
- q{Error while installing the upgrade}
- )),
+ title => __(q{Error while installing the upgrade}),
debugging_info => $self->encoding->decode(errf(
"exit code: %{exit_code}i\n\n".
"stdout:\n%{stdout}s\n\n".
diff --git a/config/chroot_local-includes/usr/src/perl5lib/lib/Tails/RunningSystem.pm b/config/chroot_local-includes/usr/src/perl5lib/lib/Tails/RunningSystem.pm
index 7c9e792..6866607 100644
--- a/config/chroot_local-includes/usr/src/perl5lib/lib/Tails/RunningSystem.pm
+++ b/config/chroot_local-includes/usr/src/perl5lib/lib/Tails/RunningSystem.pm
@@ -218,10 +218,10 @@ method _build_boot_block_device () {
} catch {
$self->display_error(
$self->main_window,
- $self->encoding->decode(__(q{Error})),
- $self->encoding->decode(__(
+ __(q{Error}),
+ __(
q{The device Tails is running from cannot be found. Maybe you used the 'toram' option?},
- )),
+ ),
);
};
@@ -247,9 +247,9 @@ method _build_boot_drive () {
} catch {
$self->display_error(
$self->main_window,
- $self->encoding->decode(__(
+ __(
q{The drive Tails is running from cannot be found. Maybe you used the 'toram' option?},
- )),
+ ),
'',
);
};
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Presets.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Presets.pm
index c758154..9a04a53 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Presets.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Presets.pm
@@ -50,10 +50,10 @@ method _build__presets () {
my @presets = (
{
id => 'PersonalData',
- name => $self->encoding->decode(__(q{Personal Data})),
- description => $self->encoding->decode(__(
+ name => __(q{Personal Data}),
+ description => __(
q{Keep files stored in the `Persistent' directory}
- )),
+ ),
icon_name => 'stock_folder',
enabled => 1,
atoms_args => [
@@ -65,10 +65,10 @@ method _build__presets () {
},
{
id => 'GreeterSettings',
- name => $self->encoding->decode(__(q{Welcome Screen})),
- description => $self->encoding->decode(__(
+ name => __(q{Welcome Screen}),
+ description => __(
q{Language, administration password, and additional settings}
- )),
+ ),
icon_name => 'preferences-system',
enabled => 0,
atoms_args => [
@@ -80,10 +80,10 @@ method _build__presets () {
},
{
id => 'BrowserBookmarks',
- name => $self->encoding->decode(__(q{Browser Bookmarks})),
- description => $self->encoding->decode(__(
+ name => __(q{Browser Bookmarks}),
+ description => __(
q{Bookmarks saved in the Tor Browser}
- )),
+ ),
icon_name => 'user-bookmarks',
enabled => 0,
atoms_args => [
@@ -95,10 +95,10 @@ method _build__presets () {
},
{
id => 'NetworkConnections',
- name => $self->encoding->decode(__(q{Network Connections})),
- description => $self->encoding->decode(__(
+ name => __(q{Network Connections}),
+ description => __(
q{Configuration of network devices and connections}
- )),
+ ),
icon_name => 'network-wired',
enabled => 0,
atoms_args => [
@@ -110,10 +110,10 @@ method _build__presets () {
},
{
id => 'AdditionalSoftware',
- name => $self->encoding->decode(__(q{Additional Software})),
- description => $self->encoding->decode(__(
+ name => __(q{Additional Software}),
+ description => __(
q{Software installed when starting Tails}
- )),
+ ),
icon_name => 'package-x-generic',
enabled => 0,
configuration_app_desktop_id => 'org.boum.tails.additional-software-config.desktop',
@@ -130,10 +130,10 @@ method _build__presets () {
},
{
id => 'Printers',
- name => $self->encoding->decode(__(q{Printers})),
- description => $self->encoding->decode(__(
+ name => __(q{Printers}),
+ description => __(
q{Printers configuration}
- )),
+ ),
icon_name => 'printer',
enabled => 0,
atoms_args => [
@@ -145,10 +145,10 @@ method _build__presets () {
},
{
id => 'Thunderbird',
- name => $self->encoding->decode(__(q{Thunderbird})),
- description => $self->encoding->decode(__(
+ name => __(q{Thunderbird}),
+ description => __(
q{Thunderbird emails, feeds, and settings}
- )),
+ ),
icon_name => 'thunderbird',
enabled => 0,
atoms_args => [
@@ -160,10 +160,10 @@ method _build__presets () {
},
{
id => 'GnuPG',
- name => $self->encoding->decode(__(q{GnuPG})),
- description => $self->encoding->decode(__(
+ name => __(q{GnuPG}),
+ description => __(
q{GnuPG keyrings and configuration}
- )),
+ ),
icon_name => 'seahorse-key',
enabled => 0,
atoms_args => [
@@ -175,10 +175,10 @@ method _build__presets () {
},
{
id => 'BitcoinClient',
- name => $self->encoding->decode(__(q{Bitcoin Client})),
- description => $self->encoding->decode(__(
+ name => __(q{Bitcoin Client}),
+ description => __(
q{Electrum's bitcoin wallet and configuration}
- )),
+ ),
icon_name => 'electrum',
enabled => 0,
atoms_args => [
@@ -190,10 +190,10 @@ method _build__presets () {
},
{
id => 'Pidgin',
- name => $self->encoding->decode(__(q{Pidgin})),
- description => $self->encoding->decode(__(
+ name => __(q{Pidgin}),
+ description => __(
q{Pidgin profiles and OTR keyring}
- )),
+ ),
icon_name => 'pidgin',
enabled => 0,
atoms_args => [
@@ -205,10 +205,10 @@ method _build__presets () {
},
{
id => 'SSHClient',
- name => $self->encoding->decode(__(q{SSH Client})),
- description => $self->encoding->decode(__(
+ name => __(q{SSH Client}),
+ description => __(
q{SSH keys, configuration and known hosts}
- )),
+ ),
icon_name => 'seahorse-key-ssh',
enabled => 0,
atoms_args => [
@@ -220,10 +220,10 @@ method _build__presets () {
},
{
id => 'Dotfiles',
- name => $self->encoding->decode(__(q{Dotfiles})),
- description => $self->encoding->decode(__(
+ name => __(q{Dotfiles}),
+ description => __(
q{Symlink into $HOME every file or directory found in the `dotfiles' directory}
- )),
+ ),
icon_name => 'preferences-desktop',
enabled => 0,
atoms_args => [
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Setting.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Setting.pm
index 2c4f98e..1a631ba 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Setting.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Configuration/Setting.pm
@@ -108,7 +108,7 @@ has 'configuration_app_desktop_id' => (
=cut
method _build_name () {
- $self->encoding->decode(__('Custom'));
+ __('Custom');
}
method _build_id () {
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Setup.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Setup.pm
index 184795e..8351c42 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Setup.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Setup.pm
@@ -15,6 +15,9 @@ use English qw{-no_match_vars};
use Function::Parameters;
use Glib qw{TRUE FALSE};
use Gtk3 qw{-init};
+use Locale::Messages qw{bind_textdomain_codeset
+ bind_textdomain_filter
+ turn_utf_8_on};
use Net::DBus qw(:typing);
use Net::DBus::Annotation qw(:call);
use List::Util qw{first min max};
@@ -34,6 +37,11 @@ use Tails::Persistence::Step::Configure;
use Tails::Persistence::Step::Delete;
use Tails::Persistence::Utils qw{align_up_at_2MiB align_down_at_2MiB step_name_to_class_name get_variable_from_file check_config_file_permissions};
+BEGIN {
+ bind_textdomain_filter 'tails', \&turn_utf_8_on;
+ bind_textdomain_codeset 'tails', 'utf-8';
+}
+
no Moo::sification;
use Moo;
use MooX::late;
@@ -273,7 +281,7 @@ method _build_steps () {
method _build_main_window () {
my $win = Gtk3::Window->new('toplevel');
- $win->set_title($self->encoding->decode(__('Setup Tails persistent volume')));
+ $win->set_title(__('Setup Tails persistent volume'));
$win->set_border_width(10);
@@ -351,8 +359,8 @@ method _build_configuration () {
catch {
$self->display_error(
$self->main_window,
- $self->encoding->decode(__('Error')),
- $self->encoding->decode($_));
+ __('Error'),
+ $_);
exit 4;
};
}
@@ -470,7 +478,7 @@ method check_sanity (Str $step_name) {
$res = ! $res;
}
if (! $res) {
- my $message = $self->encoding->decode($check->{message});
+ my $message = $check->{message};
if ($self->force && exists($check->{can_be_forced}) && $check->{can_be_forced}) {
say STDERR "$message",
"... but --force is enabled, ignoring results of this sanity check.";
@@ -478,7 +486,7 @@ method check_sanity (Str $step_name) {
else {
$self->display_error(
$self->main_window,
- $self->encoding->decode(__('Error')),
+ __('Error'),
$message
);
return;
@@ -684,14 +692,14 @@ method goto_next_step () {
return;
}
}
- $self->current_step->title->set_text($self->encoding->decode(__(
+ $self->current_step->title->set_text(__(
q{Persistence wizard - Finished}
- )));
- $self->current_step->subtitle->set_text($self->encoding->decode(__(
+ ));
+ $self->current_step->subtitle->set_text(__(
q{Any changes you have made will only take effect after restarting Tails.
You may now close this application.}
- )));
+ ));
$self->current_step->description->set_text(' ');
$self->current_step->go_button->hide;
$self->current_step->status_area->hide;
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Bootstrap.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Bootstrap.pm
index 2aa8019..2c34218 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Bootstrap.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Bootstrap.pm
@@ -90,19 +90,19 @@ has 'passphrase_check_button' => (
=cut
method BUILD (@args) {
- $self->title->set_text($self->encoding->decode(__(
+ $self->title->set_text(__(
q{Persistence wizard - Persistent volume creation}
- )));
- $self->subtitle->set_text($self->encoding->decode(__(
+ ));
+ $self->subtitle->set_text(__(
q{Choose a passphrase to protect the persistent volume}
- )));
- $self->description->set_markup($self->encoding->decode(__x(
+ ));
+ $self->description->set_markup(__x(
q{A {size} persistent volume will be created on the <b>{vendor} {model}</b> device. Data on this volume will be stored in an encrypted form protected by a passphrase.},
size => format_bytes($self->size_of_free_space, mode => "iec"),
vendor => $self->drive_vendor,
model => $self->drive_model,
- )));
- $self->go_button->set_label($self->encoding->decode(__(q{Create})));
+ ));
+ $self->go_button->set_label(__(q{Create}));
}
method _build_main_widget () {
@@ -144,9 +144,9 @@ method _build_intro () {
$intro->set_line_wrap_mode('word');
$intro->set_single_line_mode(FALSE);
$intro->set_max_width_chars(72);
- $intro->set_markup($self->encoding->decode(__(
+ $intro->set_markup(__(
q{<b>Beware!</b> Using persistence has consequences that must be well understood. Tails can't help you if you use it wrong! See the <i>Encrypted persistence</i> page of the Tails documentation to learn more.}
- )));
+ ));
return $intro;
}
@@ -172,17 +172,13 @@ method _build_warning_area () {
}
method _build_label () {
- my $label = Gtk3::Label->new($self->encoding->decode(__(
- q{Passphrase:}
- )));
+ my $label = Gtk3::Label->new(__(q{Passphrase:}));
$label->set_alignment(0.0, 0.5);
return $label;
}
method _build_verify_label () {
- my $label = Gtk3::Label->new($self->encoding->decode(__(
- q{Verify Passphrase:}
- )));
+ my $label = Gtk3::Label->new(__(q{Verify Passphrase:}));
$label->set_alignment(0.0, 0.5);
return $label;
}
@@ -192,7 +188,7 @@ method _build_warning_label () {
$label->set_padding(10, 0);
$label->set_markup(
"<i>"
- . $self->encoding->decode(__(q{Passphrase can't be empty}))
+ . __(q{Passphrase can't be empty})
. "</i>"
);
return $label;
@@ -227,7 +223,7 @@ method _build_table () {
method _build_passphrase_check_button () {
my $check_button = Gtk3::CheckButton->new_with_label(
- $self->encoding->decode(__(q{Show Passphrase}))
+ __(q{Show Passphrase})
);
$check_button->set_active(FALSE);
$check_button->signal_connect(
@@ -251,7 +247,7 @@ method update_passphrase_ui () {
if ($passphrase ne $passphrase_verify) {
$self->warning_label->set_markup(
"<i>"
- . $self->encoding->decode(__(q{Passphrases do not match}))
+ . __(q{Passphrases do not match})
. "</i>"
);
$self->warning_image->show;
@@ -260,7 +256,7 @@ method update_passphrase_ui () {
elsif (length($passphrase) == 0) {
$self->warning_label->set_markup(
"<i>"
- . $self->encoding->decode(__(q{Passphrase can't be empty}))
+ . __(q{Passphrase can't be empty})
. "</i>"
);
$self->warning_image->show;
@@ -306,42 +302,42 @@ method operation_finished (HashRef $replies) {
if ($error) {
$self->working(0);
say STDERR "$error";
- $self->subtitle->set_text($self->encoding->decode(__(q{Failed})));
+ $self->subtitle->set_text(__(q{Failed}));
$self->description->set_text($error);
}
else {
say STDERR "created ${created_device}.";
$self->working(0);
- $self->subtitle->set_text($self->encoding->decode(__(
+ $self->subtitle->set_text(__(
q{Mounting Tails persistence partition.}
- )));
- $self->description->set_text($self->encoding->decode(__(
+ ));
+ $self->description->set_text(__(
q{The Tails persistence partition will be mounted.}
- )));
+ ));
$self->working(1);
systemx(qw{/sbin/udevadm settle});
my $mountpoint = $self->mount_persistence_partition_cb->();
$self->working(0);
say STDERR "mounted persistence partition on $mountpoint";
- $self->subtitle->set_text($self->encoding->decode(__(
+ $self->subtitle->set_text(__(
q{Correcting permissions of the persistent volume.}
- )));
- $self->description->set_text($self->encoding->decode(__(
+ ));
+ $self->description->set_text(__(
q{The permissions of the persistent volume will be corrected.}
- )));
+ ));
$self->working(1);
systemx(qw{sudo -n /usr/local/bin/tails-fix-persistent-volume-permissions});
$self->working(0);
say STDERR "fixed permissions.";
- $self->subtitle->set_text($self->encoding->decode(__(
+ $self->subtitle->set_text(__(
q{Creating default persistence configuration.}
- )));
- $self->description->set_text($self->encoding->decode(__(
+ ));
+ $self->description->set_text(__(
q{The default persistence configuration will be created.}
- )));
+ ));
$self->working(1);
$self->create_configuration_cb->();
$self->working(0);
@@ -354,11 +350,9 @@ method operation_finished (HashRef $replies) {
method go_button_pressed () {
$_->hide foreach ($self->intro, $self->warning_area, $self->table,$self->passphrase_check_button);
$self->working(1);
- $self->subtitle->set_text(
- $self->encoding->decode(__(q{Creating...})),
- );
+ $self->subtitle->set_text(__(q{Creating...}));
$self->description->set_text(
- $self->encoding->decode(__(q{Creating the persistent volume...})),
+ __(q{Creating the persistent volume...}),
);
$self->go_callback->(
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Configure.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Configure.pm
index 535dbad..f65633b 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Configure.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Configure.pm
@@ -82,20 +82,20 @@ method BUILD (@args) {
assert_defined($self->list_box);
assert_defined($self->settings_container);
- $self->title->set_text($self->encoding->decode(__(
+ $self->title->set_text(__(
q{Persistence wizard - Persistent volume configuration}
- )));
- $self->subtitle->set_text($self->encoding->decode(__(
+ ));
+ $self->subtitle->set_text(__(
q{Specify the files that will be saved in the persistent volume}
- )));
- $self->description->set_markup($self->encoding->decode(__x(
+ ));
+ $self->description->set_markup(__x(
q{The selected files will be stored in the encrypted partition {partition} ({size}), on the <b>{vendor} {model}</b> device.},
partition => $self->persistence_partition_device_file,
size => format_bytes($self->persistence_partition_size, mode => "iec"),
vendor => $self->drive_vendor,
model => $self->drive_model,
- )));
- $self->go_button->set_label($self->encoding->decode(__(q{Save})));
+ ));
+ $self->go_button->set_label(__(q{Save}));
$self->go_button->set_sensitive(TRUE);
}
@@ -175,7 +175,7 @@ method operation_finished ($error = undef) {
if ($error) {
$self->working(0);
say STDERR "$error";
- $self->subtitle->set_text($self->encoding->decode(__(q{Failed})));
+ $self->subtitle->set_text(__(q{Failed}));
$self->description->set_text($error);
}
else {
@@ -188,11 +188,9 @@ method operation_finished ($error = undef) {
method go_button_pressed () {
$self->settings_container->hide;
$self->working(1);
- $self->subtitle->set_text(
- $self->encoding->decode(__(q{Saving...})),
- );
+ $self->subtitle->set_text(__(q{Saving...}));
$self->description->set_text(
- $self->encoding->decode(__(q{Saving persistence configuration...})),
+ __(q{Saving persistence configuration...}),
);
my $error;
diff --git a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Delete.pm b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Delete.pm
index ec4a838..4f3bee5 100644
--- a/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Delete.pm
+++ b/config/chroot_local-includes/usr/src/persistence-setup/lib/Tails/Persistence/Step/Delete.pm
@@ -47,21 +47,21 @@ has 'warning_icon' => (
=cut
method BUILD (@args) {
- $self->title->set_text($self->encoding->decode(__(
+ $self->title->set_text(__(
q{Persistence wizard - Persistent volume deletion}
- )));
- $self->subtitle->set_text($self->encoding->decode(__(
+ ));
+ $self->subtitle->set_text(__(
q{Your persistent data will be deleted.}
- )));
+ ));
# TRANSLATORS: partition, size, device vendor, device model
- $self->description->set_markup($self->encoding->decode(__x(
+ $self->description->set_markup(__x(
q{The persistent volume {partition} ({size}), on the <b>{vendor} {model}</b> device, will be deleted.},
partition => $self->persistence_partition_device_file,
size => format_bytes($self->persistence_partition_size, mode => "iec"),
vendor => $self->drive_vendor,
model => $self->drive_model,
- )));
- $self->go_button->set_label($self->encoding->decode(__(q{Delete})));
+ ));
+ $self->go_button->set_label(__(q{Delete}));
$self->go_button->set_sensitive(TRUE);
}
@@ -98,7 +98,7 @@ method operation_finished ($reply) {
if ($error) {
$self->working(0);
say STDERR "$error";
- $self->subtitle->set_text($self->encoding->decode(__(q{Failed})));
+ $self->subtitle->set_text(__(q{Failed}));
$self->description->set_text($error);
}
else {
@@ -111,11 +111,9 @@ method operation_finished ($reply) {
method go_button_pressed () {
$self->working(1);
- $self->subtitle->set_text(
- $self->encoding->decode(__(q{Deleting...})),
- );
+ $self->subtitle->set_text(__(q{Deleting...}));
$self->description->set_text(
- $self->encoding->decode(__(q{Deleting the persistent volume...})),
+ __(q{Deleting the persistent volume...}),
);
$self->go_callback->(