Some thoughts about multilingual support in drupal6

recently we've just redesigned our site to support multi languages. This is also our first test in drupal6(6.3). We were impressed by the more elegant and light-weight architecture of drupal6, the embeded mulitilingual support is much better than drupal5 but still need improvement. The contributed modlue i18n do a great favor, but there are still some issues in drupal core need to be solved.
firest, custom menu's multilingual display issue. when you create a custom menu item, then you go to 'site building'->'translate interface', search the menu item name and do some translation, and then you check the result, you'll find that the menu item doesn't get translated. If you read the source code in the function _menu_item_localize() of menu.inc, you'll find that the menu item name is pass through directly without been filtered by function t(). So the simplest solution is wrap around the menu item name with t().
we also found that there's something confused in the function locale() of file locale.module. The system always searches tranlation from default textgroup, when it finds nothing, it'll insert an untranslated item to the default textgroup. That's why you can find it under 'translate interface'. The problem is, drupal6 has extended the textgroup to allow developers to define their own textgroup. So if a developer defines a new textgroup, he will find that he can't make the textgroup work. We think that the function locale() need to rewrite.
second, the menu link path issue. Currently, the menu system stores system paths only. This means that if you have an english page 'node/1', and it has an url alias named 'about' for example. When it's stored to the db, the path stored in the db is 'node/1'.
What's problem with this?
Sugguest you create a menu item named 'About' with path pointed to url alias 'about'. You check the result, it seems everything is ok. The menu display, when clicking it, the system goes to page About. But when you enable multilingual support and switch language, the menu is gone(if you enable i18n module to filter nodes). The problem is that menu 'About' is pointed to 'node/1' and 'node/1' is an enlish node, so the menu item will not display if you are in non-english language.
so what's the solution?
solution no.1.
you can add each version of menu item to the menu links. for example, if i add an item 'about us' pointing to node/49 and another item 'about us' pointing to node/50(supposed this is the translation version of node/49) and enabled i18n module, then it worked as you expected.
the problem of this solution is that you must do some duplicated work. if you want your system to support more languages, you have to add more and more menu items. this solution is ugly.
solution no.2.
in drupal 6.3, path alias uniqued by name and language. for example, i could have an alias 'about' in language 'english' pointing to node/49, also an alias 'about' in language 'chinese' pointing to node/50. so if i store my menu item link with 'about' but not 'node/49' to the table menu_links, then i can get the right version of language when clicking the menu item, because function drupal_lookup_path() will pick up the most fitting source according alias name and current system language selection. to get this done, we need to modified the file menu.inc in include directory and menu.admin.inc in module menu. i made a patch and did some test, this works for me.

AttachmentSize
custom_menu.patch1.2 KB
menu_links.patch2.46 KB