Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trudvang Chronicles] add missing data-i18n tags to the sheet #5637

Closed
dyvim opened this issue Oct 30, 2019 · 8 comments
Closed

[Trudvang Chronicles] add missing data-i18n tags to the sheet #5637

dyvim opened this issue Oct 30, 2019 · 8 comments
Labels
request A feature request

Comments

@dyvim
Copy link
Contributor

dyvim commented Oct 30, 2019

2 weeks ago a lot of data-i18n tags have been added to this sheet but there is a part of the sheet that still can't be translated : the part of the skills.
data-i18n tags have not been added because the text to translate is in the property "value" or "placeholder" of the "div" tags.

The problem cencerns the lines between line 291 and line 1022

for example you have this code
<div class="sheet-row"><input type="text" name="attr_agilityname1" class="sheet-main-skill" value="Agility" readonly></div>
it should become
<div class="sheet-row"><input type="text" name="attr_agilityname1" class="sheet-main-skill" readonly data-i18n="Agility">Agility</div>

if someone, perhaps @TheAziraphale or @Anduh, can do something...

@TheAziraphale
Copy link
Contributor

I currently have no time to fix this due to being swamped by work from my two employments I have at the moment. I can probably not take a look at this until after new year (or if I get a random weekend over). Basically the structure of the skills I implemented didn't consider the data-i18n tags system and all of the code should be overhauled and reworked. Unfortunately doing that will also need a new bug-testing round to ensure nothing breaks. This is why I feel I don't have time currently.

@Anduh
Copy link
Contributor

Anduh commented Oct 30, 2019

I might reconsider it sometime after New Year, I skipped those parts in my initial translation due to the somewhat more complex method needed for translation of values and text appearing in roll buttons.

Ars Magica 5th translations added is an example of how some, or all, of those slightly harder translations can be achieved. The same info to do this also exists on the i18n Transitional wiki page, but my work on Ars Magica would probably help alot as an actual, practical example of how those more complex methods are applied.

@dyvim
Copy link
Contributor Author

dyvim commented Oct 30, 2019

I see that you can add data-i18-placeholder and data-i18n-title tags.
Does it work for values too? data-18n-value is a valid property ?

@Anduh
Copy link
Contributor

Anduh commented Oct 30, 2019

data-i18-placeholder and data-i18n-title replacement is indeed simple as you noticed.

The agilityname1 input seems a bit pointless and could be smarter to just change into a <span> so that so that data-id18n tags could be added normally.

If you want to change values of an input, they need to be replaced by sheetworkers, the ars magica sheet shows at row 1584 & row 1768 how this is made. Considering you want to change values of existing stats/inputs, you don't create new hidden inputs as I did, just use the right names in the sheetworkers when you replace their values. i18n - roll queries explains what is happening.

For example, to change the value of <div class="sheet-row"><input type="text" name="attr_agilityname1" class="sheet-main-skill" value="Agility" readonly></div>, you would need to add this to the botton of the html:

<script type="text/worker">
on("sheet:opened", function(eventInfo){
    setAttrs({
        agilityname1:  getTranslationByKey("agility") 
    });
});
</script>

and see that there exist a corresponding row on the translation.json following the pattern it have there:
"agility": "Agilty",

When you add more, the sheetworker will start to look like:

<script type="text/worker">
on("sheet:opened", function(eventInfo){
    setAttrs({
        agilityname1:  getTranslationByKey("agility"),
        agilityname2:  getTranslationByKey("agility"),
        strengthname1:  getTranslationByKey("strength") 
    });
});
</script>

@dyvim
Copy link
Contributor Author

dyvim commented Oct 31, 2019

Thanks for all the informations. I'll try to do the dev and submit a pull request.

@clevett clevett added the request A feature request label Nov 13, 2019
@Anduh
Copy link
Contributor

Anduh commented Jan 20, 2020

@dyvim how did this turn out? I'll probably have time during Summer 2020 to help out with these translations things again.

@dyvim
Copy link
Contributor Author

dyvim commented Jan 21, 2020

@Anduh I'm still on it but I miss time...

@nmbradley
Copy link
Collaborator

This looks to me like it was resolved by #5564 but if it's still an outstanding problem, please create a new issue for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request A feature request
Projects
None yet
Development

No branches or pull requests

5 participants