quick-lint-js
quick-lint-js copied to clipboard
9$: Localize errors on website demo
Related: #530, #529
https://quick-lint-js.com/demo/
Errors are shown in English, but they should be translated to the user's locale if possible.
- [ ] Add a locale drop-down menu (JS)
- [ ] Detect viewer's locale automatically to pre-select the language (JS)
- [ ] Plumb locale to C/WASM API (C++, JS)
I claim this for-hire task. I expect payment after I complete this task. I will email the quick-lint-js team if I am assigned this task.
When I created this task, I meant it for just the demo: https://quick-lint-js.com/demo/
Any progress on this task? Do you need help?
I filed #664 for the documentation. I'll make this task (#433) for the web demo.
Hey there I'm looking for OS tasks to assist with. Are you still looking for help with this one?
Are you still looking for help with this one?
Yes. I think @cramerRF isn't working on this task, so you can take it on.
If you want compensation (20 USD), please see https://quick-lint-js.com/hiring/
If you don't want compensation, and just want experience, I can hold your hand through this task.
I'm really just looking for experience with this one. If you have any tips on how I can get started I would really appreciate it.
On Tue, Mar 29, 2022 at 6:39 PM strager @.***> wrote:
Assigned #433 https://github.com/quick-lint/quick-lint-js/issues/433 to @barksanto https://github.com/barksanto.
— Reply to this email directly, view it on GitHub https://github.com/quick-lint/quick-lint-js/issues/433#event-6330642835, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTXJ37LQSKG2U6EMRXJGGTVCOIBPANCNFSM5EB5YQCA . You are receiving this because you were assigned.Message ID: @.***>
If you have any tips on how I can get started I would really appreciate it.
Start by running the website on your machine. (Make sure to build quick-lint-js for WebAssembly so the web demo works.) Visit http://localhost:9001/demo/ to see the demo. Hover over the red text to see the messages which should be translated.
There are four main parts:
- JavaScript code responding to key presses
- JavaScript library setting up the WebAssembly module and providing a nicer API for to demo.mjs
- The c-api module which is directly called by the JavaScript library
- quick-lint-js' main C++ code
I think we need to ultimately call the initialize_translations_from_locale
function. We could expose this through c-api in one of two ways:
- A new function to set the locale
- A new locale parameter for the existing
qljs_web_demo_lint
function
To start, I'd add initialize_translations_from_locale("sv_SE");
at the beginning of qljs_web_demo_create_document
. This should make all quick-lint-js messages Swedish (or at least the messages we have translations for). (If not, I'm misremembering something, or your dev setup is wrong.) From there, you should figure out how to make JavaScript control the locale.
I added a qljs_web_demo_set_locale
function in the C API. This is callable from JavaScript (DocumentForWebDemo#setLocale
). I also added qljs_list_locales
which is also callable from JavaScript (Process#listLocales
).
Because all the C++/WebAssembly plumbing is done, this task should be much easier and exclusively front-end.
@barksanto Are you still working on this task? Do you need any help?
Hey Strager,
No, I'm not working on this one at the moment. Sorry I hope someone else can help take over!
Thanks
On Sun, Sep 25, 2022 at 12:47 PM strager @.***> wrote:
@barksanto https://github.com/barksanto Are you still working on this task? Do you need any help?
— Reply to this email directly, view it on GitHub https://github.com/quick-lint/quick-lint-js/issues/433#issuecomment-1257126418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTXJ3ZGTOG4EUWH3H6MISLV77RQPANCNFSM5EB5YQCA . You are receiving this because you were mentioned.Message ID: @.***>