Skip to content

Add LanguageSwitch system object for real-time i18n refresh of all SQLText nodes - #198

Draft
clauspruefer with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-language-switch-system
Draft

Add LanguageSwitch system object for real-time i18n refresh of all SQLText nodes#198
clauspruefer with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-language-switch-system

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This change implements a runtime language switch control (pulldown + apply button) and wires it to refresh all sysObjSQLText instances immediately. Selecting a language and applying it now updates on-screen multilingual text without reload.

  • New runtime object: LanguageSwitch

    • Added sysObjLanguageSwitch (www/sysObjLanguageSwitch.js).
    • Renders a FormfieldPulldown for language selection and a callback button to apply.
    • Supports default options from sysFactory.ObjText.Languages and optional config overrides for pulldown/button attributes.
  • Global SQLText refresh path

    • Extended sysFactory with:
      • SQLTextObjects registry
      • registerSQLTextObject(SQLTextObject)
      • updateAllSQLTextObjects()
    • updateAllSQLTextObjects() calls update() + setDOMElementValue() on every registered SQLText object.
  • SQLText auto-registration

    • Updated sysObjSQLText.init() to register each instance with the factory registry so global refresh reaches all instances, including nested/runtime-created ones.
  • Object wiring / bootstrap

    • Registered "LanguageSwitch": sysObjLanguageSwitch in sysFactory.SetupClasses.
    • Added /sysObjLanguageSwitch.js script include in python/Index.py.
  • Documentation

    • Added sysObjLanguageSwitch class entry to doc/dev-oop-classes.rst.
// core refresh flow introduced by this PR
sysObjLanguageSwitch.prototype.updateLanguage = function()
{
    const PulldownObj = this.getObjectByID(this.PulldownObjectID);
    sysFactory.EnvUserLanguage = PulldownObj.getValue();
    sysFactory.updateAllSQLTextObjects();
}

@clauspruefer clauspruefer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot sysFactory.js does not need the this.SQLTextObjects Array. All SQLTextObjects can be retrieved by sysBaseObject.getObjectsByType(ObjectType);

Copilot AI commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@copilot sysFactory.js does not need the this.SQLTextObjects Array. All SQLTextObjects can be retrieved by sysBaseObject.getObjectsByType(ObjectType);

Done in 3200eae. I removed the SQLTextObjects array and registerSQLTextObject() from sysFactory, removed SQLText self-registration in sysObjSQLText.init(), and updated updateAllSQLTextObjects() to collect SQLText instances via HierarchyRootObject.getObjectsByType('SQLText') for each screen.

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.

2 participants