Meteox / roll20-character-sheets

Character sheet templates created by the community for use in Roll20.
MIT License
4 stars 1 forks source link

problem in the generation of the translation file #16

Open dyvim opened 6 years ago

dyvim commented 6 years ago

In the lines 4847, 4386, 3838, 3476, 5753 and 5245 you have a block like below : data-i18n="Info">Info<span data-i18n="

This block should generate 2 data-i18n tags in the translation.json file but it generates only one.

I suggest that you should put a space after the second Info and before the <span

BRgds

dyvim commented 5 years ago

well in fact the problem was not a space but a missing end of span tag

dyvim commented 5 years ago

@Meteox are you still here and can you correct this bug?

mckee14 commented 4 years ago

If this bug is still there, let me know, I can check and correct it if needed.

dyvim commented 4 years ago

wow cool. I will check that ASAP

dyvim commented 4 years ago

@mckee14 in fact the bug is still present

mckee14 commented 4 years ago

OK, thanks for the feedback. I am working on another fix, when I'm done with that, I will check the translation problems.

EDIT: I found the Problem. There are nested span tags, so one data-i18n tag is seen inside another one. As far as I understand, each individual key is only translated once and this same line is in the HTML file several times.

You can find the entry for the nested tag in line 677 in the translation.json and the corresponding entry for english in the line 678 in en.json.

So it's not really an error but it's not translated yet. I don't know if I can just translate something within en.json and load it up, or if this has to be done via the Crowdin site?

EDIT2: I contacted Roll20 team to check if I can edit the file directly or if I need the Crowdin Service. What language do you need? And can you provide a translation for me in the language you need?

dyvim commented 4 years ago

I have an access to Crowdin if needed In fact I have detected 3 nested tags in the translation .json (using crowdin) and it is why I have opened this issue. It is perhaps better to separate the tags so that they aren't nested anymore ? Just because the translation.json generatir doesn't manage correctly nested tags. Or you'll need to add the nested data-i18n entries manually in all the .json files. (I can do that if needed) Crowdin does not allow to add entries to the .json translation files. BRgds

mckee14 commented 4 years ago

Problem is, the nesting can't be avoided - it's done by design for a popup info when you mouseover. Even worse, inside the nested tag, you would need more nested tags, because there are abbreviations used inside the popup which are already in the translation.json file - see screenshot, eg: QS, AG, ...

the whole HTML file is quite a mess and i can't re-design it from ground up.

I'm completely new to this i18n translation stuff - would it be sufficient to change the value directly in the translation.json file, so it propagates that into the en.json etc. files? The sheet is not much used anymore, and that way we could correct it for as long as no one re-generates the languages.json file from scratch?

EDIT: the translation doesn't use the entry for the popup at all, it finds the translation for the outer tag, which includes the html part for the popup. total mess. not sure how this could be fixed without changing the whole structure. same problem with MANY other entries: inside of span tags for popups is text with words which are untagged but keyed. done right, you translate them once and they are replaced. as it is, you have to translate the same word hundreds of times manually, for each spell etc.

screenshot

dyvim commented 4 years ago

well in fact i've had to do that : translate hundred times the same words (for spells for example or skills)

I think that for this pop up that has nested data-i18n tags inside other data-i18n tags, you have to make only one tag, even if it's more text to translate.

i'm not completely sure that adding entries to the translation.json file will automaticaly add the same entries to all the translation files. it is probably better to ask that to roll20 officials or on the forum.

Meteox commented 4 years ago

Hey there, just noticed the discussion here and looked into it.

Would the following format fix the problem?

image

Edit: I personally stopped working on this project as I dont play the system anymore. If I can help in anyway it would be best to contact me over discord @ PraiseTheToaster#1976

mckee14 commented 4 years ago

Thanks for your feedback! I am very bad at CSS and new to the translation thing, so help is much appreciated. I will try this and get back to you if I need more information.

dyvim commented 4 years ago

I don't think that this will solve the problem as the span with the data-i18n tag "Info" still include all the other spans with data-i18n tags. They should be separated.

We need something like that <span class="sheet-tooltip-ef"> <span data-i18n="Info">Info</span> <span data-i18n="Talent-Erklärung">Weitere Mod. &amp; Regeln<br>+: Erleichterung<br>-: Erschwernis<br>AG: Neues Anwendungsgebiet<br>EM: Neue Einsatzmöglichkeit<br>QS: Erhöhung der QS<br>BG: Berufsgeheimnis</span> </span>

mckee14 commented 4 years ago

To clean it up a little, i removed the i18n tag from the nested span tag, so you have the whole wall of text only once to translate. the nested text never got shown anyway, as it took the whole html block from the outer span tag key to render the popup.

if we can find a way to have the lines inside the popup - even better.