Skip to content

Localization setup#43

Open
MLD-Rennes wants to merge 7 commits intoSHiLLySiT:developfrom
MLD-Rennes:develop-translation
Open

Localization setup#43
MLD-Rennes wants to merge 7 commits intoSHiLLySiT:developfrom
MLD-Rennes:develop-translation

Conversation

@MLD-Rennes
Copy link
Copy Markdown

To implement localization support within the tool, it is suggested to incorporate a dedicated setup procedure primarily leveraging multiple functions invoked within the handle_init routine. These functions facilitate the translation of the user interface elements. A mapping object is employed to associate keywords from the index configuration file with their corresponding translated strings. This object can be extended to support additional languages as needed. If a target language is not specified, the translation functions (translate_) default to returning the original string or perform no operation.

Tag translation involves converting user-inputted keywords, provided in lowercase, to their corresponding English camelCase identifiers used for tag analysis (edge, asset, removeAsset, etc.). This approach resolves discrepancies such as those observed with spentExperience, without altering the established variable naming conventions and with minimal effort.

Oracle definitions are maintained in a separate JavaScript file, which is dynamically loaded as a script element into the main index file upon initialization via the loadOracles() function, ensuring modularity and separation of concerns.

The momentumReset parameter is validated to ensure its value resides within the inclusive range of 0 to 2.

Mako88 and others added 7 commits April 25, 2025 10:31
commit 33cfd50
Author: MLD-Rennes <[email protected]>
Date:   Thu Apr 24 21:56:04 2025 +0200

    translate Roll section

    Tranlate the Roll section and the Roll event in the history.

commit 92da153
Author: MLD-Rennes <[email protected]>
Date:   Thu Apr 24 21:02:04 2025 +0200

    translate Oracle (end)

    Finish the translation of the oracles.

commit a9ff6dc
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 20:33:25 2025 +0200

    translate Oracle (beginning)

    The oracle file is duplicated for each language. The script is loaded dynamically in the ironwriter.js file.

commit 96c7651
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 16:44:49 2025 +0200

    Translate header

    Translate the header and the related dialogs.

commit ff8267e
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 16:01:11 2025 +0200

    Can choose the language.

    Add a variable to choose the language in the js file.

commit b31b2e3
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 15:52:31 2025 +0200

    Translate Inventory Menu

    Translate name of the inventory menu and name of the Quantity property.

commit 1ca5027
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 15:29:18 2025 +0200

    Translate Assets Menu

    Translate the name of the assets menu.

commit ca9a3e7
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 15:24:22 2025 +0200

    Translate bonds menu

    Translate the name of the bonds menu.

commit 55155d1
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 14:07:02 2025 +0200

    Translate progress

    Translation of progress options and progress menu on the page.

commit 9ac89e4
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 13:45:06 2025 +0200

    Translate character menu

    Translate the character menu and the default name character for a new session.

commit 9a12117
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 13:26:55 2025 +0200

    Translate debilities

    Translate the debility name tags and the debility name shown on the page.

commit cc8551c
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 13:05:26 2025 +0200

    Correct Momentum Reset

    The momentum reset value is between 0 and 2.

commit 9f5dcf6
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 13:00:59 2025 +0200

    Translate Every Tags

    Translation of every tags in french.

commit 83cbb73
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 12:52:06 2025 +0200

    Correction of the spent experience

    The experience spent was not visible because the variable used capitalized word but the tag is in lower case.

commit 4fb4073
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 12:49:17 2025 +0200

    Translate tag

    Translation of tag in french. The tag is given in french and converted in english to be processed.

commit d867aa7
Author: MLD-Rennes <[email protected]>
Date:   Mon Apr 21 12:34:05 2025 +0200

    Translate Stat Menu

    Translation of the stat menu on the index page.
Undo correction that is invalid.
Fixed the change of momentum stats for any string used as debility
Added a property to select language in each translations objets to simplify the translation of a word.

Added a translation for EN from a lowercase keyword to a camelCase name.
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.

3 participants