At the moment the messages from the SIP2 server are in English by default and can be changed using a feature Kyle has written on bug 12571. The problem is, that while this can be used to translate the message, it doesn't provide true multi-language support. It's very common to provide the GUI on the self checks in mulitple languages here, so there is a need for translating the errors etc. sent by Koha as well. The SIP specification provides means to send a language code that would allow us to implement this properly. It uses a 3 character language code in its messages: http://multimedia.3m.com/mws/media/355361O/sip2-protocol.pdf Language Code Unknown (default) 000 English 001 French 002 German 003 Italian 004 Dutch 005 Swedish 006 Finnish 007 Spanish 008 Danish 009 Portuguese 010 Canadian-French 011 Norwegian 012 Hebrew 013 Japanese 014 Russian 015 Arabic 016 Polish 017 Greek 018 Chinese 019 Korean 020 North American Spanish 021 Tamil 022 Malay 023 United Kingdom 024 Icelandic 025 Belgian 026 Taiwanese 027
If we moved all SIP2 strings into Template Toolkit files it would make translation easy. I would recommend we use TT directly in the SIP2 code and *not* use C4::Templates do to it's cgi-centriticy and the fact that it would add a huge amount of overhead to the SIP server.
Also, if we are going this far, we should also allow alternative templates to be specified on a per-login basis in the SIP2 config.
Better idea from cait, use YAML and hook into the same translation system as the sysprefs. Still should allow alternatives in the config ; )
This hints at a bug in the SIP2 implementation in Koha. In the SIP2 standard that Katrin references in Comment 1, "language" is listed as a "3-char, fixed length required field". The contents of this field should be the 3-digit language codes that Katrin lists. As fas as I can tell, Koha uses the contents of the borrowers.lang database field for the language, using 000 if the field is not set: http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=C4/SIP/ILS/Patron.pm;h=23c576493fbc6214905efd1297225057a80c537a;hb=HEAD#l252 If a language code like nb-NO is used for the language in SIP2 the language info will have both the wrong length and the wrong format. As far as I can tell, we should have a mapping somewhere from the codes we use in borrowers.lang to the 3-digit codes required by SIP2. Not sure if it makes sense to fix this as part of the present bug or if it should be a separate bug.
Hm, I was wondering if we should just response in the lanugage that was set in the request, assuming that it's the language selected on the self check GUI. Maybe a fallback to borrowers.lang? Yes, we'd need to map the Koha language codes to the SIP2 codes in some way. Maybe a YAML system preference?
Actually we always return 000 for the language because the language does not get set in the ILS::Patron objectand we fall back on default. Would be interesting to see if self-issue machines take much notice of whats set, what they are configured for may override anything in the response
(In reply to Colin Campbell from comment #6) > Actually we always return 000 for the language because the language does not > get set in the ILS::Patron objectand we fall back on default. That has not been my experience. The one time I checked, borrowers.lang was empty and the three-digit language code was missing from the SIP2 response, giving the "fixed length" part of the response the wrong length.
I think borrowers.lang was added in 17.05 or 17.11, maybe you are looking at different versions? It's a rather recent addition.
Hello, in my opinion, we should only use the language that was set in the request, assuming that it's the language selected on the self check GUI, as Katrin said in Comment #5. All the messages displayed on the selfcheck machines aren't coming from Koha : some messages are sent directly by the selfcheck machine itself. So it would be better to use the language set on the GUI. Best wishes Anne-Claire (from Rennes, France)