How to create localized entries from code?

Works great for me, big thanks