Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #74 #88

Merged
merged 3 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
make
make doc
sudo make install
- name: basic_test_mrtg
- name: unit_test
run: |
cd src
prove
- name: functional_test
run: |
mkdir test-mrtg
cd test-mrtg
Expand Down
1 change: 1 addition & 0 deletions src/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Changes 2.17.11, 2022-??-??
---------------------------
From: youpong
* stop making an orphan symlink (mrtg-mailer.pod)
* fix Brazilian translation(Issue #74)

Changes 2.17.10, 2022-01-19
---------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/bin/mrtg
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ my $NOW = timestamp;
my $graphiteObj;

# $SNMP_Session::suppress_warnings = 2;
use locales_mrtg "0.07";
use locales_mrtg "0.08";

# Do not Flash Console Windows for the forked rateup process
BEGIN {
Expand Down
13 changes: 13 additions & 0 deletions src/t/translation.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use strict;
use warnings;

use Test::More tests => 1;

use FindBin;
use lib "${FindBin::Bin}/../lib/mrtg2";
use locales_mrtg "0.08";

my $LOC = $lang2tran::LOCALE{"brazilian"};
unlike( &$LOC("The statistics were last updated <strong>Ter&ccedil;a, 26 de Outubro"),
qr/Sa&iacute;ubro/, "Issue #74");

61 changes: 27 additions & 34 deletions src/translate/brazilian.pmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,36 @@ return "" unless defined $string;


# regexp => replacement string NOTE does not use autovars $1,$2...
# charset=iso-2022-jp

%translations =
(
#'charset=iso-8859-1' => 'charset=iso-8859-1',
'Maximal 5 Minute Incoming Traffic' => 'Tr&aacute;fego M&aacute;ximo de Entrada em 5 minutos',
'Maximal 5 Minute Outgoing Traffic' => 'Tr&aacute;fego M&aacute;ximo de Sa&iacute;da em 5 minutos',
'the device' => 'dispositivo',
'The statistics were last updated (.*)' => '&Uacute;ltima atualiza&ccedil;&atilde;o das estat&iacute;sticas: $1',
' Average\)' => ' - m&eacute;dia)',
'Average' => 'M&eacute;dia',
'Max' => 'M&aacute;x',
'Current' => 'Atual',
'version' => 'vers&atilde;o',
'`Daily\' Graph \((.*) Minute' => 'Gr&aacute;fico `Di&aacute;rio\' ($1 minutos',
'`Weekly\' Graph \(30 Minute' => 'Gr&aacute;fico `Semanal\' (30 minutos' ,
'`Monthly\' Graph \(2 Hour' => 'Gr&aacute;fico `Mensal\' (2 horas',
'`Yearly\' Graph \(1 Day' => 'Gr&aacute;fico `Anual\' (1 dia',
'Incoming Traffic in (\S+) per Second' => 'Tr&aacute;fego de Entrada em $1 por segundo',
'Outgoing Traffic in (\S+) per Second' => 'Tr&aacute;fego de Sa&iacute;da em $1 por segundo',
'at which time (.*) had been up for(.*)' => 'nesta hora $1 estava ativo por $2',
# '([kMG]?)([bB])/s' => '\$1\$2/s',
# '([kMG]?)([bB])/min' => '\$1\$2/min',
# '([kMG]?)([bB])/h' => '$1$2/t',
# 'Bits' => 'Bits',
# 'Bytes' => 'Bytes'
'In' => 'Entr.',
'Out' => 'Sa&iacute;',
'Percentage' => 'Porc.',
'Ported to OpenVMS Alpha by' => 'Adaptado para o Alpha OpenVMS por',
'Ported to WindowsNT by' => 'Adaptado para o WindowsNT por',
'and' => 'e',
(
'^Maximal 5 Minute Incoming Traffic' => 'Tr&aacute;fego M&aacute;ximo de Entrada em 5 minutos',
'^Maximal 5 Minute Outgoing Traffic' => 'Tr&aacute;fego M&aacute;ximo de Sa&iacute;da em 5 minutos',
'^the device' => 'dispositivo',
'^The statistics were last updated (.*)' => '&Uacute;ltima atualiza&ccedil;&atilde;o das estat&iacute;sticas: $1',
'^ Average\)' => ' - m&eacute;dia)',
'^Average$' => 'M&eacute;dia',
'^Max$' => 'M&aacute;x',
'^Current' => 'Atual',
'^version' => 'vers&atilde;o', #
'^`Daily\' Graph \((.*) Minute' => 'Gr&aacute;fico `Di&aacute;rio\' ($1 minutos',
'^`Weekly\' Graph \(30 Minute' => 'Gr&aacute;fico `Semanal\' (30 minutos' ,
'^`Monthly\' Graph \(2 Hour' => 'Gr&aacute;fico `Mensal\' (2 horas',
'^`Yearly\' Graph \(1 Day' => 'Gr&aacute;fico `Anual\' (1 dia',
'^Incoming Traffic in (\S+) per Second' => 'Tr&aacute;fego de Entrada em $1 por segundo',
'^Outgoing Traffic in (\S+) per Second' => 'Tr&aacute;fego de Sa&iacute;da em $1 por segundo',
'^at which time (.*) had been up for(.*)' => 'nesta hora $1 estava ativo por $2',
'^In$' => 'Entr.',
'^Out$' => 'Sa&iacute;',
'^Percentage' => 'Porc.',
'^Ported to OpenVMS Alpha by' => 'Adaptado para o Alpha OpenVMS por',
'^Ported to WindowsNT by' => 'Adaptado para o WindowsNT por',
'^and' => 'e',
'^GREEN' => 'VERDE',
'BLUE' => 'AZUL',
'DARK GREEN' => 'VERDE ESCURO',
'MAGENTA' => 'LIL&Aacute;S',
'AMBER' => 'AMBAR'
'^BLUE' => 'AZUL',
'^DARK GREEN' => 'VERDE ESCURO',
'^MAGENTA' => 'LIL&Aacute;S',
'^AMBER' => 'AMBAR'
);

# maybe expansions with replacement of whitespace would be more appropriate
Expand Down
2 changes: 1 addition & 1 deletion src/translate/skeleton.pm0
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use strict;
use vars qw(@ISA @EXPORT $VERSION);
use Exporter;

$VERSION = '0.07';
$VERSION = '0.08';

@ISA = qw(Exporter);

Expand Down