extension-examples icon indicating copy to clipboard operation
extension-examples copied to clipboard

Add localization to current examples

Open thegooman opened this issue 5 years ago • 9 comments

These current examples need the ITranslator added to them

TODO:

  • [x] ~~advanced/kernel-messaging~~
  • [x] ~~advanced/kernel-output~~
  • [ ] advanced/server-extension
  • [x] ~~basics/datagrid~~
  • [x] ~~basics/hello-world~~ (nothing to translate)
  • [x] ~~basics/signals~~
  • [ ] command-palette
  • [ ] commands
  • [ ] context-menu
  • [ ] launcher
  • [ ] log-console/custom-log-console
  • [ ] log-console/log-messages
  • [ ] main-menu
  • [ ] react/react-widget
  • [ ] settings
  • [ ] state
  • [ ] widget-tracker/widgets

thegooman avatar Sep 01 '20 21:09 thegooman

Thanks for taking the lead with this work @kgoo124 !

goanpeca avatar Sep 01 '20 22:09 goanpeca

Thanks @kgoo124!

Having localization by default in the examples sounds good.

We might also want to add a little bit of narrative in one of them (maybe basics/hello-world) to introduce the concept.

jtpio avatar Sep 02 '20 06:09 jtpio

@jtpio I agree that some explanation needs to be done explaining how to implement localization.

I don't think basics/hello-world is a good place to introduce the translation because it only prints a message to the console (unless we want to translate that?). maybe a brand new example is necessary?

did you have any other thoughts about this? or any ideas as far as what would be included in the narrative?

thegooman avatar Sep 02 '20 17:09 thegooman

We might also want to add a little bit of narrative in one of them

I also agree @jtpio it is a good idea, I could help on this.

goanpeca avatar Sep 02 '20 17:09 goanpeca

I don't think basics/hello-world is a good place to introduce the translation because it only prints a message to the console (unless we want to translate that?). maybe a brand new example is necessary?

I agree a dedicated example is better for translation to avoid mixing concerns. See also https://github.com/jupyterlab/extension-examples/issues/114 where I propose to flatten the example structure.

echarles avatar Sep 03 '20 05:09 echarles

Nice :+1:

Then we can indeed leave basics/hello-world out and have a dedicated example focused on the localization.

did you have any other thoughts about this? or any ideas as far as what would be included in the narrative?

The new example would most likely introduce the concept of translating JupyterLab with a small note on why it's important. And show how to consume and use ITranslator. So in the end it can be relatively short.

jtpio avatar Sep 03 '20 06:09 jtpio

These current examples need the ITranslator added to them

To keep each extension simple, I would rather see only that dedicated translation example having the ITranslator. So adding ITranslator to each of the examples is not my preferred option. Less work for us, less confusing for the reader.

echarles avatar Sep 03 '20 07:09 echarles

I have mixed feeling since translation is a transversal so having all examples use it, may be more work but will encourage making code translation friendly. The less work for us seems like a very small gain vs. reinforcing a transversal concept seems small

goanpeca avatar Sep 03 '20 12:09 goanpeca

I have mixed feeling since translation is a transversal so having all examples use it, may be more work but will encourage making code translation friendly. The less work for us seems like a very small gain vs. reinforcing a transversal concept seems small

No issue for me. I can see the advantage enforcing good habits in all the examples.

echarles avatar Sep 03 '20 12:09 echarles