Andrew Swift Andrew Swift - 1 year ago 82
Apache Configuration Question

Can directory listings appear in different languages with .htaccess?

I have set up a simple site for a design client at where I put finished design projects.

The site is set using Apache directory listings with subdirectories for logos, flyers etc.

The problem is that the listing headers (name, last modified & size are in English and I would like them to appear in French.

Is it possible to specify the header language in the .htaccess file or elsewhere?

Is it possible to make it automatic, based on the user's system language?

Answer Source

Sorry, I don't think you can do this with the default directory-listing module that ships with Apache.

By default, directory listings are generated by Apache's mod_autoindex, which according to the latest version in the repository [1] does not have any translations for strings such as "Last modified" etc.

If you don't care about it being in the user's preferred language and just be in French all the time, I'm guessing that if you translate all the strings in that file, recompile the module, reinstall it and restart Apache, it'll do what you want -- although it's probably more work than finding some other directory generation tool out there with support for translations on a per-user basis.

[1] See at line 1584: the "Last modified" string is hardcoded, does not refer to a dictionary of translations.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download