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

[feature] Support any valid BCP 47 tag as a posting language #2066

Closed
Tracked by #2061
VyrCossont opened this issue Aug 3, 2023 · 0 comments · Fixed by #2067
Closed
Tracked by #2061

[feature] Support any valid BCP 47 tag as a posting language #2066

VyrCossont opened this issue Aug 3, 2023 · 0 comments · Fixed by #2067
Labels
enhancement New feature or request

Comments

@VyrCossont
Copy link
Contributor

VyrCossont commented Aug 3, 2023

Is your feature request related to a problem ?

As a client dev, I want my users to be able to post in whatever languages they use, and to be able to mark their posts as being in those languages. ActivityStreams specifies BCP 47 for language coding, so this could potentially be any language with a BCP 47 tag.

Describe the solution you'd like.

Current GtS only accepts bare ISO 639 language codes when posting, so you can post in en but not en-US, and zh but not zh-Hans or zh-Hant (this last is definitely a thing people might ask for, see mastodon/mastodon#18538 for background).

GtS should accept BCP 47 tags for post languages, and for an account's default language. BCP 47 tags should be canonicalized on receipt.

Describe alternatives you've considered.

Implementing an equivalent of the Mastodon API endpoint mastodon/mastodon#24443 to return a safelist to the client of all languages that are supported. We decided in chat that this was unnecessary.

Additional context.

For reference, mastodon/mastodon#23541 is the Mastodon equivalent of this feature request, and makes the same observation that AP/AS2 supports more than just ISO 639 codes.

@VyrCossont VyrCossont added the enhancement New feature or request label Aug 3, 2023
VyrCossont added a commit to VyrCossont/gotosocial that referenced this issue Aug 3, 2023
tsmethurst pushed a commit that referenced this issue Aug 7, 2023
* Allow full BCP 47 in language inputs

Fixes #2066

* Fuse validation and normalization for languages

* Remove outdated comment line

* Move post language canonicalization test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant