Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR aims to automatically copy default locale files from the plugin resources to the locales folder during startup. Key changes include:
- Removal of the explicit creation of the locales directory in LocaleManager.
- Addition of code in Rocket.kt to copy the default locale "en_GB" to the locales folder.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/kotlin/dev/znci/rocket/i18n/LocaleManager.kt | Removed explicit directory creation for the locales folder, which may impact file listing if the folder does not exist. |
| src/main/kotlin/dev/znci/rocket/Rocket.kt | Introduced a default locales array and resource copy logic using saveResource. |
Comments suppressed due to low confidence (1)
src/main/kotlin/dev/znci/rocket/i18n/LocaleManager.kt:73
- Removing the explicit directory creation may lead to issues when listing files if the locales folder does not exist. Consider re-adding the mkdirs() call or ensuring the folder's existence elsewhere before listing files.
if (!langFolder.exists()) langFolder.mkdirs()
|
Qodana Community for JVM42 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
uses an array of default locale names, loops through them, and saves them to the directory using the
JavaPlugin#saveResourcemethod