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

How to do custom language files? #2

Open
Miniontoby opened this issue Dec 9, 2023 · 0 comments
Open

How to do custom language files? #2

Miniontoby opened this issue Dec 9, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Miniontoby
Copy link

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
@Unp1xelt Unp1xelt self-assigned this Apr 16, 2024
@Unp1xelt Unp1xelt added the enhancement New feature or request label Apr 16, 2024
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

No branches or pull requests

2 participants