[SPTUsers] SPT multilingual interface

Liina Enok liina at nlib.ee
Thu Apr 15 02:49:41 CDT 2004


My solution for displaying fieldnames in different language (Estonian in 
our case) was to change the PrintFieldName function on line 89 in 
SPT--FullRecord.php

function PrintFieldName()
{
    global $Field;
#print $Field->Name();
#LE
    $eestinimed =array("Title"=>"Pealkiri", "Description"=>"Kirjeldus","Coverage"=>"Hõlmavus","Subject"=>"Märksõna", "Classification"=>"Teema");
    $eesti = $eestinimed[$Field->Name()];
    if($eesti)
      {
	print $eesti;
      }
    else
      {
	print $Field->Name();
      }
#LE
}

You also have to change CreateOptionListForAdvancedSearch function in 
include/SPT--CommonSearch.php to change the pull-down menus in Advanced 
Search form. You should also look at ParseSearchStringForWords function 
in include/SPT--SearchEngine.php if you are searching non-English 
languages. (BTW, when searching for space in Advanced Search all records 
in database are found - is that normal?) This will do for not logged in 
users. For add and update forms of MetadatTool more scripts need to be 
changed.
Ideally the metadata field editor should enable labels or captions. So 
that if the field name is Title, which is required by software and not 
changeable, then it should also be possible to add a label which is 
whatever I want to show in user interface.
Also I had a problem with UTF-8. I chose UTF-8 for default character 
coding. All my data was in UTF-8 already.  When opening a record or a 
controlled name or a classification for updating a strange thing 
happened to all the two-byte characters. Each byte was replaced by 
another two-byte character. It seemed that the script didn't understand 
that it already had UTF-8 strings and started to convert the non-ASCII 
into two-byte encoding. So if you would open the two-byte character for 
updating four times in a row it will become 32 bytes.
To get rid of this I replaced HtmlSafePrint and GetHtmlEscapedString 
with plain print in  SPT--EditAnnouncement.php, 
SPT--SelectEditUserList.php, MetadataTool/SPT--EditClassification.php,  
MetadataTool/SPT--EditControlledName.php, MetadataTool/SPT--DBEntry.php
The biggest problem is that sorting UTF-8 is not supported, the two-byte 
characters are in all the wrong places. Does anyone have suggestions how 
to fix that? How is sorting done in SPT - using MySQL 'ORDER BY' or is 
it done by php itself? The big question is how to sort in different 
alphabets, e.g character order in Finnish alphabet is different from German.

Our test site is http://www.nlib.ee/liina/SPT/

Liina

Liina Enok
liina at nlib.ee
phone: (372) 630 7180
Project Manager
Information Sytems, National Library of Estonia

Esa Kaarakainen wrote:

> At 14.4.2004 16:19, Edward Almasy wrote:
>
>> On Wed, Apr 14, at 10:29:05AM, Esa Kaarakainen wrote:
>> > We are going to make multilingual (Finnish/English) user interface 
>> to SPT.
>> > I have heard that there are some groups already working with this 
>> kind of
>> > option. Do you have any suggestions how I should start building 
>> this and
>> > what issues do I need to be aware of? Are you maybe willing to 
>> share your
>> > solution?
>>
>>    I'm not sure if this answers your question, but you should be able to
>>    get started just by following the UI Customization Guide instructions
>>    (available on the Administration menu) to add a new user 
>> interface, and
>>    then translating the overall look and feel and each specific as also
>>    outlined in there.
>>
>>    If you've tried following the UI Customization Guide and have run 
>> into
>>    snags, please let us know so we can extend the guide to clarify.
>
>
> Yes, it is possible to make an any kind of user interface following 
> the UI Customization Guide (which by the way is clear and good). But 
> that way different interface is available only for signed in users and 
> system wide default user interface is only interface for all others. 
> I'm looking for a way to change the user interface without logging in.
>
> One quite simple solution came up to me that if i make two separate 
> SPT installations (different directories, eg. SPT_FI and SPT_EN) which 
> both use same database but have different default interface. Does this 
> have any disadvantages?
>
> I also need to be able to translate metadata field names on different 
> languages. Field names appear on Full Resource Record Display as they 
> are stored in database. Any ideas how those could be translated?
>
> -esa-
>
>
> -------------------------------------------------------------------------
>  Esa Kaarakainen
>  Systems analyst, Kuopio University Library
>  P.O.Box 1627, FIN-70211 KUOPIO
>  email esa.kaarakainen at uku.fi
>  Tel. +358-17-163441 Mobile +358-40-5268791
>
> _______________________________________________
> SPTUsers mailing list
> SPTUsers at scout.wisc.edu
> http://scout.wisc.edu/mailman/listinfo/sptusers





More information about the SPTUsers mailing list