From: Teemu A. <te...@io...> - 2005-03-23 15:42:03
|
>> 1. >> task_name and action_name are not anymore in CTX->request. Is there >> other way to access those through the context? > > Why do you need them? I thought of keeping them in the request after > implementing the ActionResolver but couldn't think of a good > reason. (And that's not saying there isn't one.) Actually I don't. Just noticed they are removed (docs not updated!). I used them in several places for various reasons in my code and I had to change the code to just get that stuff out of url_relative. I think it's cleaner now, I think request has nothing to do with actions anyway. url_relative and url_absolute include the GET parameters now. Nice, now I can work with the state as I proposed a long time ago. I used those also as something like: $url = CTX->request->url_relative . '/help'; If the URL includes GET parameters, that piece of code obviously doesn't work anymore as it did previously. Thinking aloud: No problem with that, I can always strip the GET parameters when I use it like that so a GETless accessor is not really required. > My mp2 experience is lacking as well. This is still important, some distros like Fedora include (I think?) only Apache2. > The PO parsing is done entirely in Locale::Maketext::Lexicon::Gettext, > so if there's a bug in the parsing we should probably let them know. Nothing wrong with the parser, it works ok. This null entry just breaks the TT stuff you already suggested to fix. > - create classes for all supported languages > - assign keys/values directly into created class > > That way there should be no modification of the original variable and > it will maintain its utf8 (or other) metadata. That's great. While you are at it, change the OI2 stock .msg file parser to read keys that have spaces etc. in them as well. I'm commiting the following as I now received feedback on them: >> Also, my patch removes unnecessary dublicate key errors. >> lib/OpenInteract2/I18N.pm >> Changes the system so that instead of returning "Message error for '$key'" >> it returns the key itself in case no translation is found. One thing with this. If the requested translation is: Hello [_1]! If a translation is found, it gets replaced something like: Hello John! But if the key is returned (no translation found) that [_1] is not replaced. I think this is perfectly ok, although we could just add something like this: $key =~ s/\[_(\d+)\]/\%$1/g; return sprintf( $key, @params ); >> lib/OpenInteract2/Request.pm >> OI2 always selects the language provided by the browser (user agent). Well, it was a bit >> difficult to change the language as a user, because it had no effect ;) >> I changed this chain to something more logical: >> >> Changes the order in how the language is selected: >> - prefers $lang_config->{choice_param_name} over user or session language >> - prefers user and session language over user agent provided languages >> - prefers everything else over $lang_config->{default_language} -- Teemu Arina, CTO Ionstream Oy / Dicole Komeetankuja 4 A 02210 Espoo FINLAND Tel: +358-(0)50 - 555 7636 skype: infe00 Corporate website: http://www.dicole.com FLOSS in education blog: http://flosse.dicole.org Personal weblog: http://infedelic.blogspot.com "Discover, collaborate, learn." |