quick-lint-js icon indicating copy to clipboard operation
quick-lint-js copied to clipboard

9$: Localize errors on website demo

Open strager opened this issue 3 years ago • 9 comments

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.

strager avatar Sep 15 '21 08:09 strager

  • [ ] 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)

strager avatar Oct 13 '21 07:10 strager

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.

cramerRF avatar Jan 18 '22 03:01 cramerRF

When I created this task, I meant it for just the demo: https://quick-lint-js.com/demo/

strager avatar Jan 18 '22 07:01 strager

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.

strager avatar Mar 11 '22 06:03 strager

Hey there I'm looking for OS tasks to assist with. Are you still looking for help with this one?

barksanto avatar Mar 29 '22 23:03 barksanto

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.

strager avatar Mar 29 '22 23:03 strager

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: @.***>

barksanto avatar Apr 04 '22 17:04 barksanto

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:

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:

  1. A new function to set the locale
  2. 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.

strager avatar Apr 04 '22 20:04 strager

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.

strager avatar Jul 01 '22 03:07 strager

@barksanto Are you still working on this task? Do you need any help?

strager avatar Sep 25 '22 05:09 strager

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: @.***>

barksanto avatar Oct 18 '22 04:10 barksanto