Skip to content

Releases: KelvenCassamo/java-language-system

Java Language System (JLS) v1.0.3 - Enhanced Verb Translations & Modular Language File Import

23 Jan 01:59
874c39e
Compare
Choose a tag to compare

The Java Language System (JLS) v1.0.3 brings significant improvements to language handling, with key updates that make translations easier to manage and verb conjugation more flexible. This release includes the enhancement of the getWord function to support multiple verb tenses and the ability to import language files in a modular fashion, allowing for cleaner and more maintainable translation files.

What’s New in v1.0.3

  • New Feature: Modular Language File Import:

    • The ability to load translation files in a modular way.
    • Introduces the <import-language> tag, making it easier to manage large translation files by splitting them into smaller, language-specific files.
    • Example structure for modular imports:
      Example:
        <languages>
            <import-language file="en.xml" />
            <import-language file="es.xml" />
            <import-language file="fr.xml" />
       </languages>  
    

    Each modular file contains translations for a specific language. For instance:
    en.xml:

      <language value="english">
        <translated value="hello_world">
            <value>Hello, World!</value>
        </translated>
    
        <translated value="presentation">
            <value>My name is $1!</value>
        </translated>
    
        <translated value="multi_line_message">
            <value>
                Welcome to our platform!
                We are excited to have you here, $1.
                If you have any questions, feel free to reach out to our support team at $2.
                Let's make this journey a great success!
            </value>
        </translated>
    
        <translated value="read">
            <value tense="infinitive">
                Read
            </value>
            <value tense="past">
                Read
            </value>
            <value tense="participle">
                Read
            </value>
            <value tense="gerund">
                Reading
            </value>
        </translated>
    
    </language>
    

This modular structure makes it easier to maintain translations for large applications and multiple languages.

  • Enhanced Verb Translations with getWord:

    • The getWord function now supports different verb tenses, such as infinitive, past, participle, and gerund.
    • Users can now fetch the correct form of verbs in various tenses based on the context, improving flexibility and accuracy in translations.
    • Example usage:
       String readInfinitive = languageSystem.getWord("read", "infinitive"); 
       String readPast = languageSystem.getWord("read", "past");

Documentation Updates:

  • README.md file has been updated to include examples and instructions for the new modular language file import functionality and the enhanced getWord function.
  • Expanded examples for verb tense handling and practical examples for loading modular language files.
  1. Documentation Updates:
  • The README.md file has been updated to reflect the new features.
  • Examples for using the modular language file import functionality have been added Find Here.
  • Updated examples for using the getWord function with verb tenses.

What's Changed

  • Modular Import of Language Files:

    • The language import process now supports splitting large translation files into smaller, modular files for easier management.
    • PR by @KelvenCassamo.
  • getWord Enhancements:

    • The getWord method was enhanced to support verb tense handling, allowing developers to fetch verb forms like infinitive, past, participle, and gerund.
    • PR by @KelvenCassamo.

To Test

  1. Modular Imports:

    • Download version 1.0.3 or higher.
    • Use the languages.xml example to import translations from separate files. Find here.
    • Test the translation functionality to ensure translations load correctly from modular files.
  2. getWord Enhancements:

    • Test the getWord function to ensure verb translations are correctly returned for different tenses (infinitive, past, participle, and gerund). See here.
    • Verify that the verb forms are dynamically returned as expected in various translation contexts.
  3. Verify Documentation:

    • Ensure that the updated documentation correctly explains the modular import and getWord features.
    • Check if the examples in the documentation reflect the new changes.

Full Changelog:

View the full changelog

Java Language System (JLS) v1.0.1 - Stable Release

14 Jan 12:27
6b9fc07
Compare
Choose a tag to compare

The Java Language System (JLS) v1.0.1 is a stable update to the JLS library. This release builds upon the features introduced in version 1.0.0, with improvements in performance, bug fixes, enhanced compatibility, and the introduction of a powerful new utility class: XMLBuilder.

What’s New in v1.0.1

  • New Feature: XMLBuilder

  • The XMLBuilder class simplifies the creation and manipulation of XML files within Java applications.

    • Supports programmatically building XML structures.
    • Handles complex XML hierarchies with ease.
    • Includes validation and error handling to ensure well-formed XML files.
    • Ideal for generating language files dynamically or other XML-based configurations.
  • Performance Optimizations:

    • Improved the speed of language loading and dynamic switching.
    • Reduced memory usage when handling large translation files.
  • Bug Fixes:

    • Fixed an issue with dynamic placeholders not rendering correctly in certain contexts.
    • Fixed edge cases where Swing components failed to update after a language switch.
  • Improved XML Parsing:

    • Enhanced support for complex language files with nested placeholders.
    • Better error handling for malformed XML files.
  • Documentation Updates:

    • Expanded usage examples for XmlBuilder.
    • Clarified integration steps for applications without graphical interfaces.

What's Changed

  • Creating XMLBuilder: Introduced a new utility class, XMLBuilder, for building XML documents programmatically, ensuring efficient and error-free XML generation. By @KelvenCassamo in PR #2.
  • Add Documentation for XMLBuilder Class: Comprehensive documentation added for the XMLBuilder class, detailing usage, examples, and best practices. By @bivlabmz in PR #3.

Existing Features

All the core features introduced in v1.0.0 are still supported, including:

  • Language Initialization: Load languages from external XML files or embedded resources.
  • Dynamic Language Switching: Change application languages at runtime with minimal configuration.
  • Automatic Translation: Update strings and UI components dynamically, with full support for Swing. While Android widget translation support will be a priority in upcoming releases.
  • String Translation: Translate and manage text strings easily.
  • Dynamic Placeholders: Use placeholders in translations for dynamic data insertion.
  • Easy Integration: Works seamlessly with standard Java, desktop, and mobile applications.

Java Language System (JLS) v1.0.0 - First release

09 Dec 16:04
Compare
Choose a tag to compare

Java Language System (JLS) v1.0.0
First stable version of the JLS library. This version introduces key features for internationalizing Java applications, including support for dynamic language switching, automatic translation of components in Swing and Android widgets, and string translations. The library is compatible with Java applications, including those without a graphical interface.

What's included in this version:

  • Language Initialization: Loading languages from external XML files or internal project resources (e.g., mz.app.res.languages.xml).

  • Dynamic Language Switching: Allows changing languages at runtime.

  • Automatic Translation: Supports automatic translation of Swing components and Android widgets (Android functionality has not been tested in this version).

  • String Translation: Provides support for translating simple strings at runtime, making it easy to manage multi-language text in your application.

  • Support for Dynamic Placeholders: Allows the use of dynamic placeholders in translations.

  • Easy Integration: Simple integration with Java applications, including desktop, mobile, and standard Java applications without a graphical interface.

For more information, please refer to the documentation.