Skip to content

milkdrinkers/WordWeaver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

74 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

WordWeaver

GitHub License Maven Central Version GitHub Actions Workflow Status GitHub Issues GitHub last commit

Documentation Javadoc Discord Server

A modern Java translation library designed for effortless localization management in Java applications.


code image

🌟 Features

  • Easy Integration - Simple API with minimal setup
  • Highly Configurable - Customize every aspect of the library
  • Thread-Safe - Designed for concurrent environments
  • Optimized - Resource efficient with a small memory footprint while providing excellent speed
  • Adventure 4+ Support - Native integration for modern text components
  • Java 8+ Compatibility - Supports legacy and modern java versions
  • Tested - Comprehensive unit test coverage
  • JSON - Easy to edit language files using Json with comments
  • Advanced Features - Comes with optional advanced features like language file extractor and updater

πŸ“¦ Installation

Add WordWeaver to your project with Maven or Gradle.

Gradle Kotlin DSL
repositories {
    mavenCentral()
}

dependencies {
    implementation("io.github.milkdrinkers:wordweaver:VERSION")
}
Maven
<project>
    <dependencies>
        <dependency>
            <groupId>io.github.milkdrinkers</groupId>
            <artifactId>wordweaver</artifactId>
            <version>VERSION</version>
        </dependency>
    </dependencies>
</project>

Simple Usage Example πŸš€

import io.github.milkdrinkers.wordweaver.Translation;
import io.github.milkdrinkers.wordweaver.config.TranslationConfig;

// Create configuration
TranslationConfig config = TranslationConfig.builder()
    .translationDirectory(Paths.of("lang")) // The directory lang files will be stored in
    .language("fr_FR") // The primary language used
    .defaultLanguage("en_US") // The fallback language
    .build();
    
// Initialize WordWeaver
Translation.initialize(config);

// Now you can use translations
String message = Translation.of("messages.welcome");
Component welcomeMessage = Translation.as("messages.welcome");
List<String> rules = Translation.ofList("server.rules");
List<Component> helpMessages = Translation.asList("help.commands");

Example en_US.json:

{
  "messages": {
    "welcome": "Welcome to our server!",
    "goodbye": "Goodbye, see you soon!",
    "error": "An error occurred: {0}"
  },
  "server": {
    "rules": [
      "Be respectful to other players",
      "No griefing or stealing",
      "Have fun!"
    ]
  }
}

πŸ“š Documentation


πŸ”¨ Building from Source

git clone https://github.com/milkdrinkers/WordWeaver.git
cd wordweaver
./gradlew publishToMavenLocal

πŸ”§ Contributing

Contributions are always welcome! Please make sure to read our Contributor's Guide for standards and our Contributor License Agreement (CLA) before submitting any pull requests.

We also ask that you adhere to our Contributor Code of Conduct to ensure this community remains a place where all feel welcome to participate.


πŸ“ Licensing

You can find the license the source code and all assets are under here. Additionally, contributors agree to the Contributor License Agreement (CLA) found here.


πŸ”₯ Consuming Projects

Here is a list of known projects using WordWeaver:

  • Minecraft-Plugin-Template - Provided by default in a Minecraft Plugin Template.
  • Maquillage - Maquillage a Minecraft cosmetics plugin.
  • CharacterCards - CharacterCards is a Minecraft plugin allowing players to create cards describing their character.
  • (Add your project here!)