<div dir="ltr">For those interested in translations, I'd like to jot down a few notes from the last few days' work to get i18n'd strings into Ironic before our RC. Hopefully some of this will be helpful to someone out there -- it's been a learning experience for me :)<div>

<br></div><div>Quick background:</div><div>- the project was set up with transifex a while back</div><div>- folks have been translating our strings on transifex</div><div>- jenkins has been regularly proposing updates to ironic, which we've accepted</div>

<div><br></div><div>However, late last week I noticed that none of the ironic/locale/*/LC_MESSAGES/ironic.po files had any actual translated strings in them. Some digging revealed that there were two problems:</div><div>
* most of the .po files had somehow gotten malformatted (duplicate blank messages). We now have a tox check to prevent this.</div>
<div>* the file timestamps were newer than the translations on transifex. Easy work around is "pull --force".</div><div>Manual fixes for both of these have landed in Ironic, and longer-term fixes have gone up for infra and some other projects.<br>

</div><div><br></div><div>To determine whether or not this was successful in enabling translated strings in Ironic, I had to learn a few things about babel and gettextutils, but there's still a lot more catching up on the whole i18n discussion that I need to do. This morning, I confirmed, in fact, our LOG messages are getting translated based on the system language, if the correct locale's .mo file is found in the appropriate system path, or that path is overridden with the IRONIC_LOCALEDIR env var. At the moment, Ironic's API strings will also be translated based on the system language, not on the Accept-Language header. </div>

<div>  <a href="https://bugs.launchpad.net/ironic/+bug/1300939">https://bugs.launchpad.net/ironic/+bug/1300939</a></div><div><br></div><div>I've jotted down some notes on how to recreate an environment which reproduces this without needing to package and install ironic.<br>

</div><div>  <a href="https://etherpad.openstack.org/p/TestingTranslations">https://etherpad.openstack.org/p/TestingTranslations</a></div><div><br></div><div>It also seems that we're not programatically testing whether translation works or not. Maybe there's a good reason this hasn't been done yet... but after spending a couple days getting it to work in Ironic, I would like to add a test to our gate so that I know it stays working. I'm not sure the best way to go about that, but I hope someone who knows more about tx/msgfmt/babel/etc can look at my notes above and suggest or get something going from that.</div>

<div><br></div><div>Cheers,</div><div>Devananda</div></div>