Skip to content

v0.1.0

Choose a tag to compare

@ChernegaSergiy ChernegaSergiy released this 04 Feb 15:43
· 5 commits to main since this release
2587dda

libLanguage v0.1.0

This release introduces a complete architectural rewrite to better support PocketMine-MP virion shading and modern development workflows. The "Global Hub" pattern has been replaced with a more robust, per-plugin isolated approach.

Key Changes

  • Architectural Rewrite: Removed LanguageHub and global singleton patterns. This ensures that when the virion is shaded into multiple plugins, each maintains its own isolated and functional translation state.
  • Refined API: The PluginTranslator is now the primary, self-contained entry point for all translation needs.
  • Improved Flexibility:
    • The LocaleResolver is now optional; if not provided, it defaults to using the player's client-side locale.
    • Removed strict locale validation to allow for custom language codes and dialects.

New Features

  • Support for Nested Keys: You can now use dot notation (e.g., commands.help.description) in your translation keys. The library will automatically flatten nested YAML/JSON structures.
  • Automatic Colorization: All translated strings are now automatically processed through TextFormat::colorize(), allowing the use of the & symbol for color codes in your language files.
  • Simplified Initialization: Introduced LanguageLoader to automate the loading of .yml and .yaml files from your plugin's directories.

Installation

Update your .poggit.yml to use the new version:

libs:
  - src: newlandpe/libLanguage/libLanguage
    version: ^0.1.0

License

This library remains licensed under the CSSM Unlimited License v2.0 (CSSM-ULv2).