Merge branch 'feature/documentation-needs-updated'
Browse files- CONTRIBUTING.rst +0 -128
- HISTORY.rst +0 -19
- LICENSE → docs/LICENSE +0 -0
- README.rst → docs/README.rst +30 -59
- docs/authors.rst +15 -1
- docs/conf.py +1 -1
- docs/contributing.rst +131 -1
- docs/deep_translator.rst +0 -54
- docs/history.rst +20 -1
- docs/index.rst +2 -2
- docs/installation.rst +7 -3
- {ja → docs/ja}/README.rst +0 -0
- AUTHORS.rst → docs/ja/authors.rst +8 -8
- ja/CONTRIBUTING.rst → docs/ja/contributing.rst +8 -8
- docs/ja/history.rst +20 -0
- {ja → docs/ja}/index.rst +3 -3
- {ja → docs/ja}/installation.rst +0 -0
- {ja → docs/ja}/usage.rst +0 -0
- docs/modules.rst +103 -5
- docs/other_lang.rst +1 -1
- docs/readme.rst +0 -1
- ja/history.rst +0 -2
- ja/modules.rst +0 -7
CONTRIBUTING.rst
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
.. highlight:: shell
|
2 |
-
|
3 |
-
============
|
4 |
-
Contributing
|
5 |
-
============
|
6 |
-
|
7 |
-
Contributions are welcome, and they are greatly appreciated! Every little bit
|
8 |
-
helps, and credit will always be given.
|
9 |
-
|
10 |
-
You can contribute in many ways:
|
11 |
-
|
12 |
-
Types of Contributions
|
13 |
-
----------------------
|
14 |
-
|
15 |
-
Report Bugs
|
16 |
-
~~~~~~~~~~~
|
17 |
-
|
18 |
-
Report bugs at https://github.com/nidhaloff/deep_translator/issues.
|
19 |
-
|
20 |
-
If you are reporting a bug, please include:
|
21 |
-
|
22 |
-
* Your operating system name and version.
|
23 |
-
* Any details about your local setup that might be helpful in troubleshooting.
|
24 |
-
* Detailed steps to reproduce the bug.
|
25 |
-
|
26 |
-
Fix Bugs
|
27 |
-
~~~~~~~~
|
28 |
-
|
29 |
-
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
|
30 |
-
wanted" is open to whoever wants to implement it.
|
31 |
-
|
32 |
-
Implement Features
|
33 |
-
~~~~~~~~~~~~~~~~~~
|
34 |
-
|
35 |
-
Look through the GitHub issues for features. Anything tagged with "enhancement"
|
36 |
-
and "help wanted" is open to whoever wants to implement it.
|
37 |
-
|
38 |
-
Write Documentation
|
39 |
-
~~~~~~~~~~~~~~~~~~~
|
40 |
-
|
41 |
-
deep_translator could always use more documentation, whether as part of the
|
42 |
-
official deep_translator docs, in docstrings, or even on the web in blog posts,
|
43 |
-
articles, and such.
|
44 |
-
|
45 |
-
Submit Feedback
|
46 |
-
~~~~~~~~~~~~~~~
|
47 |
-
|
48 |
-
The best way to send feedback is to file an issue at https://github.com/nidhaloff/deep_translator/issues.
|
49 |
-
|
50 |
-
If you are proposing a feature:
|
51 |
-
|
52 |
-
* Explain in detail how it would work.
|
53 |
-
* Keep the scope as narrow as possible, to make it easier to implement.
|
54 |
-
* Remember that this is a volunteer-driven project, and that contributions
|
55 |
-
are welcome :)
|
56 |
-
|
57 |
-
Get Started!
|
58 |
-
------------
|
59 |
-
|
60 |
-
Ready to contribute? Here's how to set up `deep_translator` for local development.
|
61 |
-
|
62 |
-
1. Fork the `deep_translator` repo on GitHub.
|
63 |
-
2. Clone your fork locally::
|
64 |
-
|
65 |
-
$ git clone [email protected]:your_name_here/deep_translator.git
|
66 |
-
|
67 |
-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
|
68 |
-
|
69 |
-
$ mkvirtualenv deep_translator
|
70 |
-
$ cd deep_translator/
|
71 |
-
$ python setup.py develop
|
72 |
-
|
73 |
-
4. Create a branch for local development::
|
74 |
-
|
75 |
-
$ git checkout -b name-of-your-bugfix-or-feature
|
76 |
-
|
77 |
-
Now you can make your changes locally.
|
78 |
-
|
79 |
-
5. When you're done making changes, check that your changes pass flake8 and the
|
80 |
-
tests, including testing other Python versions with tox::
|
81 |
-
|
82 |
-
$ flake8 deep_translator tests
|
83 |
-
$ python setup.py test or pytest
|
84 |
-
$ tox
|
85 |
-
|
86 |
-
To get flake8 and tox, just pip install them into your virtualenv.
|
87 |
-
|
88 |
-
6. Commit your changes and push your branch to GitHub::
|
89 |
-
|
90 |
-
$ git add .
|
91 |
-
$ git commit -m "Your detailed description of your changes."
|
92 |
-
$ git push origin name-of-your-bugfix-or-feature
|
93 |
-
|
94 |
-
7. Submit a pull request through the GitHub website.
|
95 |
-
|
96 |
-
Pull Request Guidelines
|
97 |
-
-----------------------
|
98 |
-
|
99 |
-
Before you submit a pull request, check that it meets these guidelines:
|
100 |
-
|
101 |
-
1. The pull request should include tests.
|
102 |
-
2. If the pull request adds functionality, the docs should be updated. Put
|
103 |
-
your new functionality into a function with a docstring, and add the
|
104 |
-
feature to the list in README.rst.
|
105 |
-
3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check
|
106 |
-
https://travis-ci.com/nidhaloff/deep_translator/pull_requests
|
107 |
-
and make sure that the tests pass for all supported Python versions.
|
108 |
-
|
109 |
-
Tips
|
110 |
-
----
|
111 |
-
|
112 |
-
To run a subset of tests::
|
113 |
-
|
114 |
-
$ pytest -ra
|
115 |
-
|
116 |
-
|
117 |
-
Deploying
|
118 |
-
---------
|
119 |
-
|
120 |
-
A reminder for the maintainers on how to deploy.
|
121 |
-
Make sure all your changes are committed (including an entry in HISTORY.rst).
|
122 |
-
Then run::
|
123 |
-
|
124 |
-
$ bump2version patch # possible: major / minor / patch
|
125 |
-
$ git push
|
126 |
-
$ git push --tags
|
127 |
-
|
128 |
-
Travis will then deploy to PyPI if tests pass.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HISTORY.rst
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
==================
|
2 |
-
Important History
|
3 |
-
==================
|
4 |
-
|
5 |
-
- 1.4.4 added support for papago, added opt params, fixed deepl free api
|
6 |
-
- 1.4.3 added support deepl free api
|
7 |
-
- 1.4.2 added proxy support
|
8 |
-
- 1.3.4 bug fixes for the dutch language
|
9 |
-
- 1.3.3 fixed bug in google translate
|
10 |
-
|
11 |
-
- 1.2.5: added support for the DeepL translator
|
12 |
-
- 1.2.4: added support for the QCRI translator
|
13 |
-
- 1.2.1: added support for the yandex translator
|
14 |
-
- 1.1.9: fixed bug in requests
|
15 |
-
- 1.1.5: added language detection
|
16 |
-
- 1.1.3: added support for mymemory
|
17 |
-
- 1.0.4: added support for pons
|
18 |
-
- 1.0.2: added support for linguee
|
19 |
-
- 1.0.0: added support for google translate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LICENSE → docs/LICENSE
RENAMED
File without changes
|
README.rst → docs/README.rst
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
deep-translator
|
3 |
##################
|
4 |
|
5 |
-
.. image:: assets/icon.jpg
|
6 |
:width: 100
|
7 |
:align: center
|
8 |
:alt: deep-translator-icon
|
@@ -125,7 +125,7 @@ Install the stable release:
|
|
125 |
|
126 |
.. code-block:: console
|
127 |
|
128 |
-
$ pip install -U
|
129 |
|
130 |
take a look at the docs if you want to install from source.
|
131 |
|
@@ -135,14 +135,14 @@ Quick Start
|
|
135 |
|
136 |
.. code-block:: python
|
137 |
|
138 |
-
from
|
139 |
translated = GoogleTranslator(source='auto', target='de').translate("keep it up, you are awesome") # output -> Weiter so, du bist großartig
|
140 |
|
141 |
or using proxies:
|
142 |
|
143 |
.. code-block:: python
|
144 |
|
145 |
-
from
|
146 |
|
147 |
proxies_example = {
|
148 |
"https": "34.195.196.27:8080",
|
@@ -155,7 +155,7 @@ or even directly from terminal:
|
|
155 |
|
156 |
.. code-block:: console
|
157 |
|
158 |
-
$
|
159 |
|
160 |
|
161 |
=====
|
@@ -175,7 +175,7 @@ Imports
|
|
175 |
|
176 |
.. code-block:: python
|
177 |
|
178 |
-
from
|
179 |
MicrosoftTranslator,
|
180 |
PonsTranslator,
|
181 |
LingueeTranslator,
|
@@ -536,7 +536,7 @@ can be used with all supported translators.
|
|
536 |
|
537 |
.. code-block:: python
|
538 |
|
539 |
-
from
|
540 |
|
541 |
# define your proxy configs:
|
542 |
proxies_example = {
|
@@ -551,71 +551,42 @@ can be used with all supported translators.
|
|
551 |
Usage from Terminal
|
552 |
--------------------
|
553 |
|
554 |
-
|
555 |
-
the right arguments, which are the translator you want to use, source language, target language and the text
|
556 |
-
you want to translate.
|
557 |
|
558 |
-
|
559 |
-
the other supported translators. Just read the documentation to have an overview about the supported translators in this library.
|
560 |
-
|
561 |
-
.. code-block:: console
|
562 |
|
563 |
-
|
564 |
|
565 |
-
|
566 |
|
567 |
.. code-block:: console
|
568 |
|
569 |
-
$
|
570 |
|
571 |
-
|
572 |
|
573 |
.. code-block:: console
|
574 |
|
575 |
-
$
|
576 |
|
577 |
-
|
578 |
|
579 |
.. code-block:: console
|
580 |
|
581 |
-
$
|
582 |
|
583 |
-
======
|
584 |
-
Tests
|
585 |
-
======
|
586 |
|
587 |
-
|
588 |
|
589 |
.. code-block:: console
|
590 |
|
591 |
-
$
|
592 |
-
|
593 |
-
- Or just install pytest
|
594 |
-
|
595 |
-
.. code-block:: console
|
596 |
-
|
597 |
-
$ pip install pytest
|
598 |
-
|
599 |
-
|
600 |
-
- you can run tests individually for each translator by passing the prefix **test_** followed by the translator name as an argument to pytest.
|
601 |
-
|
602 |
-
.. code-block:: console
|
603 |
-
|
604 |
-
$ pytest test_google_trans
|
605 |
-
$ pytest test_linguee
|
606 |
-
$ pytest test_mymemory
|
607 |
-
$ pytest test_pons
|
608 |
-
|
609 |
-
- Alternatively, you can run the test suite
|
610 |
-
|
611 |
-
.. code-block:: console
|
612 |
-
|
613 |
-
$ pytest -ra
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
|
|
|
|
|
|
|
618 |
|
|
|
619 |
|
620 |
========
|
621 |
Links
|
@@ -668,12 +639,12 @@ Copyright (c) 2020-present, Nidhal Baccouri
|
|
668 |
The Translator++ mobile app
|
669 |
===========================
|
670 |
|
671 |
-
.. image:: assets/app-icon.png
|
672 |
:width: 100
|
673 |
:alt: Icon of the app
|
674 |
|
675 |
|
676 |
-
After developing the
|
677 |
Sure, there is google translate, pons and linguee apps etc.. but isn't it cooler to make an app where all these
|
678 |
translators are integrated?
|
679 |
|
@@ -683,8 +654,8 @@ I open sourced the `Translator++ app <https://github.com/nidhaloff/deep-translat
|
|
683 |
Feel free to take a look at the code or make a pull request ;)
|
684 |
|
685 |
.. note::
|
686 |
-
The Translator++ app is based on the
|
687 |
-
of the
|
688 |
|
689 |
I published the first release on google play store on 02-08-2020
|
690 |
|
@@ -692,22 +663,22 @@ Here are some screenshots:
|
|
692 |
|
693 |
- Phone
|
694 |
|
695 |
-
.. image:: assets/translator1.jpg
|
696 |
:width: 30%
|
697 |
:height: 200
|
698 |
:alt: screenshot1
|
699 |
-
.. image:: assets/translator2.jpg
|
700 |
:width: 30%
|
701 |
:height: 200
|
702 |
:alt: screenshot2
|
703 |
-
.. image:: assets/spinner.jpg
|
704 |
:width: 30%
|
705 |
:height: 200
|
706 |
:alt: spinner
|
707 |
|
708 |
- Tablet:
|
709 |
|
710 |
-
.. image:: assets/hz_view.png
|
711 |
:width: 100%
|
712 |
:height: 300
|
713 |
:alt: screenshot3
|
|
|
2 |
deep-translator
|
3 |
##################
|
4 |
|
5 |
+
.. image:: ../assets/icon.jpg
|
6 |
:width: 100
|
7 |
:align: center
|
8 |
:alt: deep-translator-icon
|
|
|
125 |
|
126 |
.. code-block:: console
|
127 |
|
128 |
+
$ pip install -U deep-translator
|
129 |
|
130 |
take a look at the docs if you want to install from source.
|
131 |
|
|
|
135 |
|
136 |
.. code-block:: python
|
137 |
|
138 |
+
from deep-translator import GoogleTranslator
|
139 |
translated = GoogleTranslator(source='auto', target='de').translate("keep it up, you are awesome") # output -> Weiter so, du bist großartig
|
140 |
|
141 |
or using proxies:
|
142 |
|
143 |
.. code-block:: python
|
144 |
|
145 |
+
from deep-translator import GoogleTranslator
|
146 |
|
147 |
proxies_example = {
|
148 |
"https": "34.195.196.27:8080",
|
|
|
155 |
|
156 |
.. code-block:: console
|
157 |
|
158 |
+
$ deep-translator -trans "google" -src "en" -tg "de" -txt "keep it up, you are awesome"
|
159 |
|
160 |
|
161 |
=====
|
|
|
175 |
|
176 |
.. code-block:: python
|
177 |
|
178 |
+
from deep-translator import (GoogleTranslator,
|
179 |
MicrosoftTranslator,
|
180 |
PonsTranslator,
|
181 |
LingueeTranslator,
|
|
|
536 |
|
537 |
.. code-block:: python
|
538 |
|
539 |
+
from deep-translator import GoogleTranslator
|
540 |
|
541 |
# define your proxy configs:
|
542 |
proxies_example = {
|
|
|
551 |
Usage from Terminal
|
552 |
--------------------
|
553 |
|
554 |
+
Deep-translator supports a series of command line arguments for quick and simple access to the translators directly in your console.
|
|
|
|
|
555 |
|
556 |
+
.. note::
|
|
|
|
|
|
|
557 |
|
558 |
+
The program accepts ``deep-translator`` or ``dt`` as a command, feel free to substitute whichever you prefer.
|
559 |
|
560 |
+
For a list of available translators:
|
561 |
|
562 |
.. code-block:: console
|
563 |
|
564 |
+
$ deep-translator list
|
565 |
|
566 |
+
To translate a string or line of text:
|
567 |
|
568 |
.. code-block:: console
|
569 |
|
570 |
+
$ deep-translator google --source "english" --target "german" --text "happy coding"
|
571 |
|
572 |
+
Alternate short option names, along with using language abbreviations:
|
573 |
|
574 |
.. code-block:: console
|
575 |
|
576 |
+
$ deep-translator google -src "en" -tgt "de" -txt "happy coding"
|
577 |
|
|
|
|
|
|
|
578 |
|
579 |
+
Finally, to retrieve a list of available languages for a given translator:
|
580 |
|
581 |
.. code-block:: console
|
582 |
|
583 |
+
$ deep-translator languages google
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
584 |
|
585 |
+
======
|
586 |
+
Tests
|
587 |
+
======
|
588 |
|
589 |
+
Developers can install the development version of deep-translator and execute unit tests to verify functionality. For more information on doing this, see `the contribution guidelines <https://deep-translator.readthedocs.io/en/latest/contributing.html/>`_
|
590 |
|
591 |
========
|
592 |
Links
|
|
|
639 |
The Translator++ mobile app
|
640 |
===========================
|
641 |
|
642 |
+
.. image:: ../assets/app-icon.png
|
643 |
:width: 100
|
644 |
:alt: Icon of the app
|
645 |
|
646 |
|
647 |
+
After developing the deep-translator, I realized how cool this would be if I can use it as an app on my mobile phone.
|
648 |
Sure, there is google translate, pons and linguee apps etc.. but isn't it cooler to make an app where all these
|
649 |
translators are integrated?
|
650 |
|
|
|
654 |
Feel free to take a look at the code or make a pull request ;)
|
655 |
|
656 |
.. note::
|
657 |
+
The Translator++ app is based on the deep-translator package. I just built the app to prove the capabilities
|
658 |
+
of the deep-translator package ;)
|
659 |
|
660 |
I published the first release on google play store on 02-08-2020
|
661 |
|
|
|
663 |
|
664 |
- Phone
|
665 |
|
666 |
+
.. image:: ../assets/translator1.jpg
|
667 |
:width: 30%
|
668 |
:height: 200
|
669 |
:alt: screenshot1
|
670 |
+
.. image:: ../assets/translator2.jpg
|
671 |
:width: 30%
|
672 |
:height: 200
|
673 |
:alt: screenshot2
|
674 |
+
.. image:: ../assets/spinner.jpg
|
675 |
:width: 30%
|
676 |
:height: 200
|
677 |
:alt: spinner
|
678 |
|
679 |
- Tablet:
|
680 |
|
681 |
+
.. image:: ../assets/hz_view.png
|
682 |
:width: 100%
|
683 |
:height: 300
|
684 |
:alt: screenshot3
|
docs/authors.rst
CHANGED
@@ -1 +1,15 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=======
|
2 |
+
Credits
|
3 |
+
=======
|
4 |
+
|
5 |
+
Development Lead
|
6 |
+
----------------
|
7 |
+
|
8 |
+
* Nidhal Baccouri <[email protected]>
|
9 |
+
|
10 |
+
Contributors
|
11 |
+
------------
|
12 |
+
|
13 |
+
@prataffel
|
14 |
+
@senk8
|
15 |
+
@nothead31
|
docs/conf.py
CHANGED
@@ -57,7 +57,7 @@ author = "Nidhal Baccouri"
|
|
57 |
# the built documents.
|
58 |
#
|
59 |
# The short X.Y version.
|
60 |
-
|
61 |
# The full version, including alpha/beta/rc tags.
|
62 |
# release = deep_translator.__version__
|
63 |
|
|
|
57 |
# the built documents.
|
58 |
#
|
59 |
# The short X.Y version.
|
60 |
+
version = '1.5.1-pre1'
|
61 |
# The full version, including alpha/beta/rc tags.
|
62 |
# release = deep_translator.__version__
|
63 |
|
docs/contributing.rst
CHANGED
@@ -1 +1,131 @@
|
|
1 |
-
..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.. highlight:: shell
|
2 |
+
|
3 |
+
============
|
4 |
+
Contributing
|
5 |
+
============
|
6 |
+
|
7 |
+
Contributions are welcome, and they are greatly appreciated! Every little bit
|
8 |
+
helps, and credit will always be given.
|
9 |
+
|
10 |
+
You can contribute in many ways:
|
11 |
+
|
12 |
+
Types of Contributions
|
13 |
+
----------------------
|
14 |
+
|
15 |
+
Report Bugs
|
16 |
+
~~~~~~~~~~~
|
17 |
+
|
18 |
+
Report bugs at https://github.com/nidhaloff/deep_translator/issues.
|
19 |
+
|
20 |
+
If you are reporting a bug, please include:
|
21 |
+
|
22 |
+
* Your operating system name and version.
|
23 |
+
* Any details about your local setup that might be helpful in troubleshooting.
|
24 |
+
* Detailed steps to reproduce the bug.
|
25 |
+
* If the bug includes a tracelog, include that in your bug report. Remember on github, you can enclose code or console output in ``` insert code here ```.
|
26 |
+
|
27 |
+
Fix Bugs
|
28 |
+
~~~~~~~~
|
29 |
+
|
30 |
+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
|
31 |
+
|
32 |
+
Implement Features
|
33 |
+
~~~~~~~~~~~~~~~~~~
|
34 |
+
|
35 |
+
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
|
36 |
+
|
37 |
+
.. note::
|
38 |
+
|
39 |
+
You can contact @nothead31 or comment on the issue if you wish to be listed under 'Assigned'.
|
40 |
+
|
41 |
+
Write Documentation
|
42 |
+
~~~~~~~~~~~~~~~~~~~
|
43 |
+
|
44 |
+
deep_translator could always use more documentation, whether as part of the official deep_translator docs, in docstrings, or even on the web in blog posts, articles, and such. If you do a write-up on your own site, please let us know and we will add a link to it in the official documentation!
|
45 |
+
|
46 |
+
Submit Feedback
|
47 |
+
~~~~~~~~~~~~~~~
|
48 |
+
|
49 |
+
The best way to send feedback is to file an issue at https://github.com/nidhaloff/deep_translator/issues.
|
50 |
+
|
51 |
+
If you are proposing a feature:
|
52 |
+
|
53 |
+
* Explain in detail how it would work.
|
54 |
+
* Keep the scope as narrow as possible, to make it easier to implement.
|
55 |
+
* Remember that this is a volunteer-driven project, and that contributions
|
56 |
+
are welcome :)
|
57 |
+
|
58 |
+
Get Started!
|
59 |
+
------------
|
60 |
+
|
61 |
+
Ready to contribute? Here's how to set up `deep_translator` for local development.
|
62 |
+
|
63 |
+
1. Fork the `deep_translator` repo on GitHub.
|
64 |
+
2. Clone your fork locally::
|
65 |
+
|
66 |
+
$ git clone [email protected]:your_name_here/deep_translator.git
|
67 |
+
|
68 |
+
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
|
69 |
+
|
70 |
+
$ cd path/to/project
|
71 |
+
$ poetry shell
|
72 |
+
$ poetry install
|
73 |
+
|
74 |
+
.. note::
|
75 |
+
|
76 |
+
``poetry install`` will automatically install all package dependencies AND development dependencies. If you only want to run the package, append --no-dev to the command.
|
77 |
+
|
78 |
+
4. Create a branch for local development::
|
79 |
+
|
80 |
+
$ git checkout -b name-of-your-bugfix-or-feature
|
81 |
+
|
82 |
+
Now you can make your changes locally.
|
83 |
+
|
84 |
+
5. Ensure your changes are covered by test modules and that the tests pass with pytest before committing.
|
85 |
+
|
86 |
+
6. Commit your changes and push your branch to GitHub::
|
87 |
+
|
88 |
+
$ git add .
|
89 |
+
$ git commit -m "Your detailed description of your changes."
|
90 |
+
$ git push origin name-of-your-bugfix-or-feature
|
91 |
+
|
92 |
+
7. Submit a pull request through the GitHub website.
|
93 |
+
|
94 |
+
Pull Request Guidelines
|
95 |
+
-----------------------
|
96 |
+
|
97 |
+
Before you submit a pull request, check that it meets these guidelines:
|
98 |
+
|
99 |
+
1. The pull request should include any relevant tests (located under :file:`.deep_translator/tests`)
|
100 |
+
2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
|
101 |
+
3. Pull requests are automatically tested on GitHub for compatability with Python version 3.7, 3.8, and 3.9. Please review your test results and ensure your request passes all tests.
|
102 |
+
|
103 |
+
Tips
|
104 |
+
----
|
105 |
+
|
106 |
+
To run only certain tests::
|
107 |
+
|
108 |
+
$ pytest -ra
|
109 |
+
|
110 |
+
.. note::
|
111 |
+
|
112 |
+
will run all tests, excluding any that previously passed, and provides a simple test report.
|
113 |
+
|
114 |
+
$ pytest test_mod.py
|
115 |
+
|
116 |
+
.. note::
|
117 |
+
|
118 |
+
Runs only the tests in the named testing module. Useful for only testing a subset of functionality.
|
119 |
+
|
120 |
+
Deploying
|
121 |
+
---------
|
122 |
+
|
123 |
+
A reminder for the maintainers on how to deploy.
|
124 |
+
Make sure all your changes are committed (including an entry in HISTORY.rst).
|
125 |
+
Then run::
|
126 |
+
|
127 |
+
$ poetry version major|minor|patch
|
128 |
+
$ git push
|
129 |
+
$ git push --tags
|
130 |
+
|
131 |
+
After pushing a new version to the master branch, github will build a package and upload it to PyPI.
|
docs/deep_translator.rst
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
deep\_translator package
|
2 |
-
========================
|
3 |
-
|
4 |
-
Submodules
|
5 |
-
----------
|
6 |
-
|
7 |
-
deep\_translator.cli module
|
8 |
-
---------------------------
|
9 |
-
|
10 |
-
.. automodule:: deep_translator.cli
|
11 |
-
:members:
|
12 |
-
:undoc-members:
|
13 |
-
:show-inheritance:
|
14 |
-
|
15 |
-
deep\_translator.constants module
|
16 |
-
---------------------------------
|
17 |
-
|
18 |
-
.. automodule:: deep_translator.constants
|
19 |
-
:members:
|
20 |
-
:undoc-members:
|
21 |
-
:show-inheritance:
|
22 |
-
|
23 |
-
deep\_translator.deep\_translator module
|
24 |
-
----------------------------------------
|
25 |
-
|
26 |
-
.. automodule:: deep_translator.deep_translator
|
27 |
-
:members:
|
28 |
-
:undoc-members:
|
29 |
-
:show-inheritance:
|
30 |
-
|
31 |
-
deep\_translator.exceptions module
|
32 |
-
----------------------------------
|
33 |
-
|
34 |
-
.. automodule:: deep_translator.exceptions
|
35 |
-
:members:
|
36 |
-
:undoc-members:
|
37 |
-
:show-inheritance:
|
38 |
-
|
39 |
-
deep\_translator.models module
|
40 |
-
------------------------------
|
41 |
-
|
42 |
-
.. automodule:: deep_translator.models
|
43 |
-
:members:
|
44 |
-
:undoc-members:
|
45 |
-
:show-inheritance:
|
46 |
-
|
47 |
-
|
48 |
-
Module contents
|
49 |
-
---------------
|
50 |
-
|
51 |
-
.. automodule:: deep_translator
|
52 |
-
:members:
|
53 |
-
:undoc-members:
|
54 |
-
:show-inheritance:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
docs/history.rst
CHANGED
@@ -1 +1,20 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
==================
|
2 |
+
Important History
|
3 |
+
==================
|
4 |
+
|
5 |
+
- 1.5.0 improved cli functionality with streamlined commands and numerous bugfixes.
|
6 |
+
- 1.4.4 added support for papago, added opt params, fixed deepl free api
|
7 |
+
- 1.4.3 added support deepl free api
|
8 |
+
- 1.4.2 added proxy support
|
9 |
+
- 1.3.4 bug fixes for the dutch language
|
10 |
+
- 1.3.3 fixed bug in google translate
|
11 |
+
|
12 |
+
- 1.2.5: added support for the DeepL translator
|
13 |
+
- 1.2.4: added support for the QCRI translator
|
14 |
+
- 1.2.1: added support for the yandex translator
|
15 |
+
- 1.1.9: fixed bug in requests
|
16 |
+
- 1.1.5: added language detection
|
17 |
+
- 1.1.3: added support for mymemory
|
18 |
+
- 1.0.4: added support for pons
|
19 |
+
- 1.0.2: added support for linguee
|
20 |
+
- 1.0.0: added support for google translate
|
docs/index.rst
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
|
2 |
Welcome to deep_translator's documentation!
|
3 |
-
|
4 |
|
5 |
If you see this doc in other languages,you can see :doc:`Choose languages</other_lang>`.
|
6 |
|
@@ -9,7 +9,7 @@ If you see this doc in other languages,you can see :doc:`Choose languages</other
|
|
9 |
:caption: Contents:
|
10 |
:name: mastertoc
|
11 |
|
12 |
-
|
13 |
installation
|
14 |
usage
|
15 |
modules
|
|
|
1 |
|
2 |
Welcome to deep_translator's documentation!
|
3 |
+
===========================================
|
4 |
|
5 |
If you see this doc in other languages,you can see :doc:`Choose languages</other_lang>`.
|
6 |
|
|
|
9 |
:caption: Contents:
|
10 |
:name: mastertoc
|
11 |
|
12 |
+
README
|
13 |
installation
|
14 |
usage
|
15 |
modules
|
docs/installation.rst
CHANGED
@@ -23,8 +23,8 @@ you through the process.
|
|
23 |
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
|
24 |
|
25 |
|
26 |
-
From
|
27 |
-
|
28 |
|
29 |
The sources for deep_translator can be downloaded from the `Github repo`_.
|
30 |
|
@@ -44,7 +44,11 @@ Once you have a copy of the source, you can install it with:
|
|
44 |
|
45 |
.. code-block:: console
|
46 |
|
47 |
-
$
|
|
|
|
|
|
|
|
|
48 |
|
49 |
|
50 |
.. _Github repo: https://github.com/nidhaloff/deep_translator
|
|
|
23 |
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
|
24 |
|
25 |
|
26 |
+
From source code
|
27 |
+
----------------
|
28 |
|
29 |
The sources for deep_translator can be downloaded from the `Github repo`_.
|
30 |
|
|
|
44 |
|
45 |
.. code-block:: console
|
46 |
|
47 |
+
$ pip install /path/to/tarball/tarball_name.tar.gz
|
48 |
+
<<< for tarball installations
|
49 |
+
$ poetry shell
|
50 |
+
$ poetry install
|
51 |
+
<<< for cloned repos
|
52 |
|
53 |
|
54 |
.. _Github repo: https://github.com/nidhaloff/deep_translator
|
{ja → docs/ja}/README.rst
RENAMED
File without changes
|
AUTHORS.rst → docs/ja/authors.rst
RENAMED
@@ -1,15 +1,15 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
|
5 |
-
|
6 |
-
|
7 |
|
8 |
* Nidhal Baccouri <[email protected]>
|
9 |
|
10 |
-
|
11 |
------------
|
12 |
|
13 |
@prataffel
|
14 |
-
@senk8
|
15 |
-
@nothead31
|
|
|
1 |
+
=============
|
2 |
+
クレジット
|
3 |
+
=============
|
4 |
|
5 |
+
開発リーダー
|
6 |
+
--------------------------------
|
7 |
|
8 |
* Nidhal Baccouri <[email protected]>
|
9 |
|
10 |
+
寄稿者
|
11 |
------------
|
12 |
|
13 |
@prataffel
|
14 |
+
@ senk8
|
15 |
+
@ nothead31
|
ja/CONTRIBUTING.rst → docs/ja/contributing.rst
RENAMED
@@ -1,8 +1,8 @@
|
|
1 |
.. highlight:: shell
|
2 |
|
3 |
-
|
4 |
コントリビュートする方法
|
5 |
-
|
6 |
|
7 |
このプロジェクトではあなたのコントリビュートを歓迎します!どんなに小さい貢献でも、コントリビューターとしてプロジェクトを支援することができます。
|
8 |
|
@@ -23,7 +23,7 @@
|
|
23 |
* バグを再現するための詳細な手順
|
24 |
|
25 |
バグの修正
|
26 |
-
|
27 |
|
28 |
このリポジトリのイシューを見ることで、バグの情報を確認できます。
|
29 |
"bug" と "help wanted"でタグ付けされているものは、誰でもバグを修正にしてコントリビュートすることができます。
|
@@ -41,7 +41,7 @@ deep_translator は、deep_translator の公式ドキュメントの一部、doc
|
|
41 |
|
42 |
|
43 |
新しい機能の提案
|
44 |
-
|
45 |
|
46 |
新しい提案をするには https://github.com/nidhaloff/deep_translator/issues に投稿してください。
|
47 |
|
@@ -53,7 +53,7 @@ deep_translator は、deep_translator の公式ドキュメントの一部、doc
|
|
53 |
|
54 |
|
55 |
開発環境の構築
|
56 |
-
|
57 |
|
58 |
コントリビュートの準備はできましたか?ここからは deep_translator の開発環境を構築する方法について説明します。
|
59 |
|
@@ -91,7 +91,7 @@ deep_translator は、deep_translator の公式ドキュメントの一部、doc
|
|
91 |
7. GitHub からプルリクエストを送る.
|
92 |
|
93 |
プルリクエストにあたって
|
94 |
-
|
95 |
|
96 |
プルリクエストを送る前に以下のガイドラインに従っているか確認してください:
|
97 |
|
@@ -103,7 +103,7 @@ deep_translator は、deep_translator の公式ドキュメントの一部、doc
|
|
103 |
|
104 |
|
105 |
ヒント
|
106 |
-
|
107 |
|
108 |
テストのサブセットを実行するには以下のコマンドが利用できます::
|
109 |
|
@@ -111,7 +111,7 @@ $ pytest tests.test_deep_translator
|
|
111 |
|
112 |
|
113 |
デプロイの方法
|
114 |
-
|
115 |
|
116 |
メンテナンス担当者のためにデプロイの方法を記しておきます。まず、全ての変更がコミットされていることを確認してください。(HISTORY.rstのエントリを含む).
|
117 |
次に、以下のコマンドを実行します::
|
|
|
1 |
.. highlight:: shell
|
2 |
|
3 |
+
=======================
|
4 |
コントリビュートする方法
|
5 |
+
=======================
|
6 |
|
7 |
このプロジェクトではあなたのコントリビュートを歓迎します!どんなに小さい貢献でも、コントリビューターとしてプロジェクトを支援することができます。
|
8 |
|
|
|
23 |
* バグを再現するための詳細な手順
|
24 |
|
25 |
バグの修正
|
26 |
+
~~~~~~~~~~~
|
27 |
|
28 |
このリポジトリのイシューを見ることで、バグの情報を確認できます。
|
29 |
"bug" と "help wanted"でタグ付けされているものは、誰でもバグを修正にしてコントリビュートすることができます。
|
|
|
41 |
|
42 |
|
43 |
新しい機能の提案
|
44 |
+
~~~~~~~~~~~~~~~~~~
|
45 |
|
46 |
新しい提案をするには https://github.com/nidhaloff/deep_translator/issues に投稿してください。
|
47 |
|
|
|
53 |
|
54 |
|
55 |
開発環境の構築
|
56 |
+
----------------
|
57 |
|
58 |
コントリビュートの準備はできましたか?ここからは deep_translator の開発環境を構築する方法について説明します。
|
59 |
|
|
|
91 |
7. GitHub からプルリクエストを送る.
|
92 |
|
93 |
プルリクエストにあたって
|
94 |
+
----------------------------
|
95 |
|
96 |
プルリクエストを送る前に以下のガイドラインに従っているか確認してください:
|
97 |
|
|
|
103 |
|
104 |
|
105 |
ヒント
|
106 |
+
---------
|
107 |
|
108 |
テストのサブセットを実行するには以下のコマンドが利用できます::
|
109 |
|
|
|
111 |
|
112 |
|
113 |
デプロイの方法
|
114 |
+
------------------
|
115 |
|
116 |
メンテナンス担当者のためにデプロイの方法を記しておきます。まず、全ての変更がコミットされていることを確認してください。(HISTORY.rstのエントリを含む).
|
117 |
次に、以下のコマンドを実行します::
|
docs/ja/history.rst
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
==================
|
2 |
+
重要な歴史
|
3 |
+
==================
|
4 |
+
|
5 |
+
-1.5.0は、合理化されたコマンドと多数のバグ修正により、cli機能を改善しました。
|
6 |
+
-1.4.4 papagoのサポートの追加、opt paramsの追加、deepl無料APIの修正
|
7 |
+
-1.4.3追加されたサポートdeepl無料API
|
8 |
+
-1.4.2追加されたプロキシサポート
|
9 |
+
-オランダ語の1.3.4バグ修正
|
10 |
+
-1.3.3グーグル翻訳のバグを修正
|
11 |
+
|
12 |
+
-1.2.5:DeepLトランスレータのサポートが追加されました
|
13 |
+
-1.2.4:QCRIトランスレータのサポートが追加されました
|
14 |
+
-1.2.1:yandexトランスレータのサポートが追加されました
|
15 |
+
-1.1.9:リクエストのバグを修正
|
16 |
+
-1.1.5:言語検出を追加
|
17 |
+
-1.1.3:mymemoryのサポートが追加されました
|
18 |
+
-1.0.4:橋のサポートが追加されました
|
19 |
+
-1.0.2:lingueeのサポートが追加されました
|
20 |
+
-1.0.0:googletranslateのサポートが追加されました
|
{ja → docs/ja}/index.rst
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
.. _jadoc:
|
2 |
|
3 |
deep_translatorのドキュメントへようこそ!
|
4 |
-
|
5 |
|
6 |
違う言語でドキュメントを読みたい場合は :doc:`こちら<../other_lang>`.
|
7 |
|
@@ -9,10 +9,10 @@ deep_translatorのドキュメントへようこそ!
|
|
9 |
:maxdepth: 2
|
10 |
:caption: Contents:
|
11 |
|
12 |
-
|
13 |
installation
|
14 |
usage
|
15 |
-
modules
|
16 |
contributing
|
17 |
authors
|
18 |
history
|
|
|
1 |
.. _jadoc:
|
2 |
|
3 |
deep_translatorのドキュメントへようこそ!
|
4 |
+
===================================================
|
5 |
|
6 |
違う言語でドキュメントを読みたい場合は :doc:`こちら<../other_lang>`.
|
7 |
|
|
|
9 |
:maxdepth: 2
|
10 |
:caption: Contents:
|
11 |
|
12 |
+
README
|
13 |
installation
|
14 |
usage
|
15 |
+
../modules
|
16 |
contributing
|
17 |
authors
|
18 |
history
|
{ja → docs/ja}/installation.rst
RENAMED
File without changes
|
{ja → docs/ja}/usage.rst
RENAMED
File without changes
|
docs/modules.rst
CHANGED
@@ -1,7 +1,105 @@
|
|
1 |
-
|
2 |
-
|
3 |
|
4 |
-
|
5 |
-
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
deep\_translator package
|
2 |
+
========================
|
3 |
|
4 |
+
Submodules
|
5 |
+
----------
|
6 |
|
7 |
+
CLI Module
|
8 |
+
----------------------------
|
9 |
+
|
10 |
+
.. automodule:: deep_translator.main
|
11 |
+
:members:
|
12 |
+
:undoc-members:
|
13 |
+
:show-inheritance:
|
14 |
+
|
15 |
+
Exceptions
|
16 |
+
----------------------------------
|
17 |
+
|
18 |
+
.. automodule:: deep_translator.exceptions
|
19 |
+
:members:
|
20 |
+
:undoc-members:
|
21 |
+
:show-inheritance:
|
22 |
+
|
23 |
+
|
24 |
+
Language Detection Library
|
25 |
+
----------------------------------
|
26 |
+
|
27 |
+
.. automodule:: deep_translator.detection
|
28 |
+
:members:
|
29 |
+
:undoc-members:
|
30 |
+
:show-inheritance:
|
31 |
+
|
32 |
+
Translators
|
33 |
+
============
|
34 |
+
|
35 |
+
Google Translator
|
36 |
+
----------------------------------
|
37 |
+
|
38 |
+
.. automodule:: deep_translator.google_trans
|
39 |
+
:members:
|
40 |
+
:undoc-members:
|
41 |
+
:show-inheritance:
|
42 |
+
|
43 |
+
DeepL
|
44 |
+
----------------------------------
|
45 |
+
|
46 |
+
.. automodule:: deep_translator.deepl
|
47 |
+
:members:
|
48 |
+
:undoc-members:
|
49 |
+
:show-inheritance:
|
50 |
+
|
51 |
+
Linguee
|
52 |
+
----------------------------------
|
53 |
+
|
54 |
+
.. automodule:: deep_translator.linguee
|
55 |
+
:members:
|
56 |
+
:undoc-members:
|
57 |
+
:show-inheritance:
|
58 |
+
|
59 |
+
Microsoft/Bing Translate
|
60 |
+
----------------------------------
|
61 |
+
|
62 |
+
.. automodule:: deep_translator.microsoft
|
63 |
+
:members:
|
64 |
+
:undoc-members:
|
65 |
+
:show-inheritance:
|
66 |
+
|
67 |
+
MyMemory
|
68 |
+
----------------------------------
|
69 |
+
|
70 |
+
.. automodule:: deep_translator.mymemory
|
71 |
+
:members:
|
72 |
+
:undoc-members:
|
73 |
+
:show-inheritance:
|
74 |
+
|
75 |
+
Papago
|
76 |
+
----------------------------------
|
77 |
+
|
78 |
+
.. automodule:: deep_translator.papago
|
79 |
+
:members:
|
80 |
+
:undoc-members:
|
81 |
+
:show-inheritance:
|
82 |
+
|
83 |
+
Pons
|
84 |
+
----------------------------------
|
85 |
+
|
86 |
+
.. automodule:: deep_translator.pons
|
87 |
+
:members:
|
88 |
+
:undoc-members:
|
89 |
+
:show-inheritance:
|
90 |
+
|
91 |
+
QCRI
|
92 |
+
----------------------------------
|
93 |
+
|
94 |
+
.. automodule:: deep_translator.qcri
|
95 |
+
:members:
|
96 |
+
:undoc-members:
|
97 |
+
:show-inheritance:
|
98 |
+
|
99 |
+
Yandex
|
100 |
+
----------------------------------
|
101 |
+
|
102 |
+
.. automodule:: deep_translator.yandex
|
103 |
+
:members:
|
104 |
+
:undoc-members:
|
105 |
+
:show-inheritance:
|
docs/other_lang.rst
CHANGED
@@ -7,4 +7,4 @@ English
|
|
7 |
|
8 |
日本語
|
9 |
--------------
|
10 |
-
:doc
|
|
|
7 |
|
8 |
日本語
|
9 |
--------------
|
10 |
+
:doc:`日本語版ドキュメント<ja/index>`
|
docs/readme.rst
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
.. include:: ../README.rst
|
|
|
|
ja/history.rst
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
ja/modules.rst
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
deep_translator
|
2 |
-
===============
|
3 |
-
|
4 |
-
.. toctree::
|
5 |
-
:maxdepth: 4
|
6 |
-
|
7 |
-
deep_translator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|