[Koha-bugs] [Bug 12705] News not possible for one sublanguage if two sublanguages are installed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 8 01:12:12 CEST 2014


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

Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bgkriegel at gmail.com

--- Comment #2 from Bernardo Gonzalez Kriegel <bgkriegel at gmail.com> ---
Marc, your patch works and has no errors, but I wonder if someone could see
this as a regression because you can't put a news on a specific variant of a
language.

You can't right now, but the problem is the strange structure returned by
getTranslatedLanguages()

If you change this

foreach my $language ( @$tlangs ) {
   push @lang_list,
     {
       language => $language->{'rfc4646_subtag'},
       selected => ( $new_detail->{lang} eq $language->{'rfc4646_subtag'} ? 1 :
0 ),
     };
}

with this

foreach my $language ( @$tlangs ) {
  foreach my $sublanguage ( @{$language->{'sublanguages_loop'}} ) {
    push @lang_list,
      {
        language => $sublanguage->{'rfc4646_subtag'},
        selected => ( $new_detail->{lang} eq $sublanguage->{'rfc4646_subtag'} ?
1 : 0 ),
      };
    }
  }
}

then the problem is solved.

Perhaps a new feature could be a multiple selection on target languages or
interfaces for news display location.

Another feature could show here only 'active' languages, 
i.e. only push if ( $sublanguage->{'enabled'} )

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


More information about the Koha-bugs mailing list