I did some thinking about the first issue this weekend.  If mod_negotiate would allow you map languages by directory structure instead of file name, the issue of running on an unconfigured site would go away.  For example, <a href="http://fedoraproject.org/en/get-fedora">http://fedoraproject.org/en/get-fedora</a> maps to DOCUMENT_ROOT/get-fedora.html.en.  If it could instead map to DOCUMENT_ROOT/en/get-fedora, the site would work  with unconfigured servers.<br>
<br>With that in mind, I did some tinkering using mod_rewrite and had some success implementing this behavior:<br><br># If the browser prefers a language, set the prefer-language environment variable accordingly<br>SetEnvIf Accept-Language ^.*(ar|bal|ca|de|el|en|es|fa|fi|fr|he|id|it|ja|nl|pl|ro|ru|sk|sr).*$ prefer-language=$1<br>
<br>RewriteEngine on<br><br># If the query string contains ?lang=[lang], set prefer-language and redirect<br>RewriteCond %{QUERY_STRING} ^lang=(ar|bal|ca|de|el|en|es|fa|fi|fr|he|id|it|ja|nl|pl|pt_BR|ro|ru|sk|sr|zh_CN)$<br>
RewriteRule ^(?:/(?:ar|bal|ca|de|el|en|es|fa|fi|fr|he|id|it|ja|nl|pl|pt_BR|ro|ru|sk|sr|zh_CN))?(/.*)$ /%1$1? [E=prefer-language:%1,R=301]<br><br># Pick a language directory based on prefer-language<br>RewriteCond %{REQUEST_URI} !^/(ar|bal|ca|de|el|en|es|fa|fi|fr|he|id|it|ja|nl|pl|ro|ru|sk|sr|static)(/|)<br>
RewriteRule ^(/.*)$ /%{ENV:prefer-language}/$1<br><br># If a page is missing for a non-English language, fall back to the English page<br>RewriteCond %{REQUEST_URI} !-U<br>RewriteRule ^/(ar|bal|ca|de|el|es|fa|fi|fr|he|id|it|ja|nl|pl|ro|ru|sk|sr|)/(.*)$ /en/$2<br>
<br>There are potentially some issues with this solution, but it at least provides some food for thought.<br><br>-Dave<br><br><div class="gmail_quote">2008/6/12 Ricky Zhou <<a href="mailto:ricky@fedoraproject.org">ricky@fedoraproject.org</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Wow, thanks for all of the resposes to Max's call for volunteers!<br>
<br>
So here's a summary of what we're looking to do with the buildscript.<br>
<br>
Right now, we have a general process for creating the website, but it's<br>
not pretty.  Basically, we have a build script which goes through and<br>
just runs each page through genshi.  Unfortunately, when we throw<br>
translations into the mix, it gets a bit complicated.<br>
<br>
Right now, we handle translations (and the language selector) through<br>
some Apache + mod_negotiate magic (see the bottom of<br>
<a href="http://git.fedorahosted.org/git/fedora-web.git?p=fedora-web.git;a=blob;f=fedoraproject.org/httpd/conf/httpd.conf.in" target="_blank">http://git.fedorahosted.org/git/fedora-web.git?p=fedora-web.git;a=blob;f=fedoraproject.org/httpd/conf/httpd.conf.in</a>)<br>

So one immediate problem here is that it's not easy for somebody to<br>
make some changes and just scp them to their fedorapeople space (or<br>
anywhere without some specialized apache configs present).  I have some<br>
ideas for making this better (which would involve some modifications to<br>
the buildscript).  Overall, the goal is to just make our process<br>
friendlier and easier to get started with.<br>
<br>
The other general issue that I'd like to discuss is what kind of<br>
workflow we can establish for working with translators.  Right now,<br>
we're just pushing English changes up immediately (which means that many<br>
pages can be untranslated, or even partially translated).<br>
<br>
Anyway, if anybody wants to take a look at some of these issues, you can<br>
get the source of the website with:<br>
<br>
git clone git://<a href="http://git.fedorahosted.org/git/fedora-web.git" target="_blank">git.fedorahosted.org/git/fedora-web.git</a><br>
<br>
Feel free to ask any questions on-list (or we have an IRC channel,<br>
#fedora-websites on <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>).  We also have weekly meetings<br>
(see <a href="http://fedoraproject.org/wiki/Websites/Meetings" target="_blank">http://fedoraproject.org/wiki/Websites/Meetings</a> for the schedule).<br>
<br>
Thanks,<br>
<font color="#888888">Ricky<br>
</font><br>--<br>
Fedora-websites-list mailing list<br>
<a href="mailto:Fedora-websites-list@redhat.com">Fedora-websites-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/fedora-websites-list" target="_blank">https://www.redhat.com/mailman/listinfo/fedora-websites-list</a><br>
<br></blockquote></div><br>