Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

  (email not shown publicly)

I work for MessageLabs [] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Thursday February 20, 2003
10:39 AM

Internationalisation, AxKit style

[ #10690 ]

I just had a really cool idea to help with internationalisation when using AxKit... Basically you develop one site on one server but point different domain names at the same IP - so you might get, etc etc.

Then you write a StyleChooser module for AxKit that picks the stylesheets based on the Host: header.

Of course you need to do all the other things you have to do in i18n like try your best to select based on Accept-Languages and so on. But this fits very nicely into AxKit's architecture.

It also solves a problem for me - what if companies want to re-sell your service, but change the look and feel of the "admin" site. You simply do the same as above, but implement a complete restyling rather than just i18n.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • It would seem more standard to use subdirectories instead of subdomains, judgeing from what's out there right now. Anyway, something to make i18n would be sweet, right now the best i18n ideas I've seen are in Cocoa (which makes it dirt easy).
    • Robin Berjon has lots of experience writing i18n stuff with AxKit, though we should probably take this to the users list now.

      Personally though I think it looks nicer to give different countries their own domain and do i18n that way. I don't like the whole subdirectory thing.
    • I personally prefer domains, but that's mostly because I like the directory structure to reflect the organisation of content (language being an attribute or possibly a view, not a section).

      What you still have left to do after using Matt's trick or something similar is images. Images that have text on them should be language specific, while others should be shared. You can use content negotiation for that (, but that only works when the browser is set-up right, so you often


      -- Robin Berjon []

      • Images is handled by the selection of stylesheet.
        • You'll have to excuse me but that is a bit cryptic :)


          -- Robin Berjon []

          • Sorry :)

            I mean if you've got a stylesheet being chosen based on Host: your stylesheet can point to french or german or other images, and also point to shared ones.
            • Of course, but the idea is to have a nice way to not have to worry too much about that during stylesheet creation and file management. IOW, it's much better if you can simply have <img src='foo.png'/> in your stylesheet, and have Apache pick up or automagically for you (as in conneg). It saves one from a lot of stupid mistakes :)


              -- Robin Berjon []

              • Ah, well your AxKit plugin can do that for you. Just set $r->filename() and then return DECLINED.
                • Yes, that's, definitely one option I was thinking about, I just thought it might be nicer if the plugin could $r->header('Accept-language', 'fr'), return DECLINED, and let mod_negociation deal with selecting the image (irrespective of order so that,, all work) and defaulting.


                  -- Robin Berjon []

      • OK, I understand that. I agree that the filesystem should be the content (I'm sticking to that to, until some unsolvable problem disabuses me in the future ...) It would be pretty sweet if axkit would pick the images automatically, specifically, if they're in, it would look for /img/ and serve it up as foo.png. Also, it would be nice, if there is no localized image, it would simply fall back on the non-localized image, so that you don't have to make localized versions of everything