Strings won't be translated in Django using format function available in Python 2.7
compilemessages
sees the string as "{sitename} is a good website", but when the app is running the string is actually e.g. "MySite is a good website", which of course doesn't have a translation. You must translate the bare string first, and then you can perform template operations on it.
The following should work:
_('Foo %(x)s') % {'x': "bar"}
s
is the string, d
is the intiger.