From fattalion to ~metalune/simplytranslate-devel
Thanks for your swift reply. > I sent the patch from mailspring (after enabling plain text email, https://useplaintext.email/#mailspring) Did you try `git send-email`? https://git-send-email.io/ > No I think it do not need to be as each script doing something else, If it's up to me I would create main.js file to keep everything in it's place but I just followed your style I don't think that's really that important in a piece of JS as small as ours. As for why we don't have a separate JS file, it would incur an extra HTTP request, and for JS code this short the overhead of the request is too large. > No, 'var' is bad you have const or let. For me I see const fit as we will not need to change contents of that variable later
From fattalion to ~metalune/simplytranslate-devel
--- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index e1f6272..a66f4f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ requests==2.26.0 lxml==4.7.1 translatepy==2.2 requests==2.27.1 lxml==4.8.0[message trimmed]
From fattalion to ~metalune/simplytranslate-devel
--- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8def0af..a316880 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,7 @@ setup( packages = ["simplytranslate_engines"], install_requires = [ "lxml", "requests" "requests",[message trimmed]
From fattalion to ~metalune/simplytranslate-devel
Thanks for the patch! There seems to be something wrong with it, but I'm not sure what exactly (applying the patch fails, and Sourcehut isn't detecting that it's a patch). How did you send this? That aside, I have some comments on the patch itself: - This script element should be joined with the previous one. - Use `var` instead of `const`. - Instead of getting all the text areas in the file, getting the two we want explicitly by `document.getElementById` sounds better to me. Something like: ``` var inputTextArea = document.getElementById("input"); ```
From fattalion to ~metalune/simplytranslate-devel
Ignore this patch; the fact that the API now returns JSON is actually intentional, to give access to all the extra information in the dictionary.
From fattalion to ~metalune/simplytranslate-devel
The code using Google Translate's `batchexecute` API endpoint seem to be giving us pretty poor (sometimes half-untranslated!) translations. We revert to the old method for now. While this means we need two requests, the APIs don't appear to be rate-limited, and it's better than the current situation at least. I also removed the commented-out `translate` method, because we can always get it back through Git history, and it somewhat clutters up the code. --- simplytranslate_engines/googletranslate.py | 65 +++------------------- 1 file changed, 7 insertions(+), 58 deletions(-) diff --git a/simplytranslate_engines/googletranslate.py b/simplytranslate_engines/googletranslate.py [message trimmed]
From fattalion to ~metalune/simplytranslate-devel
We forgot to update it to account for the changes in simplytranslate_engines. Also formatted the file with Black and removed outdated commented-out code. --- main.py | 48 +++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/main.py b/main.py index 4787a70..b524919 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,7 @@ from simplytranslate_engines.utils import * [message trimmed]
From fattalion to ~metalune/simplytranslate-devel
Things done in this commit: - fix engines being mashed together - don't include trailing space in engine link - remove outdated comment - other small refactors --- templates/index.html | 27 ++++++--------------------- templates/prefs.html | 4 ++-- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/templates/index.html b/templates/index.html index 5b71740..1bc041b 100644 --- a/templates/index.html +++ b/templates/index.html [message trimmed]
From fattalion to ~metalune/simplytranslate-devel
I remember the W3C validator warning me (erroring?) about this when I passed it SimplyTranslate's HTML. --- templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index ecd836c..03a3a39 100644 --- a/templates/index.html +++ b/templates/index.html @@ -177,7 +177,7 @@ </div> <div class="switch_languages"> [message trimmed]