Changes done to make OpenBiblio 7.1do our job

  • Koen Roggemans

    Koen Roggemans - 2012-04-09

    Hi all,
    First of all: I'm really glad this project moves on. Thanks a lot for making it up to date and do a lot of bugfixing!

    Just like in the 6.1 release, we had to make a few changes to make Openbiblio work for us. We need it in Dutch. I'm currently working on an updated version for 7.1, so whoever needs it, follow this tread.
    I'm posting my notes here - May be it helps someone or may be some things can be taken in a future release:

    Translation to Dutch

    Add locale/nl (6.1-version is fine to start - update follows) and add file
    locale/langlist.php, containing
    $locales = array("nl"=>"Nederlands");

    Search bar codes as lowercase: we need lowercase searches and some of our barcodes are uppercase

    Line 76
        $searchText = strtolower($searchText);

    OB doesn't work with UTF-8 database. Correct in database, but wrong on screen. We need UTF-8 since there is French in our library and all our other stuff is UTF-8 - don't want to mix that.

    Line 23
        $rc = Query::act( 'SET NAMES UTF8' );

    Make Dutch work with Euro-sign

    Line 76
      } elseif ($set->getLocale()=="nl") {
        obib_setlocale(LC_MONETARY,'nl_BE.iso885915', 'nl', 'nl_BE', 'nl_NL' , 'nl_BE.utf8');
        obib_setlocale(LC_NUMERIC,'nl_BE.iso885915', 'nl', 'nl_BE', 'nl_NL' , 'nl_BE.utf8');

    unnecessary fields

    In openbiblio/catalog/biblio_fields.php we comment a lot of fields out we don't use.

    Hopefully this is usefull to someone

  • Hans van der Weij

    Hello Koen,

    Excellent idea to share your notes, I'll respond later to your findings.

    Thanks for updating the translation so quickly.  Perhaps I would like to see some changes to make it more complete and universal. If only I could find the time to check the detail…

    Perhaps all translations should present additional requirements (like utf8). I'll think about it (probably the list of translations can be modified to make this more clear).


  • Hans van der Weij

    Response to Koen's findings:

    Translation to Dutch

    > add file locale/langlist.php

    Not neccessary. Old versions (probably before 0.6.0) used language_list.php. This is no longer needed because the description for the translation is read from metadata.php

    Search bar codes as lowercase
    Afraid I don't quite understand what you are saying here. Besides that, I would not expect Barcode search (and other search types) to be case sensitive. 102a finds 102A, so I think strtolower won't help!

    OB doesn't work with UTF-8 database. Correct in database, but wrong on screen.

    I suppose screen is OK when Library Settings "HTML Charset" is set to UTF-8

    Thanks for the hint to add SET NAMES UTF8 to classes/query.php. This fixes the issue that el niño does not find EL NIÑO when the database character set is utf8 (This is NOT an issue for latin1).

    When preparing the 0.7.1 release, I tested SET NAMES UTF8 in the MySQL console to make el niño find EL NIÑO. Still wondering why that didn't work.
    I'll try to implement your fix, when it can be made more universal (MySQL 4.0, other character sets than utf8).

    Make Dutch work with Euro-sign

    It has been said before that the mechanism in shared/read_settings.php is not universal enough. When we add more hacks around this has, we risk introducing new issues. There was even an issue for the default en locale…

    shared/read_settings automatically sets the correct currency format when the OpenBiblio locale exactly matches the desired operating system locale name. However, that could not work for locale names exceeding the 10 character limit in database field settings.locale

    When you update to 0.7.1, field settings.locale can hold 30 characters. Now you can simply rename the directory of the locale to match the name of the desired operating system locale name. After renaming the locale, OpenBiblio's interface will show translation strings and not the full translation. Fix this by submitting library settings (you don't have to change anything).
    Note that install does not allow locale names like nl_NL.iso885915@euro
    Renaming should be done after installing!

    unnecessary fields
    If you think your customized version of /catalog/biblio_fields.php can be of use for others, than you can add it to the translation package.


Log in to post a comment.