projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ff7dd0
)
Locale: eq-overload für t8 Objekte
author
Sven Schöling
<s.schoeling@linet-services.de>
Tue, 5 May 2015 08:32:18 +0000
(10:32 +0200)
committer
Sven Schöling
<s.schoeling@linet-services.de>
Tue, 5 May 2015 08:50:21 +0000
(10:50 +0200)
SL/Locale/String.pm
patch
|
blob
|
history
diff --git
a/SL/Locale/String.pm
b/SL/Locale/String.pm
index
e05ae6a
..
63a5323
100644
(file)
--- 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) = @_;
@@
-25,6
+27,10
@@
sub t8 {
return SL::Locale::String->new(untranslated => $string, args => [ @_ ]);
}
+sub my_eq {
+ $_[1] eq $_[0]->translated;
+}
+
sub TO_JSON {
return $_[0]->translated;
}