Skip to content

Commit dc55437

Browse files
authored
Merge pull request #1191 from adyavanapalli/patch-2
Typos + readability improvements.
2 parents d066e20 + 14b1308 commit dc55437

File tree

1 file changed

+15
-15
lines changed
  • src/jupyter_contrib_nbextensions/nbextensions/nbTranslate

1 file changed

+15
-15
lines changed
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# nbTranslate -- helps translating notebooks -- provides multilanguage support
1+
# nbTranslate -- helps translate notebooks -- provides multilanguage support
22

33
This extension
44

5-
- helps converting markdown cells in a notebook from a language to another (optionally using **Google translate**),
6-
- enables to selectively display cells from a given language in a multilanguage notebook.
5+
- helps convert markdown cells in a notebook from one language to another (optionally using **Google translate**),
6+
- enables one to selectively display cells from a given language in a multilanguage notebook.
77

8-
Basically, the extension allows to copy the original cell into a new one for editing and translating. Optionally, the cell source text can be passed through `google translate` and the result inserted in the new cell. Basic markdown structures (e.g. bold, emphasis, lists) are preserved/restored after conversion, to the best extent, but this is not perfect, and usually one has to correct the text and structures afterward. Similarly, equations are extracted before conversion and restored in the result. It seems that when translating from lang1 to lang2, the best results are obtained by taking English as an intermediate language.
8+
This extension allows one to copy the original cell into a new one for editing and translating. Optionally, the cell source text can be piped through `google translate` and the result inserted into a new cell. Basic markdown structures (e.g. bold, italics, lists) are preserved/restored after conversion, though this is not perfect (usually one has to correct the text and structures afterwards). Similarly, equations are extracted before conversion and restored in the result. It seems that when translating from one language to another language, the best results are obtained by using English as an intermediate language.
99

10-
A metadata indicating the language used is added to each cell. This allows to selectively display cells for a particular language and hide the other ones. As far as they are concerned, code cells are preserved. This way, one can get a kind of multilanguage notebook. A menu is provided to select the languages to display in the notebook.
10+
Metadata indicating the language used is added to each cell. This allows one to selectively display cells for a particular language and hide the other ones. Code cells remain untouched. This way, one can get a kind of multilanguage notebook. A menu is provided to select the languages to display in the notebook.
1111

1212

1313
![](demo1.gif)
@@ -18,39 +18,39 @@ A metadata indicating the language used is added to each cell. This allows to se
1818
## Compatibility
1919

2020
The extension has been written to play nicely with
21-
- [latex_envs]: LaTeX environments are protected before conversion and restored after. For environments with a text content, e.g. theorem, remark, etc, the content is still translated. Some minor updates have been applied to `latex_envs` to ensure the best compatibilty; so update if necessary via
21+
- [latex_envs]: LaTeX environments are protected before conversion and restored after. For environments with text content, e.g. theorem, remark, etc, the content is still translated. Some minor updates have been applied to `latex_envs` to ensure the best compatibilty; update if necessary via
2222
```
2323
pip install jupyter_latex_envs --upgrade [--user|sys-prefix]
2424
jupyter nbextension install --py latex_envs --user
2525
jupyter nbextension enable latex_envs --user --py
2626
```
27-
- [toc2]: cells of non displayed languages are hidden and unrendered so that the toc corresponds only to the selected languages; The toc is automatically updated each time a language is added/removed.
27+
- [toc2]: cells of non displayed languages are hidden and not rendered so that the toc corresponds only to the selected languages. The toc is automatically updated each time a language is added or removed.
2828

2929
## Configuration
30-
- Parameters values can be changed using the `nbextensions-configurator`: it is possible to choose the initial source and target languages, to choose to use of google translate engine or not, to specify the initially displayed languages, the position of the language selection menu, and define a keyboard shortcut
31-
- A *configuration toolbar* is provided which enables to change the main options per notebook. In the configuration toolbar, one can toogle the use of the google translate engine, select the source and target languges, and finally select the language to display.
30+
- Parameter values can be changed using the `nbextensions-configurator`: it is possible to choose the initial source and target language, to choose to use the google translate engine or not, and to specify the initially displayed languages, the position of the language selection menu, and a keyboard shortcut definition.
31+
- A *configuration toolbar* is provided which allows changing the main options per notebook. One can also toggle whether to use the google translate engine, select the source and target languages, and select the language to display.
3232

3333
## Export
34-
It is possible to extract one language from the multilanguage notebook. An exporter with an entry-point `selectLanguage` is provided that `converts` the notebook into another one as follows
34+
It is possible to extract one language from the multilanguage notebook. An exporter with an entry-point `selectLanguage` is provided that converts the notebook into another one as follows:
3535
```
3636
jupyter nbconvert --to selectLanguage --NotebookLangExporter.language=lang FILE.ipynb
3737
```
38-
where lang is a valid language abbreviation, e.g. en, fr, ar, sp, ... See the full list <a href='languages.js'> here.</a>
38+
where the `lang` parameter denotes a valid language abbreviation e.g. en, fr, ar, sp. See the full list <a href='languages.js'> here.</a>
3939

4040

4141
Installation
4242
------------
4343

44-
If you use [jupyter-contrib-nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions), proceed as usual.
44+
If you use [jupyter-contrib-nbextensions](https://github.com/ipython-contrib/jupyter_contrib_nbextensions), the extension is provided within the `Nbextensions` configuration.
4545

46-
Otherwise, you can still install/try the extension from my personal repo, using
46+
Otherwise, you can still install the extension from my personal repo, using:
4747
```
4848
jupyter nbextension install https://rawgit.com/jfbercher/jupyter_nbTranslate/master/nbTranslate.zip --user
4949
jupyter nbextension enable nbTranslate/main
5050
```
51-
[Note that for now, installing from this repo does not install the python module and add the entry points for exporting as described above]
51+
_Note: Until further notice, installing from this repo does not install the python module and add the entry points for exporting as described above._
5252

53-
To remove
53+
To uninstall:
5454
```
5555
jupyter nbextension uninstall nbTranslate/main
5656
```

0 commit comments

Comments
 (0)