zh-hk

alexfung

Joined: 2003-10-15
Posts: 17
Posted: Wed, 2003-10-15 09:26

Can gallery detect zh-hk as well? It can just use the localisation of zh-tw, but HK people may not have set zh-tw in addition to zh-hk.

How I can patch gallery to do this?

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Wed, 2003-10-15 11:31

Hi,

What do you meant with "detect zh-hk" ?

Jens

 
alexfung

Joined: 2003-10-15
Posts: 17
Posted: Wed, 2003-10-15 16:32

Thanks for your response. I mean, I have ML=2. when my browser transmits accept-language zh-tw, gallery will show in chinese. if en-us, gallery displays in english. However gallery doesn't understand zh-hk.

zh-tw and zh-hk basically is the same character set (big5). You can just transmit the same localisation for both. What I don't know, is how to patch gallery to notice zh-hk and transmits the localised strings for zh-tw. Or to clone the zh-tw localisations for use by zh-hk.

Actually the very basic thing I want, is to receive a content: charset=big5 header when browser accepts zh-hk. I have tried to edit view-albums to do it, but I always kill it (either gives a blank page, or says data transmitted before header). HK people typically doesn't care whether the interface is chinese or english, but we need charset=big5 or the chinese captions will be displayed as gibberish.

hope I make myself a bit clearer.

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2003-10-16 14:18

Hi,

yes, now i understand what you mean :)
This is easy to todo:

in 1.4 add in nls.php:
$nls['alias']['zh_KH'] = 'zh_TW' ;

in 1.4.1-cvs add the line in locale/zh_TW/zh_TW-nls.php

Jens

 
alexfung

Joined: 2003-10-15
Posts: 17
Posted: Thu, 2003-10-16 14:43

Thanks :)

I added

$nls['alias']['zh_HK'] = 'zh_TW' ;

HK for Hong Kong. I didn't do the cvs for I haven't yet figured out how cvs works.

Now I successfully got the Chinese interface :)

Is there any chance I can use the Enlish interface (as if I have en-us) but still have gallery emit the content: charset=big5 header (as if I have zh-tw)? That will be *perfect* because we are actually more comfortable with the english interface, though we need the charset to get the captioned displayed properly.

 
alexfung

Joined: 2003-10-15
Posts: 17
Posted: Thu, 2003-10-16 14:55

I figure out how. I invented a new "language". To nls.php, I added:

$nls['language']['en_HK'] = 'English (HK)';
and
$nls['charset']['en_HK'] = 'BIG5';
in addition to the
$nls['alias']['zh_HK'] = 'zh_TW' ;

Seems working fine.

However, I didn't touch
$gallery->config_version in Version.php

 
Tim_j
Tim_j's picture

Joined: 2002-08-15
Posts: 6818
Posted: Thu, 2003-10-16 15:46

Hehe, this is a kind of trick :)

And ONLY works with english.
What you did is, you "created" a new language. But without a translation file.
So everything is displayed in the original language (english).

Regards,

Jens

 
alexfung

Joined: 2003-10-15
Posts: 17
Posted: Thu, 2003-10-16 15:57

That's exactly what I want. As I mentioned, I prefer a full english interface, and the big5 charset :)

Now just one more file I need to patch for each future upgrades.