I have a multilingual setup with languges un the "lc-XX" format (like "nl-BE"). I found it not very user friendly to let end users type this (case sensitive) language code and I prefer to use the url prefix, as defined in Drupal's language system, instead. End users can't be expected to care about RFC4646 language codes - they only care about the url where their content will end up.

That's why I wrote this patch. It adds a new variable and two radio buttons on the filter configuration page. With the trigger setting changed to 'url prefix', the "nl-BE" language can now be triggered using "== be ==".

I wrote this patch for D6 only, so this code will probably break when the module is running in a D5 environment, or do nothing at best. That's why I'm marking it as 'code needs work'.

CommentFileSizeAuthor
language_sections_trigger.patch2.01 KBmarcvangend

Comments

andy inman’s picture

Seems like a good idea. I can't help thinking that the whole issue of translation and multi-language sites in Drupal needs a major re-visit/re-design. Language Sections is arguably a hack for something that should be easier to do in out-of-the box Drupal - hope the Powers-that-be are listening!

Sorry for my lack of activity - I try to do Druapl open-source stuff when not tied up on other projects, but recently have been very tied up as part of a team taking on the UK Government and others, so not a minor project - www.ksfiomdepositors.org

andy inman’s picture

Status: Needs work » Postponed (maintainer needs more info)

Just taking another look at this. Your suggestion is very valid, and I think it should probably be the default behaviour. The thing I am not sure about is whether it's valid in all cases, i.e. is it always the case that when the RFC language code is xx-yy the Drupal url language prefix is yy ?

marcvangend’s picture

If the RFC language code is xx-yy, the Drupal url language prefix is not by definition yy. However, if I'm not mistaken (it's been a while since I posted this patch) that's not how the patch works. The patch uses the prefix value that has been set on the language configuration page, like /admin/settings/language/edit/en, so it is configurable.

andy inman’s picture

Thanks for that clarification, it makes better sense now. Ok, your patch makes sense, and probably needs to be a configurable option, just as you have made it. It certainly seems correct to me that the language code used by LS should be the same as the code used by Drupal.

marcvangend’s picture

OK, thanks for your feedback.

andy inman’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

V2 now released - in the end I've taken your idea and built something more flexible, so thanks again for the idea. Closing this.