When using page::create() or createChild() the page is always created in the default language as per this comment.
But as part of the $props parameter, we can include a ‘translations’ array, which in the reference page is described as Create the translations collection from an array.
This sounds as possibly related to providing translations of fields when programatically creating a page, so we can create the page on all the necessary languages at once, but I can’t find any documentation or examples on it.
But… then the translations array does absolutely nothing on page creation ?
Is its purpose solely to be used in a posterior update as in the code above?
Also… if I am doing this in a loop, for regular pages with few fields, can I assume page creation is instantaneous, so for something like the code above I don’t have to worry about the page being created when running the foreach ?
Ok, but… usually the translations property contains a content object per each available language for that page is that correct ?
And what you are doing here is kind of squatting that variable with the content you will later use on the update.
If the above is correct It is perhaps a bit confusing that in page::create we can provide a translations array -which is usually the array that contains the page translations for a page that has translations in file- but in this case these translations are not applied to the created page, but just sit there.