aboutsummaryrefslogtreecommitdiffstats
path: root/po
Commit message (Expand)AuthorAgeFilesLines
* Sync with 0.3x branch and prepare for 0.40 releaseSARL ENR-682014-11-1020-613/+956
* Update zh_TW.poyochenhsieh2014-10-311-2/+9
* Formatting all .po files for future 0.32 releaseSARL ENR-682014-10-2542-2723/+2891
* update for new release 0.32SARL ENR-682014-10-2042-834/+836
* (0.30 release) Po formatting (pt,zh_TW).po filesSARL ENR-682014-09-092-66/+2
* (0.30 release) Po formatting (it).po filesSARL ENR-682014-09-091-49/+34
* (0.30 release) Po formatting (da,et,pl).po filesSARL ENR-682014-09-013-154/+103
* fix a typo on the word 'occurred' instead of 'occured'SARL ENR-682014-08-2842-43/+43
* (0.30 release) Po formatting (el).po filesSARL ENR-682014-08-081-52/+36
* (0.30 release) Po formatting (eu).po filesSARL ENR-682014-08-031-0/+321
* (0.30 release) Po formatting (cs,es).po filesSARL ENR-682014-08-022-85/+46
* (0.30 release) Po formatting (nl).po filesSARL ENR-682014-07-201-53/+36
* (0.30 release) Po formatting (ro,id).po filesSARL ENR-682014-07-202-93/+56
* (0.30 release) Po formatting (ru).po filesSARL ENR-682014-07-101-28/+11
* (0.30 release) Po formatting (en_GB).po filesSARL ENR-682014-07-101-58/+43
* (0.30 release) Po formatting (ast,de,pt_BR,sl,sv,fr,uk,tr).po filesSARL ENR-682014-07-1037-1151/+992
* update for release 0.30SARL ENR-682014-07-0741-1680/+2224
* update (de,fr,pt,pt_BR,sl,sv,tr,uk) po filesSARL ENR-682014-07-058-210/+143
* Update ru.poSARL ENR-682014-07-031-26/+16
* Update zh_TW.poyochenhsieh2014-07-031-17/+24
* update for release 0.30SARL ENR-682014-07-0241-2881/+3349
* updated (all) po files for future 0.30 releaseSARL ENR-682014-06-1541-1486/+1486
* (0.30)Update (cs,es,pt_BR,sl,sv,fr,ru,ro,uk,tr).mo files with po-compile.sh t...SARL ENR-682014-05-256-105/+106
* updated (all) po files for future 0.30 releaseSARL ENR-682014-05-1641-1445/+1445
* (0.30)Update (fr,ru,ro,uk,tr).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-05-105-93/+98
* Update pt.poPapoteur2014-05-091-1/+1
* updated (all) po files for future 0.30 releaseSARL ENR-682014-05-0941-1446/+1282
* updated (all) po files for future 0.30 releaseSARL ENR-682014-05-0941-1992/+4824
* updated (all) po files for release 0.21SARL ENR-682014-05-0821-64/+118
* Update zh_TW.poyochenhsieh2014-05-081-0/+1
* updated all po files for new "modifications"SARL ENR-682014-05-0441-1306/+1306
* updated all po files for new "modifications"SARL ENR-682014-05-0241-1306/+1306
* updated all po files for new "GtkAboutDialog"SARL ENR-682014-04-1941-724/+905
* Update (pt_BR).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-03-201-3/+3
* Added and Update (pt).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-02-211-52/+71
* Added and Update (en_GB).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-251-67/+38
* Update isodumper.pot fileSARL ENR-682014-01-111-7/+7
* Fix an error space on a translation string (#: lib/isodumper.py:270)SARL ENR-682014-01-1041-656/+664
* Update (da).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-091-3/+3
* Update (cs,da).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-092-147/+95
* Update (pl).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-081-17/+18
* Update (sv).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-071-1/+1
* Translated the new strings.Kristoffer Grundström2014-01-071-8/+8
* Update (pt_BR).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-061-3/+3
* Update (it).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-061-2/+4
* Update (el).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-051-9/+9
* Update (ru).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-031-0/+1
* Update ru.popapoteur-mga2014-01-031-19/+22
* Update (et, tr).mo files with po-compile.sh tools to /share/localeSARL ENR-682014-01-032-7/+7
* Update zh_TW.poyochenhsieh2014-01-011-11/+11
n class="hl opt">::Init(1); } c::setlocale(); } else { Newt::Init(0); } Newt::Cls(); Newt::SetSuspendCallback(); ($width, $height) = Newt::GetScreenSize(); open STDERR, ">/dev/null" if $::isStandalone && !$::testing; bless {}, $_[0]; } sub enter_console { Newt::Suspend() } sub leave_console { Newt::Resume() } sub suspend { Newt::Suspend() } sub resume { Newt::Resume() } sub end { Newt::Finished() } sub exit { end(); exit($_[1]) } END { end() } sub messages { my ($width, @messages) = @_; warp_text(join("\n", @messages), $width - 9); } sub myTextbox { my ($allow_scroll, $free_height, @messages) = @_; my @l = messages($width, @messages); my $h = min($free_height - 13, int @l); my $want_scroll; if ($h < @l) { if ($allow_scroll) { $want_scroll = 1; } else { # remove the text, no other way! @l = @l[0 .. $h-1]; } } my $mess = Newt::Component::Textbox(1, 0, my $w = max(map { length } @l) + 1, $h, $want_scroll); $mess->TextboxSetText(join("\n", @l)); $mess, $w + 1, $h; } sub separator { my $blank = Newt::Component::Form(\undef, '', 0); $blank->FormSetWidth($_[0]); $blank->FormSetHeight($_[1]); $blank; } sub checkval { $_[0] && $_[0] ne ' ' ? '*' : ' ' } sub ask_fromW { my ($o, $common, $l, $l2) = @_; if (@$l == 1 && $l->[0]{list} && @{$l->[0]{list}} == 2 && listlength(map { split "\n" } @{$common->{messages}}) > 20) { #- special ugly case, esp. for license agreement my $e = $l->[0]; my $ok_disabled = $common->{callbacks} && delete $common->{callbacks}{ok_disabled}; ($common->{ok}, $common->{cancel}) = map { may_apply($e->{format}, $_) } @{$e->{list}}; do { ${$e->{val}} = ask_fromW_real($o, $common, [], $l2) ? $e->{list}[0] : $e->{list}[1]; } while $ok_disabled && $ok_disabled->(); 1; } elsif ((any { $_->{type} ne 'button' } @$l) || @$l < 5) { &ask_fromW_real; } else { $common->{cancel} = N("Do") if $common->{cancel} eq ''; my $r; do { my @choices = map { my $s = simplify_string(may_apply($_->{format}, ${$_->{val}})); $s = "$_->{label}: $s" if $_->{label}; { label => $s, clicked_may_quit => $_->{clicked_may_quit} }; } @$l; #- replace many buttons with a list my $new_l = [ { val => \$r, type => 'list', list => \@choices, format => sub { $_[0]{label} }, sort => 0 } ]; ask_fromW_real($o, $common, $new_l, $l2) and return; } until $r->{clicked_may_quit}->(); 1; } } sub ask_fromW_real { my ($o, $common, $l, $l2) = @_; my $ignore; #-to handle recursivity my $old_focus = -2; my @l = $common->{advanced_state} ? @$l2 : @$l; my @messages = (@{$common->{messages}}, if_($common->{advanced_state}, @{$common->{advanced_messages}})); #-the widgets my (@widgets, $total_size, $has_scroll); my $label_width; my $get_label_width = sub { $label_width ||= max(map { length($_->{label}) } @l); }; my $set_all = sub { $ignore = 1; $_->{set}->(${$_->{e}{val}}) foreach @widgets; # $_->{w}->set_sensitive(!$_->{e}{disabled}()) foreach @widgets; $ignore = 0; }; my $get_all = sub { ${$_->{e}{val}} = $_->{get}->() foreach @widgets; }; my $create_widget = sub { my ($e, $ind) = @_; $e->{type} = 'list' if $e->{type} =~ /iconlist/; #- combo does not exist, fallback to a sensible default $e->{type} = $e->{not_edit} ? 'list' : 'entry' if $e->{type} eq 'combo'; my $changed = sub { return if $ignore; return $old_focus++ if $old_focus == -2; #- handle special first case $get_all->(); #- TODO: this is very rough :( $common->{callbacks}{$old_focus == $ind ? 'changed' : 'focus_out'}->($ind); $set_all->(); $old_focus = $ind; }; my ($w, $real_w, $set, $get, $expand, $size, $invalid_choice, $extra_text); if ($e->{type} eq 'bool') { my $subwidth = $width - $get_label_width->() - 9; my @text = messages($subwidth, $e->{text} || ''); $size = @text; $w = Newt::Component::Checkbox(shift(@text), checkval(${$e->{val}}), " *"); if (@text) { $extra_text = Newt::Component::Textbox(-1, -1, $subwidth, $size - 1, 0); $extra_text->TextboxSetText(join("\n", @text)); } $set = sub { $w->CheckboxSetValue(checkval($_[0])) }; $get = sub { $w->CheckboxGetValue == ord '*' }; } elsif ($e->{type} eq 'button') { $w = Newt::Component::Button(simplify_string(may_apply($e->{format}, ${$e->{val}}))); } elsif ($e->{type} eq 'treelist') { $e->{formatted_list} = [ map { may_apply($e->{format}, $_) } @{$e->{list}} ]; my $data_tree = interactive::helper_separator_tree_to_tree($e->{separator}, $e->{list}, $e->{formatted_list}); my $count; $count = sub { my ($t) = @_; 1 + ($t->{_leaves_} ? int @{$t->{_leaves_}} : 0) + ($t->{_order_} ? sum(map { $count->($t->{$_}) } @{$t->{_order_}}) : 0); }; $size = $count->($data_tree); my $prefered_size = @l == 1 && $height > 30 ? 10 : 5; my $scroll; if ($size > $prefered_size && !$o->{no_individual_scroll}) { $has_scroll = $scroll = 1; $size = $prefered_size; } $w = Newt::Component::Tree($size, $scroll); my $wi; my $add_item = sub { my ($text, $index, $parents) = @_; $text = simplify_string($text, $width - 10); $wi = max($wi, length($text) + 3 * @$parents + 4); $w->TreeAdd($text, $index, $parents); }; my @data = ''; my $populate; $populate = sub { my ($node, $parents) = @_; if (my $l = $node->{_order_}) { each_index { $add_item->($_, 0, $parents); $populate->($node->{$_}, [ @$parents, $::i ]); } @$l; } if (my $l = $node->{_leaves_}) { foreach (@$l) { my ($leaf, $data) = @$_; $add_item->($leaf, int(@data), $parents); push @data, $data; } } }; $populate->($data_tree, []); $w->TreeSetWidth($wi + 1); $get = sub { my $i = $w->TreeGetCurrent; $invalid_choice = $i == 0; $data[$i]; }; $set = sub { my ($data) = @_; eval { my $i = find_index { $_ eq $data } @data; $w->TreeSetCurrent($i); } if $data; 1; }; } elsif ($e->{type} =~ /list/) { $size = @{$e->{list}}; my $prefered_size = @l == 1 && $height > 30 ? 10 : 5; my $scroll; if ($size > $prefered_size && !$o->{no_individual_scroll}) { $has_scroll = $scroll = 1; $size = $prefered_size; } $w = Newt::Component::Listbox($size, $scroll ? 1 << 2 : 0); #- NEWT_FLAG_SCROLL my @l = map { my $t = simplify_string(may_apply($e->{format}, $_), $width - 10); $w->ListboxAddEntry($t, $_); $t; } @{$e->{list}}; $w->ListboxSetWidth(max(map { length($_) } @l) + 3); # 3 added for the scrollbar (?) $get = sub { $w->ListboxGetCurrent }; $set = sub { my ($val) = @_; each_index { $w->ListboxSetCurrent($::i) if $val eq $_; } @{$e->{list}}; }; } else { $w = Newt::Component::Entry('', 20, ($e->{hidden} && 1 << 11) | (1 << 2)); $get = sub { $w->EntryGetValue }; $set = sub { $w->EntrySet($_[0], 1) }; } $total_size += $size || 1; #- !! callbacks must be kept otherwise perl will free them !! #- (better handling of addCallback needed) { e => $e, w => $w, real_w => $real_w || $w, expand => $expand, callback => $changed, get => $get || sub { ${$e->{val}} }, set => $set || sub {}, extra_text => $extra_text, invalid_choice => \$invalid_choice }; }; @widgets = map_index { $create_widget->($_, $::i) } @l; $_->{w}->addCallback($_->{callback}) foreach @widgets; $set_all->(); my $grid = Newt::Grid::CreateGrid(3, max(1, sum(map { $_->{extra_text} ? 2 : 1 } @widgets))); my $i; foreach (@widgets) { $grid->GridSetField(0, $i, 1, ${Newt::Component::Label($_->{e}{label})}, 0, 0, 1, 0, 1, 0); $grid->GridSetField(1, $i, 1, ${$_->{real_w}}, 0, 0, 0, 0, 1, 0); $i++; if ($_->{extra_text}) { $grid->GridSetField(0, $i, 1, ${Newt::Component::Label('')}, 0, 0, 1, 0, 1, 0); $grid->GridSetField(1, $i, 1, ${$_->{extra_text}}, 0, 0, 0, 0, 1, 0); $i++; }