Forum Moderators: phranque

Message Too Old, No Replies

SSI language choices

Ssi, language, translation

         

hendry

11:40 am on Jan 20, 2004 (gmt 0)



I am trying to setup content negotiation (translations) on a apache server. In the footer of the page, I want offer a choice of other languages, like debian.org.

I want to have various translations of a resource in a directory:

index.en.shtml
index.de.shtml
index.sv.shtml

Now I am trying to discover the SSI code that tests if a file/translation exists:

<!--#if expr="-e index.fi.shtml" -->
<li><a href="index.fi.shtml">Suomeksi</a></li>
<!--#if expr="-e index.fi.shtml" -->
<li><a href="index.en.shtml">English</a></li>
<!--#endif -->

This is not working.

[httpd.apache.org...]

I am not sure if apache's mod_include expr syntax can do it. My apache server has disabled exec.

Comments?

davidpbrown

12:18 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



This is not something I've done but maybe use PHP
if (is_file($somefile)) {
include stuff;
} else {
dont include stuff;
}

----
re negotiation
I'm surprised ht*p://www.debian.org/intro/cn#howtoset suggests not to use country extensions to a language eg. en-GB, suggesting these aren't aknowledged.

Not having content negotiation enabled I settled on PHP, which does accept language extensions etc, your welcome to the code if you need it.