Skip to content

GH-950 Single Global Language from Config, Remove Per-User and GUI #950

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vLuckyyy
Copy link
Member

@vLuckyyy vLuckyyy commented Jun 27, 2025

This PR completely refactors the EternalCore language/translation system to be as simple and user-friendly as possible.
All legacy features related to per-user language, GUI selection, client detection, and language databases have been removed.

Key Changes
  • Removed all per-user language logic:
    No more language selection per player, no database, no client detection, no GUI.

  • Removed all code and config for language.yml, LanguageService, LanguageProvider, and related classes.

  • TranslationManager now uses only a single language, set globally in config.yml.

  • NoticeService and other components now always use the global language.

  • Translation classes (e.g. ENTranslation, PLTranslation) now use a string language code, not an enum.

  • It is now possible to add any number of custom languages without touching the codebase.

How the new language system works
  • The language is set globally in config.yml:

    language: "pl" # or "en", "fr", etc.
  • The plugin loads the corresponding translation file from lang/<code>-messages.yml.

  • All users see the same language, regardless of their client or preferences.

  • To add a new language, just add a new translation file and set the code in config.

  • No GUI, no per-user settings, no database, no detection—just one config option.

Why?
  • Simplicity: One config, one language, zero confusion.
  • Performance: No per-user lookups, no extra database or cache.
  • Flexibility: Add as many languages as you want, just by adding files.
  • Maintenance: Much less code, easier to maintain and extend.

ℹ️ Why did I make this decision?
On a typical production server, there are around 50–70 plugins. Imagine that EternalCore is the only plugin using its own advanced language system — per-user logic, GUIs, databases, and client language detection.
Why should we offer a complex user language system that nobody else integrates with and nobody actually uses?

💡 Additional reasoning:

  • This kind of system creates inconsistent UX, where only EternalCore uses per-user translations and everything else is static.
  • Language selection GUIs are overkill — players almost never interact with them.
  • Client language detection is unreliable, especially when using proxies, modded clients, or custom launchers.
  • In reality, 99% of servers use a single language and don't require full multi-language support.
  • Maintaining and debugging a per-user system is wasted dev time.
  • This change results in better UX, better performance, better cohesion, and much simpler config.
  • It also reduces code complexity and the surface area for potential bugs.

💬 What if someone wants a multi-language server?
If a server truly needs a per-user multilingual environment, it should use dedicated, specialized solutions like:

  • Triton – Sends the same message in different languages... Hooks into all plugins!
  • A custom proxy-layer approach (e.g. Velocity or BungeeCord) with dynamic language routing.
  • Another own solution.

EternalCore should not be responsible for powering multi-language support across the server. That’s a job for standalone systems. Instead, EternalCore now provides a clean, efficient single-language mechanism that fits most use cases perfectly.

✅ This system is practical, faster, easier to configure, and better aligned with real-world server needs.

@CLAassistant
Copy link

CLAassistant commented Jun 27, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

coderabbitai bot commented Jun 27, 2025

Walkthrough

This update removes all features related to managing individual player languages. It deletes the language service, repository, commands, and configuration for multiple languages. Instead, the system now uses a single language setting from the main configuration for everyone. Translation handling and GUIs are simplified to work with this one language, and all code that supported per-player language preferences is cleaned up or removed. The overall effect is a streamlined approach focusing on a global language rather than personalized language options.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ff8a0c and ebf8f42.

📒 Files selected for processing (4)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/composer/LanguageComposer.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/implementation/PluginConfiguration.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/implementation/PluginConfiguration.java
🚧 Files skipped from review as they are similar to previous changes (3)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/composer/LanguageComposer.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@vLuckyyy vLuckyyy changed the title Single Global Language from Config, Remove Per-User and GUI GH-950 Single Global Language from Config, Remove Per-User and GUI Jun 27, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/fullserverbypass/FullServerBypassController.java (1)

57-71: Translation calls updated but logic can be simplified.

Both branches now use the same global translation, making the user existence check redundant.

 private String getServerFullMessage(Player player) {
-    Optional<User> userOption = this.userManager.getUser(player.getUniqueId());
-
-    if (userOption.isEmpty()) {
-        return Joiner.on("\n")
-            .join(this.translationManager.getMessages().player().fullServerSlots())
-            .toString();
-    }
-
-    User user = userOption.get();
-
     return Joiner.on("\n")
         .join(this.translationManager.getMessages().player().fullServerSlots())
         .toString();
 }
