From 31e2c8b4f9d5b1802df46a17f9c4515ac199d771 Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Mon, 14 Feb 2011 20:55:49 -0700 Subject: [PATCH] Added the ability to use printf(3) % variables in trans() --- doc/CHANGELOG | 1 + lib/API/Std.pm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index de3ebd9..dd89205 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Added the ability to use printf(3) % variables in trans(). * Added slog() to API::Log for logging to IRC. * Added a Greet module for greeting users on join. * Added PostgreSQL support. Official modules do not support this yet. diff --git a/lib/API/Std.pm b/lib/API/Std.pm index 770444c..f455085 100644 --- a/lib/API/Std.pm +++ b/lib/API/Std.pm @@ -337,11 +337,11 @@ sub conf_get # Translation subroutine. sub trans { - my ($id) = @_; + my $id = shift; $id =~ s/ /_/gsm; if (defined $API::Std::LANGE{$id}) { - return $API::Std::LANGE{$id}; + return sprintf $API::Std::LANGE{$id}, @_; } else { $id =~ s/_/ /gsm;