Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide UI-language via API #27439

Open
zeitschlag opened this issue Oct 16, 2023 · 0 comments
Open

Provide UI-language via API #27439

zeitschlag opened this issue Oct 16, 2023 · 0 comments
Labels
api REST API, Streaming API, Web Push API suggestion Feature suggestion

Comments

@zeitschlag
Copy link

zeitschlag commented Oct 16, 2023

Pitch

Is there an API to determine the language set by the user under /preferences/appearance? I'm asking as this seems to have an effect on translations?

There doesn't seem to be an API-endpoint to fetch the UI-language set by the user under /settings/preferences/appearance. This language seems to have an effect on translations.

When I set this language to German and want to translate a German toot from the iOS-app, I get a HTTP status-code 403 and a JSON that looks like this: {"error": "This action is not allowed"}. Translating an English toot works.

If we knew this UI-language in the app, we could hide the "Translate"-option from the user. If we don't know that language, the only, but unreliable way I can think of, would be to use the device-language.

Regardless of providing this value via API, you could also think about letting the translation-services "translate" from language A to language A so that translate doesn't return an error/403.

Thank you!

Motivation

  • 3rd-party-developers who want to use the built-in translate-function in their apps, would benefit from this.
  • Mastodon for iOS could hide the translate-option for those status-posts (and I'm pretty sure that Android could benefit from this, too!)
@zeitschlag zeitschlag added the suggestion Feature suggestion label Oct 16, 2023
@vmstan vmstan added the api REST API, Streaming API, Web Push API label Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api REST API, Streaming API, Web Push API suggestion Feature suggestion
Projects
None yet
Development

No branches or pull requests

2 participants