Re: [greenstone-users] Format question and little bugs? dc.Language not showing up

From Katherine Don
DateMon, 13 Mar 2006 09:33:10 +1300
Subject Re: [greenstone-users] Format question and little bugs? dc.Language not showing up
In-Reply-To (441132E1-6060307-inwind-it)
Hi Ruben

I have changed the code so that it will return the language code if it
can't match it to an existing value. (what a good idea!! :-) )

You can do the same thing in your code: in src/recpt/formattools.cpp, at
the end of iso639, change 'return ""'; to 'return langcode;'
Then recompile.

In the future it would be good to do something better than this, i.e.
get rid of this horrible code, or at least be able to turn it off, but
for now, this should work.

Cheers,
Katherine

ruben pandolfi wrote:
> Thanks Katherine,
>
> great help as always ...
>
>
> Katherine Don wrote:
>
>> Hi Ruben
>>
>> I have realised what your problem is. Its actually based on a "feature"
>> of greenstone, not a bug :-)
>>
>> Greenstone expects Language metadata to be ISO two letter codes, en, fr,
>> es etc. And when its displaying them, it (un)helpfully maps them to a
>> proper name. eg en will become English.
>> This list is hard coded in the source code (you can see it in
>> src/recpt/formattools.cpp, text_t iso639 (const text_t &langcode) ).
>> Unfortunately, it doesn't recognise three letter codes.
>>
>> For your case, you have two options. Change your Language metadata to be
>> two letter codes (and English, French etc will be displayed), or change
>> the element name to be something other than Language (and eng, fre, etc
>> will be displayed).
>>
>> Or you could change the source code :-)
>>
>
> I have cheked that .. seems intersting, but maybe in the next release
> version you can just add a line that says "if the language value does
> not match , print the value"
>
> This way you will maintain backwards compatibility and more flexibility
> for future .
>
> (I don't want to use this feature, cause the associated text is english
> only, and using another meta for language it will be "non standard" :-(
>
> Think is possible?
>
> Thanks
>
> ruben
>
>
> ps: I have seen the function is just followed by the "relation"
> function, pretty strange I got two in a row :-)
>
>
>
>