Skip to content

Update for easier translation management - #3

Open
alan67160 wants to merge 8 commits into
Unp1xelt:masterfrom
alan67160:master
Open

Update for easier translation management#3
alan67160 wants to merge 8 commits into
Unp1xelt:masterfrom
alan67160:master

Conversation

@alan67160

@alan67160 alan67160 commented Jul 26, 2026

Copy link
Copy Markdown

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.java and Translate.java: The plugin now checks for language files in the plugin's /plugins/Locale-API/lang directory 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 /usedlocales command can now also be run by players with op, not just the console.

before merge please remove or change .github/workflows/maven.yml and pom.xml
as 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.

Copilot AI review requested due to automatic review settings July 26, 2026 05:24
@alan67160 alan67160 changed the title Update Locale API and versioning for easier translation management Update for easier translation management Jul 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json translation 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 thread pom.xml
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%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants