iPhone 15 Pro and iPhone 15 Pro Max users can select a new "Translate" option for the Action Button with the new iOS 17.2 beta. Apple promised that a Translate option was coming for the Action Button, but said that it would not be available right when the new iPhones launched in September.
When the Action Button is set as Translate, pressing to hold causes the iPhone to pop up a Translate window that listens for spoken text. It is able to translate from one set language to another, using the languages that you have previously set up in the Translate app.
The languages you translate between can be changed by selecting different languages in the Translate app. The Translate app supports Chinese, English, Dutch, French, German, Indonesian, Italian, Spanish, Korean, Japanese, Polish, Portuguese, Russian, Thai, Turkish, Ukrainian, and Vietnamese.
To choose the Translate option for the Action Button, open up the Settings app, scroll down to Action Button, and then swipe through until you get to the Translate function.