♻️ Duplicate comments (1)
eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpInventory.java (1)

255-261: Same casting issue here.

The unsafe cast to AbstractTranslation should be avoided for the same reasons mentioned in the addWarp method.

🧹 Nitpick comments (5)
eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/AbstractViewerArgument.java (1)

22-30: Translation calls updated correctly.

Both branches now properly use the global translation. Since both paths are identical, consider simplifying:

 @Override
 protected ParseResult<T> parse(Invocation<CommandSender> invocation, Argument<T> context, String argument) {
-    if (invocation.sender() instanceof Player player) {
-        Translation translation = this.translationManager.getMessages();
-        return this.parse(invocation, argument, translation);
-    }
-
-    Translation translation = this.translationManager.getMessages();
+    Translation translation = this.translationManager.getMessages();
     return this.parse(invocation, argument, translation);
 }
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (1)

24-24: Remove unused import.

The java.util.Locale import is not used in this file and should be removed.

-import java.util.Locale;
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/TranslationFactory.java (1)

10-17: Good implementation with flexible language matching.

The case-insensitive comparison for language codes is a nice touch. Consider using English comments for consistency with the rest of the codebase.

-        // Możesz tu dodać if-y dla własnych klas tłumaczeń
+        // You can add if statements here for your own translation classes
 if (languageCode.equalsIgnoreCase("pl") || languageCode.equalsIgnoreCase("pl-pl")) {
     return new PLTranslation(languageCode);
 }
-        // Domyślnie angielski
+        // Default to English
 return new ENTranslation(languageCode);
eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManager.java (2)

14-14: Consider thread safety for the mutable translation field.

Since this field can be changed via setTranslation(), consider making it volatile or using proper synchronization if this class is used in a multi-threaded environment.

-private Translation translation;
+private volatile Translation translation;

30-32: Document that locale parameter is ignored.

Since this method now ignores the locale parameter and always returns the single translation, consider adding a comment to clarify this behavior.

 @NotNull
 @Override
