Tusky icon indicating copy to clipboard operation
Tusky copied to clipboard

Language setting GSW leads to EN

Open FlohEinstein opened this issue 1 year ago • 1 comments

When writing a post with language setting "GSW" (Swiss German) and publishing it, it still shows as "EN" afterwards. Android Version: 13 Tusky Version: Tusky Test 24.1-17e99bbc Instances: Reproducible on at least the instances chaos.social and neurodiffent.me Example: https://neurodifferent.me/@FlohEinstein/111928088376633846

FlohEinstein avatar Feb 14 '24 14:02 FlohEinstein

I can attest that this happens for at least one other language, Cantonese.

The approach that Tusky currently takes to build the language list (ask the app and the Android system for a list of supported languages, and then use Locale.toLanguageTag() to get the 2- or 3-letter code for each language) can run into three problems:

  1. Including languages that the Mastodon instance does not support;
  2. Excluding languages that the Mastodon instance does support;
  3. For languages that Tusky includes and Mastodon supports, adopting a language code that Mastodon does not understand.

@FlohEinstein ’s issue belongs to (1); my problem with the Cantonese language belongs to (3).

The Mastodon API endpoint /api/v1/instance/languages lists the languages supported by the instance. One possible approach to solving this issue might be just adopting the list of languages returned by the API, instead of asking Android.

But alas, Pixelfed does not support this endpoint (yet).

chungf avatar Jan 24 '25 15:01 chungf