Does anyone know a way to query the logged-in account's locale using the Mastodon API? From what I can tell, I need this to determine whether to show the Translate button or not.
@apps Would do that as a last resort, but I can never be sure that it's the correct one and that translation will work… Kind of a shame the translation endpoint doesn't take a target language parameter
@megalodon also we use our own server https://translate.fedilab.app so it is not limited to instances that support translations. You can of course use it for your app.
@kepic@megalodon By default, the app can't guess that. On our end, users can set different targeted languages. When clicking the translate button it asks which language if several.
@apps@toot.fedilab.app@megalodon@floss.social I hold everburning hatred toward anyone using locale as replacement for language. I want text to be in English, even if my locale is Finland. Why the heck is it so difficult to understand and implement this?
@megalodon Yes but from the api endpoint, you can get what languages an account uses for posting. If a message does not target these languages, the app displays a translate button.
@apps If I do that, I could still have cases like this:
* My Mastodon account is set to English * My phone could be set to German * Megalodon would display a translate button for English posts, but not for German posts * Mastodon would try to translate English posts to English
…all because I display the translate button for the wrong language. I think I might actually go for the HTML scraping approach to get the right language ?