+// Note: locale parameter is ignored in single-language mode
 public Translation provide(Locale locale) {
     return this.translation;
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2526f4 and c3b802e.

📒 Files selected for processing (30)
  • eternalcore-api/src/main/java/com/eternalcode/core/EternalCoreApi.java (0 hunks)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/language/LanguageService.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/EternalCoreApiImpl.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/AbstractViewerArgument.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/contextual/PlayerContextual.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/contextual/UserContextual.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/implementation/PluginConfiguration.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/afk/AfkKickController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/afk/AfkPlaceholderSetup.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/container/DisposalCommand.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/fullserverbypass/FullServerBypassController.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/home/HomePlaceholderSetup.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/BukkitLanguageProvider.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageCommand.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageInventory.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageLoadController.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepository.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepositoryImpl.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageServiceImpl.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/config/LanguageConfigItem.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/config/LanguageConfiguration.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpInventory.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/notice/NoticeService.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/AbstractTranslation.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManager.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (3 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/TranslationFactory.java (1 hunks)
💤 Files with no reviewable changes (12)
  • eternalcore-core/src/main/java/com/eternalcode/core/EternalCoreApiImpl.java
  • eternalcore-api/src/main/java/com/eternalcode/core/EternalCoreApi.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageCommand.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/config/LanguageConfigItem.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/BukkitLanguageProvider.java
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/language/LanguageService.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepository.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageServiceImpl.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageRepositoryImpl.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageInventory.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/config/LanguageConfiguration.java
  • eternalcore-core/src/main/java/com/eternalcode/core/feature/language/LanguageLoadController.java
🧰 Additional context used
🧠 Learnings (3)
eternalcore-core/src/main/java/com/eternalcode/core/translation/AbstractTranslation.java (1)
Learnt from: vLuckyyy
PR: EternalCodeTeam/EternalCore#865
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/essentials/item/give/GiveService.java:0-0
Timestamp: 2024-10-14T20:11:13.610Z
Learning: In the 'EternalCore' project, avoid using null in method signatures in Java code.
eternalcore-core/src/main/java/com/eternalcode/core/notice/NoticeService.java (1)
Learnt from: vLuckyyy
PR: EternalCodeTeam/EternalCore#865
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/essentials/item/give/GiveService.java:0-0
Timestamp: 2024-10-14T20:11:13.610Z
Learning: In the 'EternalCore' project, avoid using null in method signatures in Java code.
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (1)
Learnt from: CitralFlo
PR: EternalCodeTeam/EternalCore#896
File: eternalcore-api/src/main/java/com/eternalcode/core/feature/msgtoggle/MsgToggle.java:7-8
Timestamp: 2025-01-22T22:25:29.027Z
Learning: In the EternalCore project, when a class has a default no-args constructor, avoid making fields final as they need to support initialization through both the default and parameterized constructors.
🧬 Code Graph Analysis (1)
eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java (1)
eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/TranslationFactory.java (1)
  • TranslationFactory (5-18)
🔇 Additional comments (18)
eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/contextual/UserContextual.java (1)

35-35: Translation method call updated correctly.

The change from getDefaultMessages() to getMessages() aligns with the simplified translation system.

eternalcore-core/src/main/java/com/eternalcode/core/feature/afk/AfkKickController.java (1)

63-63: Per-user language selection removed correctly.

The change from getMessages(user.getUniqueId()) to getMessages() successfully removes player-specific language handling as intended.

eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/contextual/PlayerContextual.java (1)

30-30: Translation method call updated correctly.

The change from getDefaultMessages() to getMessages() aligns with the simplified translation system.

eternalcore-core/src/main/java/com/eternalcode/core/feature/home/HomePlaceholderSetup.java (1)

57-57: Per-player language selection removed correctly.

The change from getMessages(targetPlayer.getUniqueId()) to getMessages() successfully removes player-specific language handling for home placeholders.

eternalcore-core/src/main/java/com/eternalcode/core/feature/container/DisposalCommand.java (1)

38-38: Per-player language selection removed correctly.

The change from getMessages(player.getUniqueId()) to getMessages() successfully removes player-specific language handling for the disposal command.

eternalcore-core/src/main/java/com/eternalcode/core/feature/afk/AfkPlaceholderSetup.java (1)

34-34: Good refactoring to single global translation.

The change from player-specific to global translation retrieval is correct and aligns with the simplified language system.

eternalcore-core/src/main/java/com/eternalcode/core/configuration/implementation/PluginConfiguration.java (1)

50-51: Let’s list all translation files and pull out their language codes:

#!/bin/bash
find . -type f \( -iname "*.properties" -o -iname "*.yml" -o -iname "*.yaml" -o -iname "*.json" \) \
  | sed -n 's/.*[_\/]\([[:alpha:]]\{2\}\)\.\(properties\|yml\|yaml\|json\)/\1/p' \
  | sort -u
eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (1)

186-186: Good simplification of language handling.

Changing from Language enum to String makes the interface more flexible and aligns with the simplified language system.

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (2)

41-43: Good simplification of the constructor.

The change from Language enum to String languageCode aligns well with the overall refactor goals.


125-128: LGTM on the new getLanguage() method.

The implementation correctly returns the language code string as expected by the new interface.

eternalcore-core/src/main/java/com/eternalcode/core/notice/NoticeService.java (2)

43-51: Good removal of LanguageService dependency.

The constructor simplification correctly removes the unused language service parameter.


85-87: LGTM on the simplified locale provider.

Returning Locale.ROOT is appropriate for the new single-language system.

eternalcore-core/src/main/java/com/eternalcode/core/translation/AbstractTranslation.java (2)

10-18: Excellent refactor of the language handling.

The change from Language enum to String languageCode is clean, and the new method name getLanguageCode() is more descriptive.


20-23: Good update to resource path construction.

Using the language code directly in the file path is simpler and more straightforward.

eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java (1)

13-18: Perfect simplification of translation management.

The new single-language approach is much cleaner. Getting the language from plugin configuration and creating one translation instance is exactly what this refactor aimed for.

eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2)

41-43: Constructor change looks good!

The new public constructor properly accepts and passes the language code to the superclass, aligning with the single-language refactoring.


571-574: Clean implementation of getLanguage method.

The method correctly returns the language code from the superclass, maintaining consistency with the new design.

eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/WarpInventory.java (1)

74-76: Good simplification of inventory opening.

Removing the async language fetching makes the code simpler and more direct, which aligns well with the single-language approach.

Copy link
Member

@P1otrulla P1otrulla left a comment

Choose a reason for hiding this comment

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

In my opinion this is a very good change, our language system was a bit overengineered and as you described there are special plugins for this. I looked through the code and nothing caught my eye, but I need to be corrected because I haven't done anything for a long time

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java (2)

28-42: Consider making the language list more flexible.

The method works well but hardcodes the language list to List.of(PL, EN). This limits adding new languages without code changes.

Consider storing predefined languages in a static collection or making this more configurable.

+    private static final List<Language> PREDEFINED_LANGUAGES = List.of(PL, EN);
+
     public static Language fromString(String lang) {
         if (lang == null || lang.isBlank()) {
             return DEFAULT;
         }

         String lower = lang.toLowerCase();

-        for (Language language : List.of(PL, EN)) {
+        for (Language language : PREDEFINED_LANGUAGES) {
             if (language.lang.equalsIgnoreCase(lower) || language.aliases.contains(lower)) {
                 return language;
             }
         }

         return new Language(lower, List.of());
     }

14-14: Note: DEFAULT language has empty string as language code.

Using Locale.ROOT creates a Language with an empty string as the language code. This might be intentional, but worth documenting if this behavior is expected.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3b802e and 9bd6bce.

📒 Files selected for processing (13)
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/language/LanguageProvider.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/AbstractViewerArgument.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/ConfigurationManager.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/composer/LanguageComposer.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/AbstractTranslation.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java (0 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java (1 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java (2 hunks)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/TranslationFactory.java (1 hunks)
  • eternalcore-core/src/test/java/com/eternalcode/core/configuration/language/LanguageComposerTest.java (1 hunks)
  • eternalcore-core/src/test/java/com/eternalcode/core/test/MockViewer.java (0 hunks)
💤 Files with no reviewable changes (4)
  • eternalcore-core/src/test/java/com/eternalcode/core/test/MockViewer.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/AbstractTranslation.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/Translation.java
  • eternalcore-api/src/main/java/com/eternalcode/core/feature/language/LanguageProvider.java
✅ Files skipped from review due to trivial changes (3)
  • eternalcore-core/src/test/java/com/eternalcode/core/configuration/language/LanguageComposerTest.java
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/composer/LanguageComposer.java
  • eternalcore-core/src/main/java/com/eternalcode/core/configuration/ConfigurationManager.java
🚧 Files skipped from review as they are similar to previous changes (5)
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/TranslationFactory.java
  • eternalcore-core/src/main/java/com/eternalcode/core/bridge/litecommand/argument/AbstractViewerArgument.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/TranslationManagerSetup.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/ENTranslation.java
  • eternalcore-core/src/main/java/com/eternalcode/core/translation/implementation/PLTranslation.java
🧰 Additional context used
🧠 Learnings (1)
eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java (1)
Learnt from: vLuckyyy
PR: EternalCodeTeam/EternalCore#856
File: eternalcore-core/src/main/java/com/eternalcode/core/feature/warp/data/WarpDataConfig.java:19-20
Timestamp: 2025-01-12T13:03:07.239Z
Learning: Configuration classes in EternalCore (those implementing ReloadableConfig and annotated with @ConfigurationFile) don't need thread-safe collections as they are managed by the configuration system which handles synchronization.
🔇 Additional comments (2)
eternalcore-core/src/main/java/com/eternalcode/core/translation/Language.java (2)

1-1: Package relocation looks good.

Moving from the feature package to translation package makes sense for this refactoring.


24-26: Simple and clean factory method.

The fromLocale method correctly extracts the language code and creates a Language instance with no aliases.

Copy link
Member

@Jakubk15 Jakubk15 left a comment

Choose a reason for hiding this comment

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

Great approach to simplifying EternalCore!

Copy link
Member

@CitralFlo CitralFlo left a comment

Choose a reason for hiding this comment

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

ok.

@@ -47,6 +48,12 @@ public class PluginConfiguration implements ReloadableConfig {
@Description("# Whether the player should receive information about new plugin updates upon joining the server")
public boolean shouldReceivePluginUpdates = true;

@Description({
"# Language, currently supported languages: en, pl",
"# You need restart server after change."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"# You need restart server after change."
"# You need to restart the server after changes."


this.configurationManager.save(translation);
}
AbstractTranslation translation = (AbstractTranslation) this.translationManager.getMessages();
Copy link
Member

Choose a reason for hiding this comment

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

Just to be noted:
After changing the language warp GUI is empty because warps are now saved only in 1 config file. I know we are looking forward to improving warp.yml!!!!

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.

7 participants