Kirilllive / tuesday-js

simple web-based, free and open-source visual novel editor that can be used in a web browser. It is written in JavaScript without using any third party libraries and thus does not require additional software installation. The engine uses standard HTML document elements such as div and img. This allows the use of any media format supported by browsers including vector graphics svg, gif animations and css styles.
https://kirilllive.github.io/tuesday-js/
Apache License 2.0
513 stars 62 forks source link

Choice buttons with multiple languages don't show up #10

Closed goldenxp closed 3 years ago

goldenxp commented 3 years ago

I fixed this in my local branch but my client is using the main web build which rejected my pull request for this fix. Basically, values_button tries to get a string from an object and fails so no buttons show up.

Kirilllive commented 3 years ago

Hello! i Saw your changes, they have two problems You make changes at "runtime", but not in the main "tuesday.js" file (main file for runtime), so i can't see what was changed. You are also making overly drastic changes that could damage other users projects. I am not opposed to making changes, but delicately.

How are you trying to use localization and values_button function?

goldenxp commented 3 years ago

Basically, we have 3 languages and the choices buttons are not showing up. This blocks the client from playing the game. When debugging, I noted the matchAll function tries to run on an object of a locale string (like en:"") instead of the actual string itself. This produces an error and the buttons don't render. My fix sanitizes the language lookup as done elsewhere in the codebase. I wasn't aware of the runtime vs main runtime differences. That's a small problem to fix. I totally understand the need to protect other projects - my CSV separator change for example handles this with a new setting value (we need commas) and the default behavior preserves current functionality. Localization is crucial for this project.

Kirilllive commented 3 years ago

The problem with buttons is very simple to solve. the default 'width size' = 0 is done to make the button fit the text on it. to prevent the button from disappearing, set it to a fixed size. button

For CSV export I added settings for Separated and Delimiter csv

goldenxp commented 3 years ago

I think I figured out what the problem is. It wasn't the choice button but the global interface button - if the global interface button is purely iconic, that is it has no text, this causes button addition failure so the choice buttons do not get made.

goldenxp commented 3 years ago

Also there may be another issue related to this where additional languages are not added if the text button is purely iconic with no string. This causes localization for other languages to fail. It's easy to fix by directly editing the JSON. Thanks for your assistance earlier.

Kirilllive commented 3 years ago

unfortunately the error could not be repeated. Can you send a JSON snippet with this problem, or describe how I can replicate this problem?

goldenxp commented 3 years ago

I'll make a new issue with the repro steps.