X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FLocale%2FString.pm;h=63a53231ba5d5c4aab7c9cdae067caf5f6ef339d;hb=12b522fa1375e36d6985663f5679abd05303ee45;hp=7afcaa4519e7b67fa6c399d5227673fe4073805b;hpb=be889f53d0d876d80c4a35a0bdcdada61ebc500c;p=kivitendo-erp.git diff --git a/SL/Locale/String.pm b/SL/Locale/String.pm index 7afcaa451..63a53231b 100644 --- a/SL/Locale/String.pm +++ b/SL/Locale/String.pm @@ -11,7 +11,9 @@ use Rose::Object::MakeMethods::Generic ( our @EXPORT = qw(t8); -use overload '""' => \&translated; +use overload + '""' => \&translated, + eq => \&my_eq; sub translated { my ($self) = @_; @@ -22,7 +24,15 @@ 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 TO_JSON { + return $_[0]->translated; } 1;