X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/be889f53d0d876d80c4a35a0bdcdada61ebc500c..53593baa211863fbf66540cf1bcc36c8fb37257f:/SL/Locale/String.pm diff --git a/SL/Locale/String.pm b/SL/Locale/String.pm index 7afcaa451..722974393 100644 --- a/SL/Locale/String.pm +++ b/SL/Locale/String.pm @@ -11,7 +11,10 @@ use Rose::Object::MakeMethods::Generic ( our @EXPORT = qw(t8); -use overload '""' => \&translated; +use overload + '""' => \&translated, + eq => \&my_eq, + ne => \&my_ne; sub translated { my ($self) = @_; @@ -22,7 +25,19 @@ sub t8 { shift if $_[0] eq __PACKAGE__; my $string = shift; - return SL::Locale::String->new(untranslated => $string, args => \@_); + return SL::Locale::String->new(untranslated => $string, args => [ @_ ]); +} + +sub my_eq { + $_[1] eq $_[0]->translated; +} + +sub my_ne { + $_[1] ne $_[0]->translated; +} + +sub TO_JSON { + return $_[0]->translated; } 1;