Adds API to enable translations to be set and specific API for flags #2109
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was a request on Discord so that plugins can set flags and set the name and lore for them too.
The translations can be set after building the flag. I did not add the option to set translations to the flag builder (yet) because setting translations may require some logic to discover what locales are supported on the server, and then iterate through them assigning the appropriate translation.
Example to set the name and description for a flag:
Example to set a reference via API generically:
Setting translations via API is not permanent, i.e., translations are not stored in the locale files and the files are not changed. So, they can be temporarily overwritten, but not fundamentally changed.
The fallback locale for any reference is
Locale.US
so that should be set at a minimum.