Uh oh!
There was an error while loading. Please reload this page.
feature: Added support for opting out endpoint translation - #56
Conversation
yihong0618
commented
Mar 29, 2021
I changed to branch develop. |
Thank you for your comment! The idea of -T is to provide vscode-leetcode the ability to let user choose whether or not they would like to see untranslated questions. This will allow users to see english version of the questions even though they are on the leetcode-cn endpoint. Because of the existence of caching mechanism, switching between -T and no -T require doing a ./leetcode cache -d. An example would be: |
Can we clean the cache or only the maybe add a flag |
dzz007
commented
Mar 29, 2021
That may not be a good idea, usually a user might want to stick to a setting for a fairly long period of time. That means if one wants to use -T, he/she may stick with -T for quite a while, so clearing the cache internally would render the cache obsolete. |
That's why I think we can add one flag or something else to solve it. |
dzz007
commented
Mar 29, 2021
Ohh sorry I missed that line. It's a good idea, we can probably make it so that if the cache sees the translation mode has changed it will automatically invalidate it. But adding this flag might cause some compatibility issues, I will take a closer look tomorrow. |
dzz007
commented
Mar 30, 2021
@yihong0618 I just made a new commit which made some modification to the cache module. Now it will invalidate all caches automatically if the the old cache's -T config is different than requested. Also can you please take a look again at #55 , I fixed the const problem as well. |
yihong0618
commented
Mar 31, 2021
Will take a look and test later today. |
Fixed some translation issue Continue to fix some translation problem fix: fixed test cases Fixed all test cases relating to getProblem(s) to adapt new parameter fix: fixed test_leetcode testcase
dzz007
commented
Mar 31, 2021
Thanks, I just rebased this branch onto the latest master, to make merge easier. |
LGTM for now. But one question: |
dzz007
commented
Mar 31, 2021
Thank you for the review! It's implemented already, I added a new checkable option in the setting page. Once this repo is upgraded in npm, I can open that PR. |
yihong0618
commented
Mar 31, 2021
Got it. Thanks. |
dzz007
commented
Apr 6, 2021
@jdneo Hi, can you help me and take a look at this PR please? It provides a new option in the cli tool which later frontend can rely on to give users the ability to skip end point translations. |
jdneo
commented
Apr 7, 2021
@dzz007 Is this used to specify the language of leetcode-cn (Chinese -> English), how about leetcode US? |
dzz007
commented
Apr 7, 2021
@jdneo Thanks for replying, yes, for the leetcode US it won't have any impact at all. I tested it and it works fine for US endpoint. |
jdneo
commented
Apr 8, 2021
Ok, we should always be careful when adding new argument (for future compatibility and extensibility) Currently, -T will translate Chinese to English for LeetCode CN, what if in the future a new language appear? (though I'm not sure whether LeetCode will plan to do it or not). Do we need to follow with the target language as a argument? |
dzz007
commented
Apr 8, 2021
Umm, I don't think it need an argument, currently the way this -T works is that:
|
jdneo
commented
Apr 8, 2021
Ok makes sense. I'll take a look later today. |
jdneo
commented
Apr 8, 2021
Thanks @dzz007! |
dzz007
commented
Apr 8, 2021
Thanks! @jdneo |
Added a new parameter '-T' which when specified in 'show', 'list', or 'submission', will disable the end point's translation to problem materials. This can be used by vscode-leetcode to allow user to opt out from translations. I will push a separate pull request to that repo later when the version on this repo is bumped.