Skip to content

Conversation

Gaming32
Copy link
Contributor

@Gaming32 Gaming32 commented Sep 11, 2025

This adds the ability for messages returned from backend to have translation keys for the frontend to translate. This is the first of two PRs. This PR sets up the framework and integrates it into labrinth. The next PR will add it to theseus.

The PR adds a type used for translation sent from the backend:

type TranslationData = string | {
	key: string
	values?: {[key: string]: TranslationData}
}

This type is used in the following places (v3 only):

  • A new translatable_error field in the ApiError type
  • A new translatable_name field in the Notification type
  • A new translatable_text field in the Notification type

It is worth noting that a large number of these messages will never be shown to any frontend user, but to avoid making the system more complex to separate "impossible" messages from "possible" ones, all messages are localizable.

@Gaming32 Gaming32 added enhancement New feature or request backend Relates to Modrinth Backend or API labels Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Relates to Modrinth Backend or API enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant