Skip to content

Commit

Permalink
feat: add reload command to i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
LupusVirtute committed Feb 2, 2023
1 parent 28077eb commit 35359bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.lupus</groupId>
<artifactId>LCommandFramework</artifactId>
<version>0.8.1</version>
<version>0.8.2</version>

<name>LCommandFramework</name>

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/lupus/commands/core/messages/I18n.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ object I18n : HashMap<JavaPlugin?, MutableMap<String, Properties>>() {
loadResourcesInDir("locales", plugin)
}

fun reload(plugin: JavaPlugin) {
if(this[plugin] == null)
throw Exception("Plugin not loaded")

this[plugin] = hashMapOf()
loadResourcesInDir("locales", plugin)
}

/**
* Resets I18n initialization process for given plugin <br />
* This basically resets the I18n for the plugin
Expand Down

0 comments on commit 35359bc

Please sign in to comment.