Setting the default locale for a page that is created programmatically

Hi everyone,
I was wondering how to correctly set the default locale for a page that is created in velocity. I have looked for info on this topic on this forum but I am still not sure about some things.

  1. Is it correct to (for example) use $doc.setDefaultLocale("en")?
  2. Is it still needed to have programming rights for this?