How to create localized entries from code?

Thanks for the explanation!