Skip to content

Add support for grouped/list translations in translation stores #1452

Description

@MerryDev

Adventure's translation stores currently map a translation key to exactly one translation value. This works well for regular messages,
but makes multi-line messages somewhat inconvenient when translations are stored in .properties files.
For example, a help message may currently be represented as separate translation keys:

command.help.0=<gray>---------------------
command.help.1=<yellow>/help <gray>- Shows this help
command.help.2=<yellow>/reload <gray>- Reloads the plugin
command.help.3=<gray>---------------------

There currently does not appear to be an API for retrieving these related translations as a logical group/list. This is particularly noticeable when using MiniMessageTranslationStore, where lists of translated MiniMessage components are a fairly natural use case. It could be useful to provide an API for retrieving grouped translation.

Something like this would be great to have
List<Component> group = store.group(key);

--> e.g. group.forEach(player::sendMessage);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions