Skip to content

How to do custom language files? #2

@Miniontoby

Description

@Miniontoby

Hi,

Would it be possible to make a way to (also) use a different plugin it's language files?
So that you can have custom keys, like not everything I want to translate is in normal minecraft.

It should be possible to do something like this:

    @NotNull
    private InputStream getFileFromPluginResource(String pluginName, String path) {
        Plugin plugin = PluginManager.getPlugin(pluginName);
        if (plugin == null) {
            throw new IllegalArgumentException("Plugin not found! " + pluginName);
        }
        InputStream inputStream = plugin.getResource(path);

        // The stream holding the file content
        if (inputStream == null) {
            throw new IllegalArgumentException("Filepath not found! " + path);
        } else {
            return inputStream;
        }
    }

But that is only the code to read the file, of course, but the rest should be the same, I think...

Kind regards,

  • Miniontoby

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions