[Koha-bugs] [Bug 11848] Make Koha::I18N easier to use

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Mar 14 19:40:18 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11848

--- Comment #5 from M. Tompsett <mtompset at hotmail.com> ---
Comment on attachment 25664
  --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25664
Bug 11848: Move language detection function in C4::Languages

Review of attachment 25664:
 --> (http://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=11848&attachment=25664)
-----------------------------------------------------------------

::: C4/Context.pm
@@ +1252,5 @@
>  
> +sub interface {
> +    my ($class, $interface) = @_;
> +
> +    if (defined $interface) {

You are using interface as both a get and set, correct?

@@ +1253,5 @@
> +sub interface {
> +    my ($class, $interface) = @_;
> +
> +    if (defined $interface) {
> +        $interface ||= 'opac';

Why not // instead?
Also, interface is defined. This line is pointless.

@@ +1254,5 @@
> +    my ($class, $interface) = @_;
> +
> +    if (defined $interface) {
> +        $interface ||= 'opac';
> +        $context->{interface} = $interface;

perhaps a lc or uc may be useful? maybe some validation of the value?

@@ +1257,5 @@
> +        $interface ||= 'opac';
> +        $context->{interface} = $interface;
> +    }
> +
> +    return $context->{interface};

What if you haven't set the interface and you get undef? It would seem the
default assumption is 'opac'. Perhaps add a "// 'opac'"?

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list