Category in other language

Found a bug? Tell us!!
Post Reply
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Category in other language

Post by CapriSkye »

i found an interesting bug. When a category is in other language, s9y is not able to show it. for example in category 1, the name is 1-奇怪
but the link becomes 1-
so when clicking on that link, it just go to the main index, showing every entries, not just the entries in that category.
now if i put english character after 1-, it works just as it should be....
and if a category name starts with english character, it works fine too.

same goes to entry with multilingual title, but there's no problem, it's able to show the whole entry when clicking on it because a . is automatically inserted.

i only find it to be a problem for japanese, chinese, and korean s9y.

i'm having hard time finding which function controls category name, maybe somebody has an idea?
thanks!
Last edited by CapriSkye on Sun Nov 13, 2005 4:55 am, edited 2 times in total.
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

by the way, category name is properly inserted into database.
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

here's a quick fix, probably not the correct way to do it, but it does the job :lol:

open /include/functions_permalinks.inc.php
find:

Code: Select all

$path = serendipity_makePermalink($serendipity['permalinkCategoryStructure'], $data, 'category');
replace with:

Code: Select all

$path = serendipity_makePermalink($serendipity['permalinkCategoryStructure'], $data, 'category') . 'c';
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Category in other language

Post by garvinhicking »

Ah, sadly this is because your chinese characters are not allowed in URLs and thus are not matched by our permalink functions.

You could make it like the russion language files, which sets a i18n_filename_from and allows to transliterate the special characters?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

thanks garvin
i'm having trouble defining $i18n_filename_from array though.
how would I make it so it represent every chinese character?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I think you need to go through every available character in chinese? I don't know ANY chinese, so I don't know how large its alphabet is -- or if it even has something compared to the 27 character alphabet from America/Europe?!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

garvinhicking wrote:I think you need to go through every available character in chinese? I don't know ANY chinese, so I don't know how large its alphabet is -- or if it even has something compared to the 27 character alphabet from America/Europe?!

Regards,
Garvin
yeah i was afraid that was the answer.
it's not gonna work, way too many chinese characters out there.
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

anyway, i was thinking maybe there's something out there that represent chinese characters. maybe the utf-8 code page? i'll dig into this and see if i can find a solution.
thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Okay, that's too bad then. How would we convert chinese characters in URLs? The only other way I see is then to rename each category to "/category/2-unknown.html" and so on?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

yeah your solution might be better, that would work for any character that doesn't match by the permalink function.
will you please implement that when you have time? thanks
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I've just committed such a workaround in SVN, could you try it? It basically does not allow empty permalinks, and appends a "unknown" (or $i18n_unknown string, if set in language file) to the permalnk.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
CapriSkye
Regular
Posts: 119
Joined: Sun Oct 31, 2004 4:42 am
Location: Taiwan
Contact:

Post by CapriSkye »

sweet garvin, it works.
works with $i18n_unknown set in lang file also.
thanks!
Post Reply