Change elements(text) in hugo.toml and frontmatter with javascript

Hello again.
I am using the Lightbi Theme and would like to change text on the site, depending on the theme (dark or light) using javascript, similar to this example: How To Toggle Text
However, the texts in question are the tabs in the header and the headlines in the respective sites, such as “Collections” and “Notes”. Their values are located in the themes hugo.toml at around line 100, as well as the _index.md files in the content folder.
How does hugo handle these elements, and how can you access them with javascript?
Thank you in advance

Accessing HTML elements with JavaScript has nothing to do with Hugo. Take a look at your HTML document in your browser’s development tool. Locate the elements you want to modify, write your JS code to do it and add it too your site’s JavaScript.

Where the strings are located in your source is irrelevant if you want to change them at runtime, ie with JavaScript.