title: I18n strategies for Go with App Engine
body: <p>Not necessarily specific to GAE I suppose, but I'm curious as to what people are using to translate or localise their web applications.</p>
  
  <p>My own approach I'm afraid is hopelessly naive, really just a hand-wave at the issue by loading an entity from the datastore for each package based on a locale value recorded in the user's profile. At least this allows translations of a few strings to be provided:</p>
  
  <pre><code>package foo
  
  ...
  
  type Messages struct {
      Locale string
      ErrorDatastore string
      LoginSuccessful string
      ...
  }
  </code></pre>
  
  <p>Store with a string id corresponding to a locale, then load to Gorilla context or similar:</p>
  
  <pre><code>const Messages ContextKey = iota
  
  ...
  
  k := datastore.NewKey(c, "Messages", "en_US", 0, nil)
  m := new(Messages)
  if err := datastore.Get(c, k, m); err != nil {
      ...
  } else {
      context.Set(r, Messages, m)
  }
  </code></pre>
  
  <p>Which is obviously incredibly limited, but at least makes strings available from calling code via context.Get(r, foo.Messages). Can anyone point me at more useful implementations, or suggest a better approach?</p>
  
  <p>Edit (relevant but not completely useful):</p>
  
  <ul>
  <li><a href="https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/6-MtqMAkTus">gettext: a MO file parser</a></li>
  <li><a href="http://godoc.org/github.com/Astaxie/go-i18n">go-18n</a></li>
  <li><a href="https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/_dHb28WG68g">Internationalization plan for Go</a></li>
  <li><a href="https://github.com/lxn/polyglot">Polyglot</a></li>
  </ul>