A language picker often shows the language's own name alongside a translated label. That can put right-to-left and left-to-right text in the same row. Knowing that the option represents Arabic does not mean every piece of text in that row should read right-to-left.
In API 2.0.0, a Language lookup returns the language code, name, name_local, script, and direction. /language/ar identifies Arabic and returns direction: "rtl". The corresponding native name is العربية. direction is available without requesting Deep.
For a known Arabic label in an otherwise English picker, your markup can keep that label's language and direction together:
<button type="button" data-language="ar">
<bdi lang="ar" dir="rtl">العربية</bdi>
</button>
bdi isolates the label from surrounding text. The lang attribute identifies the content's language, while dir sets its base reading direction. W3C's direction guidance explains why declaring a language does not also declare a direction. When the whole document is Arabic, put those attributes on the document rather than treating every paragraph as an exception.
The API's display-language option answers another question. /language/ar?lang=fr still looks up Arabic. It asks for the display name in French when that translation is available. It does not change the returned language, script, or direction, and it does not translate name_local.
Apply direction to the text you actually display. The French display name for Arabic is French text, so the Arabic record's rtl value is not a reason to give that label an Arabic reading direction. Use the reference direction for known content in the selected language, including its native label. For text whose direction you do not know, W3C also describes dir="auto", which lets the browser inspect the content.
Country data cannot settle a person's choice. A country can list several languages, and an association with a language does not establish which one this person wants. Keep the chosen language code as an application preference. Two- and three-letter lookup forms such as en and eng resolve the same language, while the response gives its shortest supported code.
That leaves the interface with three understandable facts: which language the person selected, which language a particular label uses, and how that label's text should flow. They can differ without the picker being inconsistent.