What's the meaning of にあたって/にあたり? How can I translate it?
For example, how can I translate it in these sentences:
I think you can use ～にあたって and ～にあたり interchangeably in most cases. I think both can mean "on the occasion of; at this time of; upon doing~~". (～にあたり sounds more formal than ～にあたって to me.)
*The 注意をする means "to give (someone) advice/warning". --> See goo辞書「注意」#3
By the way, にあたり/にあたって can follow a noun, as well as a verb:
I think they can also be replaced with に際し/に際して:
(As an aside, I think 「~~(する)にあたりまして/際しまして・・・」 is preferred in a formal speech.)
matreya is correct. にあたって could be replaced in the above sentences by とき 'toki' meaning "time", and hence "when". The construction is grammaticalized from the case marker に plus a form of the verb あたる 'hit.intransitive'. For instance as in
矢は的にあたった。 The arrow hit the target.
The argument marked here with に is a directional complement of the verb. That the construction にあたって is grammaticalized can be verified by the inability to pause between the case marker and the verb. In my example, pausing is possible between the directional complement and the verb, hence the verb is fully lexical there. This construction belongs to a class of case marker-verb constructions that have become grammaticalized constructions. Other such constructions are にとって 'for', として 'as', or において 'in, at'. One should also keep in mind that にあたって belongs to a more formal register of speech, much as において. にとって and として, however, are widely used in spoken Japanese.