Page 1 of 1

Category in other language

Posted: Sun Nov 13, 2005 4:43 am
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!

Posted: Sun Nov 13, 2005 4:49 am
by CapriSkye
by the way, category name is properly inserted into database.

Posted: Sun Nov 13, 2005 5:25 am
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';

Re: Category in other language

Posted: Sun Nov 13, 2005 1:22 pm
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

Posted: Sun Nov 13, 2005 6:15 pm
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?

Posted: Mon Nov 14, 2005 12:10 am
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

Posted: Mon Nov 14, 2005 12:30 am
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.

Posted: Mon Nov 14, 2005 12:39 am
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!

Posted: Mon Nov 14, 2005 12:40 am
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

Posted: Mon Nov 14, 2005 2:59 am
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

Posted: Mon Nov 14, 2005 10:08 am
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

Posted: Tue Nov 15, 2005 6:15 am
by CapriSkye
sweet garvin, it works.
works with $i18n_unknown set in lang file also.
thanks!