Update for easier translation management - #3
Open
alan67160 wants to merge 8 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Locale-API plugin to improve localization file override behavior (preferring /plugins/Locale-API/lang files before bundled resources), expands/updates the bundled en_gb.json language data, and bumps the project version to 1.1. It also introduces CI/build and publishing configuration changes.
Changes:
- Add plugin data/lang directory creation on startup and update locale loading to check external lang files before bundled resources.
- Expand the
en_gb.jsontranslation set. - Update project versioning and add a GitHub Actions Maven build workflow (with updated Maven publishing settings).
Reviewed changes
Copilot reviewed 6 out of 135 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/lang/en_gb.json | Updates/expands bundled English (UK) translation keys/values. |
| src/main/java/de/unpixelt/locale/UsedLocalesCommand.java | Allows /usedlocales to be run by op senders in addition to console. |
| src/main/java/de/unpixelt/locale/Translate.java | Ensures plugin data/lang directories exist on enable. |
| src/main/java/de/unpixelt/locale/LocaleReader.java | Loads locale JSON from disk override first, then falls back to jar resources. |
| README.md | Bumps documented dependency version to 1.1. |
| pom.xml | Bumps version and modifies distribution/javadoc build settings. |
| .gitignore | Adjusts ignored IDE directories (stops ignoring .github/). |
| .github/workflows/maven.yml | Adds Maven build workflow for CI. |
Comments suppressed due to low confidence (1)
.github/workflows/maven.yml:27
- actions/setup-java is pinned to v3 and uses the legacy 'adopt' distribution. Prefer setup-java@v4 with a supported distribution (e.g. temurin) to reduce the chance of CI breakage as actions are deprecated over time.
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+64
to
+68
| File dataFolder = Translate.getPlugin().getDataFolder(); | ||
| File langFolder = new File(dataFolder, "lang"); | ||
| File langFile = new File(langFolder, fileName); | ||
| InputStream inputStream = null; | ||
| if (langFile.exists()) { |
Comment on lines
24
to
28
| <repository> | ||
| <id>github</id> | ||
| <url>https://maven.pkg.github.com/Unp1xelt/Locale-API</url> | ||
| <id>repsy</id> | ||
| <url>https://repo.repsy.io/mvn/alan67160/maven</url> | ||
| </repository> | ||
| <snapshotRepository> | ||
| <id>github</id> | ||
| <url>https://maven.pkg.github.com/Unp1xelt/Locale-API</url> | ||
| </snapshotRepository> | ||
| </distributionManagement> |
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 |
%localeapi_locale% %localeapi_key_block.minecraft.iron_orew%
…-API/custom/<locale>.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request introduces several improvements and updates to the project, including enhancements to localization file handling, build automation, and dependency management. The most significant changes are grouped below:
Localization File Handling Improvements:
LocaleReader.javaandTranslate.java: The plugin now checks for language files in the plugin's/plugins/Locale-API/langdirectory before falling back to bundled resources, allowing for easier customization and overrides. The necessary directories are created on plugin startup if they do not exist. [1] [2]UsedLocalesCommand.java: The/usedlocalescommand can now also be run by players with op, not just the console.before merge please remove or change
.github/workflows/maven.ymlandpom.xmlas they has been slightly modified for my own
Also, I have bump up the resources/lang to minecraft 1.20
These changes improve the flexibility of localization.