Add localization to current examples
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
Thanks for taking the lead with this work @kgoo124 !
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 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?
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.
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.
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.
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.
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
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.