SalieriC / SWIM

A collection of macros for the SWADE system on Foundry with a focus on immersion (i.e. by using sound effects)
GNU General Public License v3.0
10 stars 12 forks source link

Add support for Brazilian Portuguese Core Rules #133

Closed mclemente closed 1 year ago

mclemente commented 1 year ago

Adds the swade-core styling for worlds where the Brazilian Portuguese Core Rules are active. Adds links to the Brazilian Portuguese Core Rules.

coreRules variable became a string to distinguish between rulesets of different languages ("en" and "ptbr" on this PR).

I suggest an API function that checks and returns the actual string should be implemented to avoid code duplication and simplify handling that (on this PR, deviation.js and scale_calculator.js share some code).

As you said on Discord, there should probably be a JSON with the different links to also handle it better for more Core Rules.

SalieriC commented 1 year ago

Thank you for your work on it. At a first glance, I think that this will be a real mess if another one or two languages join in. Before that happens a proper solution like the JSON should be implemented now instead of hard coding it for now. But I'm not sure I want to do this. 🤣 I'll think about it and if I want to do this, I'll probably close this one and implement your changes manually, making adjustments along the way to support a wider range of core rules. If I decide not to do it, I'll merge and hope no one else wants their language module included. XD

Should you have a good idea or feel motivated to do this feel free to do so. Otherwise no worries. =) - Either way, your changes will be implemented in the next major release.

SalieriC commented 1 year ago

The goal of your changes should be accomplished with my recent commits. I've tried to implement them but please do check if they are working properly. I've ended up creating a file that carries all the official modules data. Some edge cases (that are not yet problematic I think) need to be resolved but it should work. I'll close this PR because I've went the extra mile making it less hard coded and more flexible, but your PR was very helpful nonetheless and your work was not in vain. But there is one thing not yet done: Localisation. This is in the pipeline but for now you'll (hopefully) see links in English, leading to the journal pages of the Brazilian Portuguese journal pages. I did not want to adopt these changes as they would become redundant later on when the functions get their localisation. I'm sorry for the inconvenience. Your help on SWIM is invaluable to me, I hope you won't hold back on PRs in the future, just because I keep closing them. As I said: Most of your changes are included. =)