Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Italian PDF module and mapping#101

Open
bembe83 wants to merge 3 commits intoarcanistzed:mainfrom
bembe83:main
Open

Italian PDF module and mapping#101
bembe83 wants to merge 3 commits intoarcanistzed:mainfrom
bembe83:main

Conversation

@bembe83
Copy link
Copy Markdown

@bembe83 bembe83 commented Oct 7, 2023

Added the italian PDF and adjusted the mapping to match the module.
Added a translate function in the window object to be used in the mapping (as i did for tools, weapons, armor and languages strings)

Added italian PDF module by Bembe83
Add translate function into the window object to be used across the script/mapping
@arcanistzed
Copy link
Copy Markdown
Owner

arcanistzed commented Jan 5, 2025

I don't think it makes sense for this module to be adding to the window object. The translation function should be added within the scope of the module's API.

Comment thread scripts/pdfsheet.js
Comment on lines +36 to +50
window.translate = function(sourceText, sourceLang, targetLang){
$.ajaxSetup({
async: false
});
var retString = "";
if(sourceText) {
console.log(sourceText);
var url = "https://translate.googleapis.com/translate_a/single?client=gtx&sl="+ sourceLang + "&tl=" + targetLang + "&dt=t&q=" + encodeURI(sourceText);
$.getJSON(url, function(data) {
retString = data[0][0][0];
});
console.log(retString);
}
return retString;
}
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense for this module to be adding to the window object. The translation function should be added within the scope of the module's API.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants