Skip to content

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

Latest
Compare
Choose a tag to compare
@KelvenCassamo KelvenCassamo released this 23 Jan 01:59
874c39e

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