On Mon, Nov 04, 2013 at 07:46:25PM -0800, Antoine Grondin wrote:
> > @@ -105,6 +106,29 @@ func (b *Brog) ListenAndServe() error {
> >  	return http.ListenAndServe(addr, nil)
> >  }
> >  
> > +func (b *Brog) serveLanguageSelectPage(rw http.ResponseWriter, lang string) bool {
> > +	langSet := false
> > +	for _, val := range b.Config.Languages {
> > +		if strings.Contains(lang, val) {
> 
> Have you tested this with many URLs see if it triggers in other cases?  Say if the chain `fr` or `eng` exists in a post name. I think using URL.Values would be safer even if the URL doesnt look as neat.  
> 

A few things ensure that that doesn't happen:
- It only runs when the index is requested (so /posts/* isn't affected and neither is /assets/*; / is the catchall so /omggrejklsg would be caught, see next point)
- If the url is /EnglishSucks?fr#nl then RawQuery is "fr"
- If one wants to view multiple languages, /?enfres is completely valid. I might piece it out into an array of two character strings though because of things like denl.

Yes, multiple languages on one page is intentionally supported because I think it *might* be useful in some odd situation and I'm a lazy programmer.