pax_global_header00006660000000000000000000000064143251270220014510gustar00rootroot0000000000000052 comment=23fb32d1eb538c9a56360fa24b5db06d85234fb1 dialect-2.1.1/000077500000000000000000000000001432512702200131165ustar00rootroot00000000000000dialect-2.1.1/.github/000077500000000000000000000000001432512702200144565ustar00rootroot00000000000000dialect-2.1.1/.github/workflows/000077500000000000000000000000001432512702200165135ustar00rootroot00000000000000dialect-2.1.1/.github/workflows/CI.yml000066400000000000000000000011321432512702200175260ustar00rootroot00000000000000on: push: branches: [main] pull_request: name: CI jobs: flatpak-builder: name: "Flatpak Builder" runs-on: ubuntu-latest container: image: bilelmoussaoui/flatpak-github-actions:gnome-nightly options: --privileged steps: - uses: actions/checkout@v2 with: submodules: recursive - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 with: bundle: "dialect-devel.flatpak" manifest-path: "build-aux/flatpak/app.drey.Dialect.Devel.json" run-tests: "true" cache-key: flatpak-builder-${{ github.sha }} dialect-2.1.1/.gitignore000066400000000000000000000037371432512702200151200ustar00rootroot00000000000000# Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ builddir/ build-dir/ _build/ .flatpak/ .flatpak-builder/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ pip-wheel-metadata/ share/python-wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover *.py,cover .hypothesis/ .pytest_cache/ # Translations *.mo # Django stuff: *.log local_settings.py db.sqlite3 db.sqlite3-journal # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # IPython profile_default/ ipython_config.py # pyenv .python-version # pipenv # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. # However, in case of collaboration, if having platform-specific dependencies or dependencies # having no cross-platform support, pipenv may install dependencies that don't work, or not # install all needed dependencies. #Pipfile.lock # PEP 582; used by e.g. github.com/David-OConnor/pyflow __pypackages__/ # Celery stuff celerybeat-schedule celerybeat.pid # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json dmypy.json # Pyre type checker .pyre/ # Glade backup *.ui~ # Other backup files *.backup # VSCode Workspace settings .vscode/ # PyCharm settings .idea/ # Subprojects /subprojects/blueprint-compiler dialect-2.1.1/.gitmodules000066400000000000000000000001051432512702200152670ustar00rootroot00000000000000[submodule "po"] path = po url = https://github.com/dialect-app/po dialect-2.1.1/LICENSE000066400000000000000000001045151432512702200141310ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . dialect-2.1.1/README.md000066400000000000000000000046011432512702200143760ustar00rootroot00000000000000 # Dialect A translation app for GNOME. ![Dialect](preview.png?raw=true) ## Features - Translation based on Google Translate - Translation based on the LibreTranslate API, allowing you to use any public instance - Translation history - Automatic language detection - Text to speech - Clipboard buttons ## Installation ### Flathub Download on Flathub ### AUR Arch-based distro users can install from the AUR: [`dialect`](https://aur.archlinux.org/packages/dialect) for the stable version or [`dialect-git`](https://aur.archlinux.org/packages/dialect-git/) for the latest git revision. ### Fedora Dialect is available for Fedora 33 and later: ```bash sudo dnf install dialect ``` ## Building ### Requirements - Python 3 `python` - PyGObject `python-gobject` - GTK4 `gtk4` - libadwaita (>= 1.2.0) `libadwaita` - GStreamer 1.0 `gstreamer` - Meson `meson` - Ninja `ninja` - gTTS `python-gtts` - D-Bus `python-dbus` If official packages are not available for any of the python dependencies, you can install them from pip: ```bash pip install gtts ``` ### Building from Git ```bash git clone --recurse-submodules https://github.com/dialect-app/dialect.git cd dialect meson builddir --prefix=/usr/local sudo ninja -C builddir install ``` For testing and development purposes, you may run a local build: ```bash git clone --recurse-submodules https://github.com/dialect-app/dialect.git cd dialect meson builddir meson configure builddir -Dprefix=$(pwd)/builddir/testdir ninja -C builddir install ninja -C builddir run ``` ## Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. ### Translations Dialect has already been translated into many languages (see the [translations repository](https://github.com/dialect-app/po/blob/main/README.md) file). Please help translate Dialect into more languages through [Weblate](https://hosted.weblate.org/engage/dialect/). Translation status ## License [GNU General Public License 3 or later](https://www.gnu.org/licenses/gpl-3.0.en.html) dialect-2.1.1/build-aux/000077500000000000000000000000001432512702200150105ustar00rootroot00000000000000dialect-2.1.1/build-aux/flatpak/000077500000000000000000000000001432512702200164325ustar00rootroot00000000000000dialect-2.1.1/build-aux/flatpak/app.drey.Dialect.Devel.json000066400000000000000000000023031432512702200234470ustar00rootroot00000000000000{ "app-id" : "app.drey.Dialect.Devel", "runtime" : "org.gnome.Platform", "runtime-version" : "master", "sdk" : "org.gnome.Sdk", "command" : "dialect", "finish-args" : [ "--share=network", "--share=ipc", "--device=dri", "--socket=fallback-x11", "--socket=wayland", "--socket=pulseaudio", "--own-name=app.drey.Dialect.Devel.SearchProvider" ], "cleanup" : [ "*blueprint*" ], "modules" : [ "pypi-dependencies.json", { "name": "blueprint", "buildsystem": "meson", "sources": [ { "type": "git", "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler", "tag": "v0.4.0", "commit": "75a6d95988736ec0471d22ceb07579c0cedac2ad" } ] }, { "name" : "dialect", "buildsystem" : "meson", "config-opts": ["-Dprofile=development"], "sources" : [ { "type" : "dir", "path" : "../../." } ] } ] } dialect-2.1.1/build-aux/flatpak/pypi-dependencies.json000066400000000000000000000066751432512702200227500ustar00rootroot00000000000000{ "name": "python3-modules", "buildsystem": "simple", "build-commands": [], "modules": [ { "name": "python3-dbus-python", "buildsystem": "simple", "build-commands": [ "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"dbus-python\" --no-build-isolation" ], "sources": [ { "type": "file", "url": "https://files.pythonhosted.org/packages/b1/5c/ccfc167485806c1936f7d3ba97db6c448d0089c5746ba105b6eb22dba60e/dbus-python-1.2.18.tar.gz", "sha256": "92bdd1e68b45596c833307a5ff4b217ee6929a1502f5341bae28fd120acf7260" } ] }, { "name": "python3-gtts", "buildsystem": "simple", "build-commands": [ "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"gtts\" --no-build-isolation" ], "sources": [ { "type": "file", "url": "https://files.pythonhosted.org/packages/4e/b8/f5a25b22e803f0578e668daa33ba3701bb37858ec80e08a150bd7d2cf1b1/urllib3-1.26.8-py2.py3-none-any.whl", "sha256": "000ca7f471a233c2251c6c7023ee85305721bfdf18621ebff4fd17a8653427ed" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl", "sha256": "84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/84/3e/1037abe6498e65d645ce7a22d3402605d49a3b2c7f20c3abb027760da4f0/charset_normalizer-2.0.10-py3-none-any.whl", "sha256": "cb957888737fc0bbcd78e3df769addb41fd1ff8cf950dc9e7ad7793f1bf44455" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl", "sha256": "d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl", "sha256": "f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/48/58/c8aa6a8e62cc75f39fee1092c45d6b6ba684122697d7ce7d53f64f98a129/click-8.0.3-py3-none-any.whl", "sha256": "353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3" }, { "type": "file", "url": "https://files.pythonhosted.org/packages/e4/9e/fe139150719281309c6e52a799e86d7d8d19f6f2593b340e3693f6ef2c77/gTTS-2.2.3-py3-none-any.whl", "sha256": "8376d9bde85ac8cda95ea92dcd12bf31a3efe9e810edcb04437a4151cbec30d6" } ] } ] } dialect-2.1.1/data/000077500000000000000000000000001432512702200140275ustar00rootroot00000000000000dialect-2.1.1/data/app.drey.Dialect-symbolic.svg000066400000000000000000000013541432512702200214600ustar00rootroot00000000000000 dialect-2.1.1/data/app.drey.Dialect.Devel.svg000066400000000000000000000161151432512702200207000ustar00rootroot00000000000000 dialect-2.1.1/data/app.drey.Dialect.Source.svg000066400000000000000000001233071432512702200211030ustar00rootroot00000000000000 Adwaita Icon Template image/svg+xml GNOME Design Team Adwaita Icon Template D D dialect-2.1.1/data/app.drey.Dialect.desktop.in.in000077500000000000000000000007361432512702200215330ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=false Exec=dialect Name=Dialect Comment=Translate between languages Categories=Network;GTK; Icon=@icon@ # Translators: These are search terms to find this application. Do NOT translate or localize the semicolons. The list MUST also end with a semicolon. Keywords=translate;translation; # Translators: Do NOT translate or transliterate this text (these are enum types)! X-Purism-FormFactor=Workstation;Mobile; dialect-2.1.1/data/app.drey.Dialect.gschema.xml.in000066400000000000000000000037761432512702200216670ustar00rootroot00000000000000 [800, 300] "auto" false false false true 0 [] "" "google" false [] [] "" "" "google" dialect-2.1.1/data/app.drey.Dialect.metainfo.xml.in.in000066400000000000000000000135741432512702200224640ustar00rootroot00000000000000 @app-id@ CC0-1.0 GPL-3.0-or-later Dialect Translate between languages

A translation app for GNOME.

Features:

  • Translation based on Google Translate
  • Translation based on the LibreTranslate API, allowing you to use any public instance
  • Translation based on Lingva Translate API
  • Text to speech
  • Translation history
  • Automatic language detection
  • Clipboard buttons
https://github.com/dialect-app/dialect/ https://github.com/dialect-app/dialect/issues/ https://hosted.weblate.org/engage/dialect/ The Dialect Authors @app-id@.desktop dialect https://raw.githubusercontent.com/dialect-app/dialect/main/preview.png https://raw.githubusercontent.com/dialect-app/dialect/main/preview-2.png https://raw.githubusercontent.com/dialect-app/dialect/main/preview-mobile.png
  • Updated translations
  • Fixed minor bugs
  • Update to use libadwaita 1.2 widgets
  • Updated translations
  • Fixed minor bugs
  • Fixed responsive implementation
  • Fixed small stylings
  • Updated translations
  • Fixed an issue with scale factor
  • Ported to GTK4 and libadwaita
  • New in-app color scheme switcher
  • Added Lingva Translate support
  • Google Translate module rewritten from scratch to not rely on external libraries and improve reliability.
  • GNOME Search Provider improvements
  • APP ID changed to app.drey.Dialect
  • Added API keys support for LibreTranslate
  • Added translation suggestions support for LibreTranslate
  • Fixed proxies by rewriting the http backend
  • Character limit is now service-dependent
  • Major code base refactoring
  • Fixed several bugs
  • Fix shortcut bug
  • Added accels for most actions
  • Added localized language names
  • Added new translations
  • Fixed several minor bugs
  • Backend refactor
  • Added option to disable Google TTS
  • Added Czech translation
  • Fixed several minor bugs
  • Switch to a new icon
  • Added LibreTranslate backend
  • Added Pronunciations support in Google Translate
  • Added Swedish translation
  • Added Croatian translation
  • Fixed several minor bugs
  • Added a shortcuts window
  • Added Indonesian translation
  • Added Portugese (BR) translation
  • Fixed several bugs
  • Added a search provider for GNOME
  • Added support for "Did you mean" suggestions
  • Added a Ctrl+Q shortcut to quit
  • Added Hungarian translation
  • Added Italian translation
  • Added Persian translation
  • Added Russian translation
  • Added Turkish translation
  • Fixed some issues with the icon
  • Fixed several bugs
  • Made some minor UI improvements

Initial release.

ModernToolkit HiDpiIcon SearchProvider workstation mobile
dialect-2.1.1/data/app.drey.Dialect.svg000066400000000000000000000056711432512702200176470ustar00rootroot00000000000000 dialect-2.1.1/data/meson.build000066400000000000000000000042421432512702200161730ustar00rootroot00000000000000subdir('resources') # Install desktop desktop_conf = configuration_data() desktop_conf.set('icon', application_id) desktop_file = i18n.merge_file( input: configure_file( input: '@0@.desktop.in.in'.format(base_id), output: '@BASENAME@', configuration: desktop_conf ), output: '@0@.desktop'.format(application_id), type: 'desktop', po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'applications') ) desktop_utils = find_program('desktop-file-validate', required: false) if desktop_utils.found() test('Validate desktop file', desktop_utils, args: [desktop_file.full_path()] ) endif # Install metainfo appdata_conf = configuration_data() appdata_conf.set('app-id', application_id) appstream_file = i18n.merge_file( input: configure_file( input: '@0@.metainfo.xml.in.in'.format(base_id), output: '@BASENAME@', configuration: appdata_conf ), output: '@0@.metainfo.xml'.format(application_id), po_dir: '../po', install: true, install_dir: join_paths(get_option('datadir'), 'metainfo') ) appstream_util = find_program('appstream-util', required: false) if appstream_util.found() test('Validate appstream file', appstream_util, args: ['validate-relax', appstream_file.full_path()] ) endif # Install gsettings schema gschema_conf = configuration_data() gschema_conf.set('app-id', application_id) configure_file( input: '@0@.gschema.xml.in'.format(base_id), output: '@0@.gschema.xml'.format(application_id), configuration: gschema_conf, install: true, install_dir: join_paths(get_option('datadir'), 'glib-2.0/schemas') ) compile_schemas = find_program('glib-compile-schemas', required: false) if compile_schemas.found() test('Validate schema file', compile_schemas, args: ['--strict', '--dry-run', meson.current_source_dir()] ) endif # Install colored icon install_data( '@0@.svg'.format(application_id), install_dir: join_paths(get_option('datadir'), 'icons/hicolor/scalable/apps') ) # Install symbolic icon install_data( '@0@-symbolic.svg'.format(base_id), install_dir: join_paths(get_option('datadir'), 'icons/hicolor/symbolic/apps'), rename: '@0@-symbolic.svg'.format(application_id) ) dialect-2.1.1/data/resources/000077500000000000000000000000001432512702200160415ustar00rootroot00000000000000dialect-2.1.1/data/resources/about.blp000066400000000000000000000011231432512702200176470ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; Adw.AboutWindow about { modal: true; destroy-with-parent: true; application-name: _("Dialect"); developer-name: _("The Dialect Authors"); copyright: _("Copyright 2020–⁠2022 The Dialect Authors"); comments: _("A translation app for GNOME."); website: "https://github.com/dialect-app/dialect"; issue-url: "https://github.com/dialect-app/dialect/issues"; support-url: "https://github.com/dialect-app/dialect/discussions"; /* Translators: Replace me with your names. */ translator-credits: _("translator-credits"); license-type: gpl_3_0; } dialect-2.1.1/data/resources/dialect.gresource.xml000066400000000000000000000013701432512702200221660ustar00rootroot00000000000000 style.css style-dark.css shortcuts.ui window.ui about.ui preferences.ui lang-selector.ui lang-row.ui theme-switcher.ui dialect-2.1.1/data/resources/lang-row.blp000066400000000000000000000003441432512702200202670ustar00rootroot00000000000000using Gtk 4.0; template DialectLangRow : ListBoxRow { child: Box { spacing: 6; Label name { xalign: 0; } Image selection { icon-name: "object-select-symbolic"; visible: false; } }; } dialect-2.1.1/data/resources/lang-selector.blp000066400000000000000000000014631432512702200213030ustar00rootroot00000000000000using Gtk 4.0; template DialectLangSelector : Popover { height-request: 300; styles [ "lang-selector", "menu", ] Box { orientation: vertical; Box search_box { orientation: vertical; SearchEntry search { placeholder-text: _("Search Languages…"); } styles [ "search_box", ] } ScrolledWindow scroll { vexpand: true; child: Box { orientation: vertical; Revealer revealer { reveal-child: true; Box { orientation: vertical; ListBox recent_list { selection-mode: single; } Separator separator { } } } ListBox lang_list { selection-mode: single; } }; } } } dialect-2.1.1/data/resources/meson.build000066400000000000000000000011261432512702200202030ustar00rootroot00000000000000pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) gnome = import('gnome') blueprints = custom_target('blueprints', input: files( 'theme-switcher.blp', 'lang-selector.blp', 'window.blp', 'lang-row.blp', 'about.blp', 'shortcuts.blp', ), output: '.', command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) gnome.compile_resources('dialect', 'dialect.gresource.xml', dependencies: blueprints, gresource_bundle: true, install: true, install_dir: pkgdatadir, ) dialect-2.1.1/data/resources/preferences.ui000066400000000000000000000166711432512702200207140ustar00rootroot00000000000000 dialect-2.1.1/data/resources/shortcuts.blp000066400000000000000000000046341432512702200206050ustar00rootroot00000000000000using Gtk 4.0; template DialectShortcutsWindow : ShortcutsWindow { modal: true; ShortcutsSection { visible: true; section-name: "shortcuts"; max-height: 10; ShortcutsGroup { visible: true; title: C_("shortcuts window", "Translator"); ShortcutsShortcut translate_shortcut { visible: true; title: C_("shortcuts window", "Translate"); accelerator: "Return"; } ShortcutsShortcut switch_shortcut { visible: true; title: C_("shortcuts window", "Switch Languages"); action-name: "win.switch"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Clear source text"); action-name: "win.clear"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Copy translation"); action-name: "win.copy"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Show Pronunciation"); action-name: "app.pronunciation"; } } ShortcutsGroup { visible: true; title: C_("shortcuts window", "Text-to-Speech"); ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Listen to source text"); action-name: "win.listen-src"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Listen to translation"); action-name: "win.listen-dest"; } } ShortcutsGroup { visible: true; title: C_("shortcuts window", "Navigation"); ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Go back in history"); action-name: "win.back"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Go forward in history"); action-name: "win.forward"; } } ShortcutsGroup { visible: true; title: C_("shortcuts window", "General"); ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Preferences"); action-name: "app.preferences"; } ShortcutsShortcut { visible: true; title: C_("shortcut window", "Shortcuts"); action-name: "win.show-help-overlay"; } ShortcutsShortcut { visible: true; title: C_("shortcuts window", "Quit"); action-name: "app.quit"; } } } } dialect-2.1.1/data/resources/style-dark.css000066400000000000000000000002521432512702200206310ustar00rootroot00000000000000 .translation-scrolled undershoot.bottom { border-bottom: 1px solid #222222; } .translation-scrolled.top-undershoot undershoot.top { border-top: 1px solid #222222; }dialect-2.1.1/data/resources/style.css000066400000000000000000000042451432512702200177200ustar00rootroot00000000000000 /* Main Window */ .translation-box { padding: 4px 12px 12px; } .translation-box.vertical { padding-bottom: 0; padding-top: 0; } .translation-side-box textview, .translation-side-box text { background: none; color: inherit; } .translation-scrolled undershoot.bottom { border-bottom: 1px solid #ededed; } .translation-scrolled.top-undershoot undershoot.top { border-top: 1px solid #ededed; } .mistakes { margin: 6px; padding-right: 12px; padding-left: 12px; padding-top: 9px; padding-bottom: 9px; background-color: mix(@accent_bg_color, @window_bg_color, 0.7); } .pronunciation { padding: 9px; } /* Lang Selector */ .search_box { background: @popover_bg_color; border-bottom: 1px solid @borders; padding: 6px; } .lang-selector list { padding: 6px; padding-top: 4px; } .lang-selector row { margin-top: 2px; } .lang-selector separator { margin: 0 6px; } /* Actionbar */ actionbar.flat > revealer > box { background: none; box-shadow: none; } /* Theme Switcher */ /* Base on gnome-text-editor */ /* https://gitlab.gnome.org/GNOME/gnome-text-editor/-/blob/main/src/style.css#L20 */ .themeswitcher { margin: 9px; } .themeswitcher checkbutton { padding: 0; min-height: 44px; min-width: 44px; padding: 1px; background-clip: content-box; border-radius: 9999px; box-shadow: inset 0 0 0 1px @borders; } .themeswitcher checkbutton.system:checked, .themeswitcher checkbutton.light:checked, .themeswitcher checkbutton.dark:checked { box-shadow: inset 0 0 0 2px @theme_selected_bg_color; } .themeswitcher checkbutton.system { background-image: linear-gradient(to bottom right, #fff 49.99%, #202020 50.01%); } .themeswitcher checkbutton.light { background-color: #fff; } .themeswitcher checkbutton.dark { background-color: #202020; } .themeswitcher checkbutton radio { -gtk-icon-source: none; border: none; background: none; box-shadow: none; min-width: 12px; min-height: 12px; transform: translate(27px, 14px); padding: 2px; } .themeswitcher checkbutton.theme-selector radio:checked { -gtk-icon-source: -gtk-icontheme("object-select-symbolic"); background-color: @theme_selected_bg_color; color: @theme_selected_fg_color; } dialect-2.1.1/data/resources/theme-switcher.blp000066400000000000000000000020631432512702200214710ustar00rootroot00000000000000using Gtk 4.0; template DialectThemeSwitcher : Box { styles [ "themeswitcher", ] hexpand: true; Box box { hexpand: true; orientation: horizontal; spacing: 12; CheckButton system { styles [ "theme-selector", "system", ] visible: bind DialectThemeSwitcher.show-system; hexpand: true; halign: center; focus-on-click: false; tooltip-text: _("Follow system style"); notify::active => _on_color_scheme_changed(); } CheckButton light { styles [ "theme-selector", "light", ] hexpand: true; halign: center; group: system; focus-on-click: false; tooltip-text: _("Light style"); notify::active => _on_color_scheme_changed(); } CheckButton dark { styles [ "theme-selector", "dark", ] hexpand: true; halign: center; group: system; focus-on-click: false; tooltip-text: _("Dark style"); notify::active => _on_color_scheme_changed(); } } } dialect-2.1.1/data/resources/window.blp000066400000000000000000000401431432512702200200510ustar00rootroot00000000000000using Gtk 4.0; using Adw 1; menu app-menu { section { item { custom: "theme"; } } section { id: "preferences-section"; item { label: _("Show Pronunciation"); action: "app.pronunciation"; } } section { id: "help-section"; item { label: _("Preferences"); action: "app.preferences"; } item { label: _("Keyboard Shortcuts"); action: "win.show-help-overlay"; } item { label: _("About Dialect"); action: "app.about"; } } } template DialectWindow : Adw.ApplicationWindow { default-width: 800; default-height: 300; focus-widget: src_text; Stack main_stack { transition-type: crossfade; StackPage { name: "loading"; child: WindowHandle { Box { orientation: vertical; spacing: 12; margin-top: 12; margin-bottom: 12; margin-start: 12; margin-end: 12; halign: center; valign: center; Spinner { spinning: true; width-request: 32; height-request: 32; } Label { wrap: true; label: _("Loading…"); styles [ "title-1", ] } } }; } StackPage { name: "error"; child: WindowHandle { child: Box { orientation: vertical; Adw.HeaderBar { styles [ "flat", ] } Adw.StatusPage error_page { vexpand: true; child: Adw.Squeezer { homogeneous: false; Box { spacing: 12; halign: center; Button { label: _("Retry"); clicked => retry_load_translator(); styles [ "pill", "suggested-action", ] } Button { label: _("Open Preferences"); action-name: "app.preferences"; styles [ "pill", ] } } Box { spacing: 12; orientation: vertical; Button error_retry_btn { clicked => retry_load_translator(); styles [ "pill", "suggested-action", ] child: Label { label: _("Retry"); ellipsize: end; }; } Button error_preferences_btn { action-name: "app.preferences"; styles [ "pill", ] child: Label { label: _("Open Preferences"); ellipsize: end; }; } } }; } }; }; } StackPage { name: "api-key"; child: WindowHandle { child: Box { orientation: vertical; Adw.HeaderBar { styles [ "flat", ] } Adw.StatusPage key_page { icon-name: "dialog-password-symbolic"; vexpand: true; child: Adw.Squeezer { homogeneous: false; Box { spacing: 12; halign: center; Button rmv_key_btn { visible: false; label: _("Remove Key and Retry"); clicked => remove_key_and_reload(); styles [ "pill", "suggested-action", ] } Button { label: _("Open Preferences"); action-name: "app.preferences"; styles [ "pill", ] } } Box { spacing: 12; orientation: vertical; Button error_api_key_btn { visible: false; clicked => remove_key_and_reload(); styles [ "pill", "suggested-action", ] child: Label { label: _("Remove Key and Retry"); ellipsize: end; }; } Button error_preferences2_btn { action-name: "app.preferences"; styles [ "pill", ] child: Label { label: _("Open Preferences"); ellipsize: end; }; } } }; } }; }; } StackPage { name: "translate"; child: Adw.ToastOverlay toast_overlay { vexpand: true; child: Box { orientation: vertical; Adw.HeaderBar { centering-policy: strict; styles [ "flat" ] title-widget: Stack title_stack { transition-type: crossfade; StackPage { name: "selector"; child: Box langs_button_box { spacing: 6; MenuButton src_lang_btn { always-show-arrow: true; styles [ "raised", ] Label src_lang_label { ellipsize: end; xalign: 0; } } Button switch_btn { action-name: "win.switch"; tooltip-text: _("Switch languages"); icon-name: "object-flip-horizontal-symbolic"; } MenuButton dest_lang_btn { always-show-arrow: true; styles [ "raised", ] Label dest_lang_label { ellipsize: end; xalign: 0; } } }; } StackPage { name: "label"; child: Adw.WindowTitle { title: _("Dialect"); }; } }; Button return_btn { action-name: "win.back"; tooltip-text: _("Previous translation"); icon-name: "go-previous-symbolic"; } Button forward_btn { action-name: "win.forward"; tooltip-text: _("Next translation"); icon-name: "go-next-symbolic"; } [end] MenuButton menu_btn { menu-model: app-menu; icon-name: "open-menu-symbolic"; primary: true; } } Box { orientation: vertical; Box translator_box { vexpand: true; spacing: 12; homogeneous: true; styles [ "translation-box", ] Box { orientation: vertical; overflow: hidden; styles [ "card", "translation-side-box", ] ScrolledWindow { vexpand: true; TextView src_text { wrap-mode: word_char; left-margin: 9; right-margin: 9; top-margin: 9; bottom-margin: 9; EventControllerKey src_key_ctrlr {} } styles [ "translation-scrolled" ] } Revealer src_pron_revealer { transition-type: slide_down; reveal-child: false; ScrolledWindow { Label src_pron_label { xalign: 0; wrap: true; wrap-mode: word_char; selectable: true; valign: end; styles [ "pronunciation", "dim-label", ] } styles [ "translation-scrolled", "top-undershoot" ] } } Revealer mistakes { can-focus: false; reveal-child: false; Box { can-focus: false; orientation: horizontal; spacing: 8; Image { can-focus: false; icon-name: "error-correct-symbolic"; } Label mistakes_label { can-focus: false; wrap: true; wrap-mode: word_char; } styles [ "card", "mistakes" ] } } Box { Button clear_btn { action-name: "win.clear"; tooltip-text: _("Clear"); icon-name: "edit-clear-all-symbolic"; } Button paste_btn { action-name: "win.paste"; tooltip-text: _("Paste"); icon-name: "edit-paste-symbolic"; } Button src_voice_btn { action-name: "win.listen-src"; tooltip-text: _("Listen"); styles [ "flat", ] } Label char_counter { margin-start: 4; margin-end: 4; hexpand: true; halign: end; styles [ "dim-label", "caption-heading", ] } Button translate_btn { label: _("Translate"); action-name: "win.translation"; styles [ "suggested-action", ] } styles [ "toolbar", ] } } Box dest_box { orientation: vertical; overflow: hidden; styles [ "card", "translation-side-box", ] ScrolledWindow { vexpand: true; TextView dest_text { editable: false; wrap-mode: word_char; left-margin: 9; right-margin: 9; top-margin: 9; bottom-margin: 9; } styles [ "translation-scrolled" ] } Revealer dest_pron_revealer { transition-type: slide_down; reveal-child: false; ScrolledWindow { Label dest_pron_label { xalign: 0; wrap: true; wrap-mode: word_char; selectable: true; valign: end; styles [ "pronunciation", "dim-label", ] } styles [ "translation-scrolled", "top-undershoot" ] } } Stack dest_toolbar_stack { transition-type: crossfade; StackPage { name: "default"; child: Box { Spinner trans_spinner { tooltip-text: _("Translating…"); margin-start: 8; } Image trans_warning { tooltip-text: _("Could not translate the text"); margin-start: 8; icon-name: "dialog-warning-symbolic"; } Button copy_btn { action-name: "win.copy"; tooltip-text: _("Copy"); icon-name: "edit-copy-symbolic"; hexpand: true; halign: end; } Button edit_btn { action-name: "win.suggest"; tooltip-text: _("Suggest Translation"); icon-name: "document-edit-symbolic"; } Button dest_voice_btn { action-name: "win.listen-dest"; tooltip-text: _("Listen"); styles [ "flat", ] } styles [ "toolbar", ] }; } StackPage { name: "edit"; child: Box { Button cancel_btn { action-name: "win.suggest-cancel"; label: _("Cancel"); hexpand: true; halign: end; } Button save_btn { action-name: "win.suggest-ok"; label: _("Save"); styles [ "suggested-action", ] } styles [ "toolbar", ] }; } } } } ActionBar actionbar { sensitive: bind langs_button_box.sensitive no-sync-create; revealed: false; styles [ "flat", ] MenuButton src_lang_btn2 { sensitive: bind src_lang_btn.sensitive no-sync-create; focus-on-click: false; always-show-arrow: true; styles [ "raised", ] Label { label: bind src_lang_label.label no-sync-create; ellipsize: end; xalign: 0; } } [center] Button switch_btn2 { sensitive: bind switch_btn.sensitive no-sync-create; tooltip-text: _("Switch languages"); action-name: "win.switch"; icon-name: "object-flip-horizontal-symbolic"; } [end] MenuButton dest_lang_btn2 { sensitive: bind dest_lang_btn.sensitive no-sync-create; focus-on-click: false; always-show-arrow: true; styles [ "raised", ] Label { label: bind dest_lang_label.label no-sync-create; ellipsize: end; xalign: 0; } } } } }; }; } } EventControllerKey win_key_ctrlr {} } Gtk.SizeGroup { mode: both; widgets [src_lang_label, dest_lang_label] } Gtk.SizeGroup { widgets [error_retry_btn, error_preferences_btn] } Gtk.SizeGroup { widgets [error_api_key_btn, error_preferences2_btn] } dialect-2.1.1/dialect.doap000066400000000000000000000026431432512702200153750ustar00rootroot00000000000000 Dialect Translate between languages Python Mufeed Ali fushinari Rafael Mardojai CM rafaelmardojai dialect-2.1.1/dialect/000077500000000000000000000000001432512702200145235ustar00rootroot00000000000000dialect-2.1.1/dialect/__init__.py000066400000000000000000000000001432512702200166220ustar00rootroot00000000000000dialect-2.1.1/dialect/define.in000066400000000000000000000004571432512702200163130ustar00rootroot00000000000000# Copyright 2020 gi-lom # Copyright 2020-2022 Mufeed Ali # Copyright 2020-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later APP_ID = '@APP_ID@' PROFILE = '@PROFILE@' RES_PATH = '/app/drey/Dialect' VERSION = '@VERSION@' TRANS_NUMBER = 10 # number of translations to save in history dialect-2.1.1/dialect/dialect.in000077500000000000000000000020321432512702200164600ustar00rootroot00000000000000#!@PYTHON@ # Copyright 2020 gi-lom # Copyright 2020 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import os import sys import signal import locale import gettext pkgdatadir = '@pkgdatadir@' localedir = '@localedir@' builddir = os.environ.get('MESON_BUILD_ROOT') if builddir: sys.dont_write_bytecode = True sys.path.insert(1, os.environ['MESON_SOURCE_ROOT']) data_dir = os.path.join(builddir, '@prefix@', '@datadir@') os.putenv('XDG_DATA_DIRS', '%s:%s' % (data_dir, os.getenv('XDG_DATA_DIRS', '/usr/local/share/:/usr/share/'))) sys.path.insert(1, pkgdatadir) signal.signal(signal.SIGINT, signal.SIG_DFL) gettext.install('dialect', localedir) locale.bindtextdomain('dialect', localedir) locale.textdomain('dialect') gettext.bindtextdomain('dialect', localedir) gettext.textdomain('dialect') if __name__ == '__main__': from gi.repository import Gio resource = Gio.Resource.load(os.path.join(pkgdatadir, 'dialect.gresource')) resource._register() from dialect import main sys.exit(main.main()) dialect-2.1.1/dialect/lang_selector.py000066400000000000000000000122571432512702200177250ustar00rootroot00000000000000# Copyright 2020-2022 Mufeed Ali # Copyright 2020-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import re from gi.repository import Gio, Gdk, GObject, Gtk from dialect.define import RES_PATH from dialect.translators import get_lang_name @Gtk.Template(resource_path=f'{RES_PATH}/lang-selector.ui') class DialectLangSelector(Gtk.Popover): __gtype_name__ = 'DialectLangSelector' __gsignals__ = { 'user-selection-changed': (GObject.SIGNAL_RUN_LAST, GObject.TYPE_NONE, ()) } # Get widgets search = Gtk.Template.Child() scroll = Gtk.Template.Child() revealer = Gtk.Template.Child() recent_list = Gtk.Template.Child() separator = Gtk.Template.Child() lang_list = Gtk.Template.Child() # Propeties selected = GObject.Property(type=str) # Key of the selected lang def __init__(self, **kwargs): super().__init__(**kwargs) # Connect popover open/close signal self.connect('show', self._show) self.connect('closed', self._closed) # Connect list signals self.recent_list.connect('row-activated', self._activated) self.lang_list.connect('row-activated', self._activated) # Setup search entry self.search.set_key_capture_widget(self) key_events = Gtk.EventControllerKey.new() key_events.connect('key-pressed', self._on_key_pressed) self.search.add_controller(key_events) # Connect search entry signals self.search.connect('changed', self._on_search) self.search.connect('activate', self._on_search_activate) self.recent_model = Gio.ListStore.new(LangObject) self.recent_list.bind_model(self.recent_model, self._create_lang_row) self.lang_model = Gio.ListStore.new(LangObject) self.filter = Gtk.CustomFilter() self.filter.set_filter_func(self._filter_func) fitler_model = Gtk.FilterListModel.new(self.lang_model, self.filter) self.lang_list.bind_model(fitler_model, self._create_lang_row) def get_selected(self): return self.get_property('selected') def set_selected(self, lang_code, notify=True): self.set_property('selected', lang_code) if notify: self.emit('user-selection-changed') def set_languages(self, languages): # Clear list self.lang_model.remove_all() # Load langs list for code in languages: self.lang_model.append(LangObject(code, get_lang_name(code))) def insert_recent(self, code, name): row_selected = (code == self.selected) self.recent_model.append(LangObject(code, name, row_selected)) def clear_recent(self): self.recent_model.remove_all() def refresh_selected(self): for item in self.lang_model: item.set_property('selected', (item.code == self.selected)) def _activated(self, _list, row): # Close popover self.popdown() # Set selected property self.set_selected(row.lang.code) def _show(self, _popover): self.search.grab_focus() def _closed(self, _popover): # Reset scroll vscroll = self.scroll.get_vadjustment() vscroll.set_value(0) # Clear search self.search.set_text('') def _create_lang_row(self, lang): return DialectLangRow(lang) def _filter_func(self, item): search = self.search.get_text() return bool(re.search(search, item.name, re.IGNORECASE)) def _on_search(self, _entry): search = self.search.get_text() if search != '': self.revealer.set_reveal_child(False) else: self.revealer.set_reveal_child(True) self.filter.emit('changed', Gtk.FilterChange.DIFFERENT) def _on_search_activate(self, _entry): if self.search.get_text(): row = self.lang_list.get_row_at_index(0) if row: self.lang_list.emit('row-activated', row) return Gdk.EVENT_PROPAGATE def _on_key_pressed(self, _controller, keyval, _keycode, _mod): # Close popover if ESQ key is pressed in search entry if keyval == Gdk.KEY_Escape: self.popdown() # Prevent search entry unfocusing when down key is pressed elif keyval == Gdk.KEY_Down: return Gdk.EVENT_STOP class LangObject(GObject.Object): __gtype_name__ = 'LangObject' code = GObject.Property(type=str) name = GObject.Property(type=str) selected = GObject.Property(type=bool, default=False) def __init__(self, code, name, selected=False): super().__init__() self.set_property('code', code) self.set_property('name', name) self.set_property('selected', selected) @Gtk.Template(resource_path=f'{RES_PATH}/lang-row.ui') class DialectLangRow(Gtk.ListBoxRow): __gtype_name__ = 'DialectLangRow' # Widgets name = Gtk.Template.Child() selection = Gtk.Template.Child() def __init__(self, lang): super().__init__() self.lang = lang self.name.set_label(self.lang.name) self.lang.bind_property( 'selected', self.selection, 'visible', GObject.BindingFlags.SYNC_CREATE ) dialect-2.1.1/dialect/main.py000077500000000000000000000131261432512702200160270ustar00rootroot00000000000000# Copyright 2020 gi-lom # Copyright 2020-2022 Mufeed Ali # Copyright 2020-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later # Initial setup import sys from gettext import gettext as _ import gi gi.require_version('Gdk', '4.0') gi.require_version('Gtk', '4.0') gi.require_version('Gst', '1.0') gi.require_version('Adw', '1') gi.require_version('Soup', '3.0') from gi.repository import Adw, Gio, GLib, Gst, Gtk from dialect.define import APP_ID, RES_PATH, VERSION from dialect.preferences import DialectPreferencesWindow from dialect.settings import Settings from dialect.window import DialectWindow class Dialect(Adw.Application): def __init__(self): Adw.Application.__init__( self, application_id=APP_ID, flags=Gio.ApplicationFlags.HANDLES_COMMAND_LINE ) self.set_resource_base_path(RES_PATH) # App window self.window = None self.launch_text = '' self.launch_langs = {} # Add command line options self.add_main_option('text', b't', GLib.OptionFlags.NONE, GLib.OptionArg.STRING, 'Text to translate', None) self.add_main_option('src', b's', GLib.OptionFlags.NONE, GLib.OptionArg.STRING, 'Source lang code', None) self.add_main_option('dest', b'd', GLib.OptionFlags.NONE, GLib.OptionArg.STRING, 'Destination lang code', None) self.setup_actions() def do_activate(self): self.window = self.props.active_window if not self.window: width, height = Settings.get().window_size self.window = DialectWindow( application=self, # Translators: Do not translate the app name! title=_('Dialect'), default_height=height, default_width=width, text=self.launch_text, langs=self.launch_langs ) self.window.present() def do_command_line(self, command_line): options = command_line.get_options_dict() options = options.end().unpack() text = '' langs = { 'src': None, 'dest': None } if 'text' in options: text = options['text'] if 'src' in options: langs['src'] = options['src'] if 'dest' in options: langs['dest'] = options['dest'] if self.window is not None: self.window.translate(text, langs['src'], langs['dest']) else: self.launch_text = text self.launch_langs = langs self.activate() return 0 def do_startup(self): Adw.Application.do_startup(self) Gst.init(None) # Init Gst def setup_actions(self): """ Setup menu actions """ pronunciation = Gio.SimpleAction.new_stateful( 'pronunciation', None, Settings.get().show_pronunciation_value ) pronunciation.connect('change-state', self._on_pronunciation) self.add_action(pronunciation) preferences = Gio.SimpleAction.new('preferences', None) preferences.connect('activate', self._on_preferences) self.add_action(preferences) about = Gio.SimpleAction.new('about', None) about.connect('activate', self._on_about) self.add_action(about) quit_action = Gio.SimpleAction.new('quit', None) quit_action.connect('activate', self._on_quit) self.add_action(quit_action) self.set_accels_for_action('app.pronunciation', ['P']) self.set_accels_for_action('app.preferences', ['comma']) self.set_accels_for_action('app.quit', ['Q']) self.set_accels_for_action('win.back', ['Left']) self.set_accels_for_action('win.forward', ['Right']) self.set_accels_for_action('win.switch', ['S']) self.set_accels_for_action('win.clear', ['D']) self.set_accels_for_action('win.paste', ['V']) self.set_accels_for_action('win.copy', ['C']) self.set_accels_for_action('win.listen-dest', ['L']) self.set_accels_for_action('win.listen-src', ['L']) self.set_accels_for_action('win.show-help-overlay', ['question']) def _on_pronunciation(self, action, value): """ Update show pronunciation setting """ action.set_state(value) Settings.get().show_pronunciation = value # Update UI if self.window.trans_src_pron is not None: self.window.src_pron_revealer.set_reveal_child(value) if self.window.trans_dest_pron is not None: self.window.dest_pron_revealer.set_reveal_child(value) def _on_preferences(self, _action, _param): """ Show preferences window """ window = DialectPreferencesWindow(self.window) window.set_transient_for(self.window) window.present() def _on_about(self, _action, _param): """ Show about dialog """ builder = Gtk.Builder.new_from_resource(f'{RES_PATH}/about.ui') about = builder.get_object('about') about.set_application_icon(APP_ID) about.set_version(VERSION) about.set_developers( [ "Mufeed Ali", "Rafael Mardojai CM http://rafaelmardojai.com" ] ) about.set_transient_for(self.window) about.present() def _on_quit(self, _action, _param): self.quit() def main(): # Run the Application app = Dialect() return app.run(sys.argv) dialect-2.1.1/dialect/meson.build000066400000000000000000000016051432512702200166670ustar00rootroot00000000000000python = import('python') # Generate dialect bin configure_file( input: 'dialect.in', output: 'dialect', configuration: conf, install: true, install_dir: get_option('bindir') ) # Generate dialect define module configure_file( input: 'define.in', output: 'define.py', configuration: conf, install: true, install_dir: moduledir ) launcher = join_paths(meson.project_build_root(), 'dialect', meson.project_name()) run_target('run', command: [launcher] ) subdir('search_provider') # Python sources sources = [ '__init__.py', 'main.py', 'window.py', 'preferences.py', 'lang_selector.py', 'session.py', 'settings.py', 'shortcuts.py', 'theme_switcher.py', ] # Install sources install_data(sources, install_dir: moduledir) # Install translators and tts providers install_subdir('translators', install_dir: moduledir) install_subdir('tts', install_dir: moduledir) dialect-2.1.1/dialect/preferences.py000066400000000000000000000320221432512702200173750ustar00rootroot00000000000000# Copyright 2020-2022 Mufeed Ali # Copyright 2020-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import logging import os import re import threading from gettext import gettext as _ from gi.repository import Adw, Gio, GObject, Gtk, Soup from dialect.define import RES_PATH from dialect.session import Session from dialect.settings import Settings from dialect.translators import TRANSLATORS from dialect.tts import TTS @Gtk.Template(resource_path=f'{RES_PATH}/preferences.ui') class DialectPreferencesWindow(Adw.PreferencesWindow): __gtype_name__ = 'DialectPreferencesWindow' parent = NotImplemented # Get preferences widgets live_translation = Gtk.Template.Child() sp_translation = Gtk.Template.Child() translate_accel = Gtk.Template.Child() src_auto = Gtk.Template.Child() backend = Gtk.Template.Child() instance_entry = Gtk.Template.Child() instance_stack = Gtk.Template.Child() instance_reset = Gtk.Template.Child() instance_spinner = Gtk.Template.Child() api_key_entry = Gtk.Template.Child() api_key_stack = Gtk.Template.Child() api_key_reset = Gtk.Template.Child() api_key_spinner = Gtk.Template.Child() tts = Gtk.Template.Child() tts_row = Gtk.Template.Child() search_provider = Gtk.Template.Child() def __init__(self, parent, **kwargs): super().__init__(**kwargs) self.parent = parent self.setup() def setup(self): # Disable search, we have few preferences self.set_search_enabled(False) # Setup backends combo row self.backend_model = Gio.ListStore.new(BackendObject) backend_options = [ BackendObject(translator.name, translator.prettyname) for translator in TRANSLATORS.values() ] selected_backend_index = 0 for index, value in enumerate(backend_options): self.backend_model.insert(index, value) if value.name == Settings.get().active_translator: selected_backend_index = index self.backend.set_model(self.backend_model) # Bind preferences with GSettings Settings.get().bind('live-translation', self.live_translation, 'enable-expansion', Gio.SettingsBindFlags.DEFAULT) Settings.get().bind('sp-translation', self.sp_translation, 'active', Gio.SettingsBindFlags.DEFAULT) Settings.get().bind('translate-accel', self.translate_accel, 'selected', Gio.SettingsBindFlags.DEFAULT) Settings.get().bind('src-auto', self.src_auto, 'active', Gio.SettingsBindFlags.DEFAULT) # Setup TTS self.tts_row.set_visible(len(TTS) >= 1) self.tts.set_active(Settings.get().active_tts != '') # Set translate accel sensitivity by live translation state self.translate_accel.set_sensitive(not self.live_translation.get_enable_expansion()) self.live_translation.connect('notify::enable-expansion', self._toggle_accel_pref) # Switch backends self.backend.set_selected(selected_backend_index) self.backend.connect('notify::selected', self._switch_backends) self.parent.connect('notify::backend-loading', self._on_backend_loading) # Toggle TTS self.tts.connect('notify::active', self._toggle_tts) # Connect to settings changes Settings.get().connect('changed', self._on_settings_changed) # Instance self.instance_entry.connect('apply', self._on_instance_apply) self.instance_entry.connect('changed', self._on_instance_changed) self.instance_reset.connect('clicked', self._on_reset_instance) # API Key self.api_key_entry.connect('apply', self._on_api_key_apply) self.api_key_reset.connect('clicked', self._on_reset_api_key) self.__check_instance_or_api_key_support() # Search Provider if os.getenv('XDG_CURRENT_DESKTOP') != 'GNOME': self.search_provider.hide() def _unbind_settings(self, *args, **kwargs): Settings.get().unbind(self.live_translation, 'active') Settings.get().unbind(self.src_auto, 'active') def _on_settings_changed(self, _settings, key): backend = Settings.get().active_translator if key in ('translator-instance-url', 'translator-api-key'): # Update backend if key == 'translator-instance-url' and TRANSLATORS[backend].supported_features['change-instance']: Settings.get().reset_src_langs() Settings.get().reset_dest_langs() self.parent.reload_backends() def _toggle_accel_pref(self, row, _active): self.translate_accel.set_sensitive(not row.get_enable_expansion()) def _toggle_tts(self, switch, _active): value = '' if switch.get_active() and len(TTS) >= 1: tts = list(TTS.keys()) value = str(tts[0]) self.parent.src_voice_btn.set_sensitive(False) self.parent.src_voice_btn.set_visible(switch.get_active()) self.parent.dest_voice_btn.set_sensitive(False) self.parent.dest_voice_btn.set_visible(switch.get_active()) Settings.get().active_tts = value if switch.get_active(): threading.Thread( target=self.parent.load_lang_speech, daemon=True ).start() def _switch_backends(self, row, _value): self.parent.save_settings() backend = self.backend_model[row.get_selected()].name Settings.get().active_translator = backend self.__check_instance_or_api_key_support() self.parent.reload_backends() def _on_backend_loading(self, window, _value): self.backend.set_sensitive(not window.get_property('backend-loading')) self.instance_entry.set_sensitive(not window.get_property('backend-loading')) self.api_key_entry.set_sensitive(not window.get_property('backend-loading')) if not window.get_property('backend-loading'): self.instance_stack.set_visible_child_name('reset') self.instance_spinner.stop() self.api_key_stack.set_visible_child_name('reset') self.api_key_spinner.stop() # Show or hide api key entry if window.translator: if window.translator.supported_features['api-key-supported']: self.api_key_entry.set_visible(True) self.api_key_entry.set_text(Settings.get().api_key) else: self.api_key_entry.set_visible(False) def _on_instance_apply(self, _row): def on_validation_response(session, result): valid = False backend = Settings.get().active_translator try: data = Session.get_response(session, result) valid = TRANSLATORS[backend].validate_instance(data) except Exception as exc: logging.error(exc) if valid: Settings.get().instance_url = self.new_instance_url self.instance_entry.remove_css_class('error') self.instance_entry.set_text(Settings.get().instance_url) else: self.instance_entry.add_css_class('error') error_text = _('Not a valid {backend} instance') error_text = error_text.format(backend=TRANSLATORS[backend].prettyname) toast = Adw.Toast.new(error_text) self.add_toast(toast) self.api_key_entry.set_visible(False) self.api_key_entry.set_text('') self.backend.set_sensitive(True) self.instance_entry.set_sensitive(True) self.api_key_entry.set_sensitive(True) self.instance_stack.set_visible_child_name('reset') self.instance_spinner.stop() old_value = Settings.get().instance_url new_value = self.instance_entry.get_text() url = re.compile(r'https?://(www\.)?') self.new_instance_url = url.sub('', new_value).strip().strip('/') # Validate if self.new_instance_url != old_value: # Progress feedback self.backend.set_sensitive(False) self.instance_entry.set_sensitive(False) self.api_key_entry.set_sensitive(False) self.instance_stack.set_visible_child_name('spinner') self.instance_spinner.start() backend = Settings.get().active_translator validation_url = TRANSLATORS[backend].format_url( self.new_instance_url, TRANSLATORS[backend].validation_path ) validation_message = Soup.Message.new('GET', validation_url) Session.get().send_and_read_async(validation_message, 0, None, on_validation_response) else: self.instance_entry.remove_css_class('error') def _on_instance_changed(self, _entry): if self.instance_entry.props.text == Settings.get().instance_url: self.instance_entry.props.show_apply_button = False elif not self.instance_entry.props.show_apply_button: self.instance_entry.props.show_apply_button = True def _on_reset_instance(self, _button): backend = Settings.get().active_translator if Settings.get().instance_url != TRANSLATORS[backend].instance_url: Settings.get().reset_instance_url() Settings.get().reset_api_key() self.instance_stack.set_visible_child_name('spinner') self.instance_spinner.start() self.instance_entry.remove_css_class('error') self.instance_entry.set_text(Settings.get().instance_url) def _on_api_key_apply(self, _row): def on_response(session, result): valid = False try: data = Session.get_response(session, result) self.parent.translator.get_translation(data) valid = True except Exception as exc: logging.warning(exc) if valid: Settings.get().api_key = self.new_api_key self.api_key_entry.remove_css_class('error') self.api_key_entry.set_text(Settings.get().instance_url) else: self.api_key_entry.add_css_class('error') error_text = _('Not a valid {backend} API key') error_text = error_text.format(backend=TRANSLATORS[backend].prettyname) toast = Adw.Toast.new(error_text) self.add_toast(toast) self.api_key_entry.grab_focus() self.backend.set_sensitive(True) self.instance_entry.set_sensitive(True) self.api_key_entry.set_sensitive(True) self.api_key_stack.set_visible_child_name('reset') self.api_key_spinner.stop() old_value = Settings.get().api_key self.new_api_key = self.api_key_entry.get_text() if self.new_api_key != old_value: # Progress feedback self.backend.set_sensitive(False) self.instance_entry.set_sensitive(False) self.api_key_entry.set_sensitive(False) self.api_key_stack.set_visible_child_name('spinner') self.api_key_spinner.start() backend = Settings.get().active_translator validation_url = TRANSLATORS[backend].format_url( Settings.get().instance_url, TRANSLATORS[backend].api_test_path ) (data, headers) = TRANSLATORS[backend].format_api_key_test(self.new_api_key) message = Session.create_message('POST', validation_url, data, headers) Session.get().send_and_read_async(message, 0, None, on_response) else: self.api_key_entry.remove_css_class('error') def _on_reset_api_key(self, _button): backend = Settings.get().active_translator if Settings.get().api_key != TRANSLATORS[backend].api_key: Settings.get().reset_api_key() self.api_key_stack.set_visible_child_name('spinner') self.api_key_spinner.start() self.api_key_entry.remove_css_class('error') self.api_key_entry.set_text(Settings.get().api_key) def __check_instance_or_api_key_support(self): backend = Settings.get().active_translator if TRANSLATORS[backend].supported_features['change-instance']: self.instance_entry.set_visible(True) self.instance_entry.set_text(Settings.get().instance_url) else: self.instance_entry.set_visible(False) if TRANSLATORS[backend].supported_features['api-key-supported']: self.api_key_entry.set_visible(True) self.api_key_entry.set_text(Settings.get().api_key) else: self.api_key_entry.set_visible(False) class BackendObject(GObject.Object): __gtype_name__ = 'BackendObject' name = GObject.Property(type=str) prettyname = GObject.Property(type=str) def __init__(self, name, prettyname): super().__init__() self.set_property('name', name) self.set_property('prettyname', prettyname) dialect-2.1.1/dialect/search_provider/000077500000000000000000000000001432512702200177025ustar00rootroot00000000000000dialect-2.1.1/dialect/search_provider/app.drey.Dialect.SearchProvider.ini000066400000000000000000000001661432512702200264130ustar00rootroot00000000000000[Shell Search Provider] DesktopId=@APP_ID@.desktop BusName=@APP_ID@.SearchProvider ObjectPath=@object_path@ Version=2 dialect-2.1.1/dialect/search_provider/app.drey.Dialect.SearchProvider.service.in000066400000000000000000000001171432512702200276750ustar00rootroot00000000000000[D-BUS Service] Name=@APP_ID@.SearchProvider Exec=@pkgdatadir@/search_provider dialect-2.1.1/dialect/search_provider/meson.build000066400000000000000000000013041432512702200220420ustar00rootroot00000000000000search_provider_dir = join_paths(get_option('prefix'), get_option('datadir'), 'gnome-shell', 'search-providers') service_dir = join_paths(get_option('prefix'), get_option('datadir'), 'dbus-1', 'services') configure_file( input: 'app.drey.Dialect.SearchProvider.ini', output: '@0@.SearchProvider.ini'.format(application_id), configuration: conf, install_dir: search_provider_dir, ) configure_file( input: 'app.drey.Dialect.SearchProvider.service.in', output: '@0@.SearchProvider.service'.format(application_id), configuration: conf, install_dir: service_dir, ) configure_file( input: 'search_provider.in', output: 'search_provider', configuration: conf, install_dir: pkgdatadir, ) dialect-2.1.1/dialect/search_provider/search_provider.in000077500000000000000000000164741432512702200234300ustar00rootroot00000000000000#!@PYTHON@ # Copyright 2020 gi-lom # Copyright 2020 Nikita Kravets # Copyright 2020-2022 Rafael Mardojai CM # Copyright 2021-2022 Mufeed Ali # SPDX-License-Identifier: GPL-3.0-or-later import logging import gettext import dbus import dbus.service from dbus.mainloop.glib import DBusGMainLoop import gi gi.require_version('Soup', '3.0') from gi.repository import GLib from dialect.session import Session from dialect.settings import Settings from dialect.translators import get_lang_name, TRANSLATORS from dialect.translators.basetrans import ApiKeyRequired, InvalidApiKey SEARCH_BUS_NAME = 'org.gnome.Shell.SearchProvider2' SBN = dict(dbus_interface=SEARCH_BUS_NAME) CLIPBOARD_PREFIX = 'copy-to-clipboard' ERROR_PREFIX = 'translation-error' gettext.install('dialect', '@localedir@') _ = gettext.gettext class TranslateService(dbus.service.Object): bus_name = '@APP_ID@.SearchProvider' _object_path = '@object_path@' def __init__(self): # init dbus self.session_bus = dbus.SessionBus() bus_name = dbus.service.BusName(self.bus_name, bus=self.session_bus) dbus.service.Object.__init__(self, bus_name, self._object_path) self.loaded = False # Live translation enabled self.live_enabled = self.is_live_enabled() # Translations store self.translations = {} self.src_language = 'auto' # src_language_saved = Settings.get().src_langs[0] self.dest_language = Settings.get().dest_langs[0] # Translator self.translator = self._get_translator() Settings.get().connect('changed', self._on_settings_changed) @dbus.service.method(in_signature='as', out_signature='as', **SBN) def GetInitialResultSet(self, terms): """ Join separate terms in one ID line, start translation and send this line back on start of input """ text = ' '.join(terms) backend = Settings.get().active_translator if self.live_enabled: if not self.loaded: return self.GetInitialResultSet(terms) translation_id = self.translation(text) results = [translation_id] if not translation_id.startswith(ERROR_PREFIX): results.append(CLIPBOARD_PREFIX + text) return results return [ _('Translate “{text}” with {backend_name}').format( text=text, backend_name=TRANSLATORS[backend].prettyname ) ] @dbus.service.method(in_signature='asas', out_signature='as', **SBN) def GetSubsearchResultSet(self, _previous_results, new_terms): return self.GetInitialResultSet(new_terms) @dbus.service.method(in_signature='as', out_signature='aa{sv}', **SBN) def GetResultMetas(self, ids): """Send translated text""" translate_id = ids[0] if len(ids) == 1: text = translate_id if translate_id in self.translations: text = self.translations[translate_id] return [{ 'id': translate_id, 'name': text, }] elif ( len(ids) == 2 and translate_id in self.translations and ids[1] == CLIPBOARD_PREFIX + ids[0] ): text = self.translations[translate_id] lang = get_lang_name(self.dest_language) backend = Settings.get().active_translator description = f'{lang} — {TRANSLATORS[backend].prettyname}' if self.live_enabled else '' self.translations.clear() return [ { 'id': translate_id, 'name': text, 'description': description, }, { 'id': ids[1], 'name': _('Copy'), 'description': _('Copy translation to clipboard'), 'clipboardText': text } ] else: # Probably never needed, just in case return [ dict( id=id, name=id, ) for id in ids ] @dbus.service.method(in_signature='sasu', **SBN) def ActivateResult(self, result_id, terms, timestamp): if not result_id.startswith(CLIPBOARD_PREFIX): self.LaunchSearch(terms, timestamp) @dbus.service.method(in_signature='asu', terms='as', timestamp='u', **SBN) def LaunchSearch(self, terms, _timestamp): text = ' '.join(terms) GLib.spawn_async_with_pipes( None, ['@BIN@', '--text', text], None, GLib.SpawnFlags.SEARCH_PATH, None ) def translation(self, src_text=None): """Start a new translation""" # If the two languages are the same, nothing is done if self.src_language != self.dest_language and src_text != '': error_id = ERROR_PREFIX + src_text # Format data url = self.translator.translate_url.format( text=src_text, src=self.src_language, dest=self.dest_language ) (method, data, headers, raw) = self.translator.format_translation( src_text, self.src_language, self.dest_language ) message = Session.create_message(method, url, data, headers, raw) response = Session.get().send_and_read(message, None) if response: try: data = Session.read_response(response, fail_if_empty=True, raw=raw) (translation, _lang) = self.translator.get_translation(data) self.translations[src_text] = translation.text return src_text except InvalidApiKey as exc: logging.error(exc) self.translations[error_id] = _('The provided API key is invalid') except ApiKeyRequired as exc: logging.error(exc) self.translations[error_id] = _('API key is required to use the service') except Exception as exc: logging.error(exc) else: self.translations[error_id] = _('Translation failed, check for network issues') return error_id def is_live_enabled(self): return Settings.get().live_translation and Settings.get().sp_translation def _get_translator(self): backend = Settings.get().active_translator translator = TRANSLATORS[backend]( callback=self._on_loaded, base_url=Settings.get().instance_url, api_key=Settings.get().api_key ) if not TRANSLATORS[backend].supported_features['change-instance']: self.loaded = True return translator def _on_loaded(self, success, _error='', _network_error=False): self.loaded = success def _on_settings_changed(self, _settings, key): if key.startswith('translator-'): self.loaded = False self.translator = self._get_translator() self.dest_language = Settings.get().dest_langs[0] if key == 'live-translation' or key == 'sp-translation': self.live_enabled = self.is_live_enabled() if __name__ == "__main__": DBusGMainLoop(set_as_default=True) TranslateService() GLib.MainLoop().run() dialect-2.1.1/dialect/session.py000066400000000000000000000070661432512702200165710ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import json import logging from gi.repository import GLib, Soup class Session(Soup.Session): """ Dialect soup session handler """ instance = None def __init__(self): Soup.Session.__init__(self) @staticmethod def new(): """Create a new instance of Session.""" s_session = Soup.Session() s_session.__class__ = Session return s_session @staticmethod def get(): """Return an active instance of Session.""" if Session.instance is None: Session.instance = Session.new() return Session.instance @staticmethod def get_response(session, result, fail_if_empty=True, raw=False): try: response = session.send_and_read_finish(result) data = Session.read_response(response, fail_if_empty, raw) return data except GLib.GError as exc: raise ResponseError(exc.message) from exc @staticmethod def read_response(response, fail_if_empty=True, raw=False): if raw: return response.get_data() data = {} try: data = json.loads( response.get_data() ) if response else {} except Exception as exc: logging.warning(exc) if not data and fail_if_empty: raise ResponseEmpty() return data @staticmethod def encode_data(data): data_glib_bytes = None try: data_bytes = json.dumps(data).encode('utf-8') data_glib_bytes = GLib.Bytes.new(data_bytes) except Exception as exc: logging.warning(exc) return data_glib_bytes @staticmethod def create_message(method, url, data={}, headers={}, form=False): if form and data: form_data = Soup.form_encode_hash(data) message = Soup.Message.new_from_encoded_form(method, url, form_data) else: message = Soup.Message.new(method, url) if data and not form: data = Session.encode_data(data) message.set_request_body_from_bytes('application/json', data) if headers: for name, value in headers.items(): message.get_request_headers().append(name, value) if 'User-Agent' not in headers: message.get_request_headers().append('User-Agent', 'Dialect App') return message def multiple(self, messages, callback=None): """Keep track of multiple async operations.""" def on_task_response(session, result, message_callback): messages.pop() message_callback(session, result) # If all tasks are done, run main callback if callback is not None and len(messages) == 0: callback() for msg in messages: # msg[0]: Soup.Message # msg[1]: message callback self.send_and_read_async(msg[0], 0, None, on_task_response, msg[1]) class ResponseError(Exception): """Exception raised when response fails.""" def __init__(self, cause, message='Response has failed'): self.cause = cause self.message = message super().__init__(self.message) def __str__(self): return f'{self.message}: {self.cause}' class ResponseEmpty(Exception): """Exception raised when response is empty.""" def __init__(self, message='Response is empty'): self.message = message super().__init__(self.message) dialect-2.1.1/dialect/settings.py000066400000000000000000000156061432512702200167450ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later from gi.repository import Gio, GLib from dialect.define import APP_ID from dialect.translators import ( check_backend_availability, get_fallback_backend_name, TRANSLATORS ) from dialect.tts import TTS class Settings(Gio.Settings): """ Dialect settings handler """ instance = None translator = None def __init__(self): Gio.Settings.__init__(self) @staticmethod def new(): """Create a new instance of Settings.""" g_settings = Gio.Settings.new(APP_ID) g_settings.__class__ = Settings g_settings.init_translators_settings() return g_settings @staticmethod def get(): """Return an active instance of Settings.""" if Settings.instance is None: Settings.instance = Settings.new() return Settings.instance def init_translators_settings(self): """Intialize translators settings with its default values.""" self.translators_list = list(TRANSLATORS.keys()) for name, instance in TRANSLATORS.items(): settings = self.get_translator_settings(name) if not settings.get_boolean('init'): settings.set_strv('src-langs', instance.src_langs) settings.set_strv('dest-langs', instance.dest_langs) settings.set_string('instance-url', instance.instance_url) settings.set_string('api-key', instance.api_key) settings.set_boolean('init', True) @property def translators_list(self): return self.get_child('translators').get_strv('list') @translators_list.setter def translators_list(self, translators): self.get_child('translators').set_strv('list', translators) @property def active_translator(self): value = self.get_child('translators').get_string('active') if check_backend_availability(value): return value self.active_translator = get_fallback_backend_name() return get_fallback_backend_name() @active_translator.setter def active_translator(self, translator): self.get_child('translators').set_string('active', translator) self.translator = None def get_translator_settings(self, translator=None): def on_changed(_settings, key): self.emit('changed', 'translator-' + key) def get_settings(name): path = self.get_child('translators').get_property('path') if not path.endswith('/'): path += '/' path += name + '/' settings = Gio.Settings(APP_ID + '.translator', path) settings.connect('changed', on_changed) return settings if translator is not None: translator = get_settings(translator) return translator if self.translator is None: self.translator = get_settings(self.active_translator) self.translator.delay() return self.translator def save_translator_settings(self): if self.translator is not None: self.translator.apply() @property def src_langs(self): return self.get_translator_settings().get_strv('src-langs') @src_langs.setter def src_langs(self, src_langs): self.get_translator_settings().set_strv('src-langs', src_langs) def reset_src_langs(self): self.src_langs = TRANSLATORS[self.active_translator].src_langs @property def dest_langs(self): return self.get_translator_settings().get_strv('dest-langs') @dest_langs.setter def dest_langs(self, dest_langs): self.get_translator_settings().set_strv('dest-langs', dest_langs) def reset_dest_langs(self): self.dest_langs = TRANSLATORS[self.active_translator].dest_langs @property def instance_url(self): return self.get_translator_settings().get_string('instance-url') @instance_url.setter def instance_url(self, url): self.get_translator_settings().set_string('instance-url', url) self.save_translator_settings() def reset_instance_url(self): self.instance_url = TRANSLATORS[self.active_translator].instance_url @property def api_key(self): return self.get_translator_settings().get_string('api-key') @api_key.setter def api_key(self, api_key): self.get_translator_settings().set_string('api-key', api_key) self.save_translator_settings() def reset_api_key(self): self.api_key = TRANSLATORS[self.active_translator].api_key @property def window_size(self): value = self.get_value('window-size') return (value[0], value[1]) @window_size.setter def window_size(self, size): width, height = size self.set_value('window-size', GLib.Variant('ai', [width, height])) @property def translate_accel(self): """Return the user's preferred translation shortcut.""" value = self.translate_accel_value if value == 0: return 'Return' if value == 1: return 'Return' return 'Return' @property def translate_accel_value(self): """Return the user's preferred translation shortcut value.""" return self.get_int('translate-accel') @property def active_tts(self): """Return the user's preferred TTS service.""" value = self.get_child('tts').get_string('active') if value != '' and value not in TTS.keys(): value = '' self.active_tts = value return value @active_tts.setter def active_tts(self, tts): """Set the user's preferred TTS service.""" self.get_child('tts').set_string('active', tts) @property def color_scheme(self): return self.get_string('color-scheme') @color_scheme.setter def color_scheme(self, scheme): self.set_string('dark-mode', scheme) @property def live_translation(self): return self.get_boolean('live-translation') @live_translation.setter def live_translation(self, state): self.set_boolean('live-translation', state) @property def sp_translation(self): return self.get_boolean('sp-translation') @sp_translation.setter def sp_translation(self, state): self.set_boolean('sp-translation', state) @property def show_pronunciation(self): return self.get_boolean('show-pronunciation') @property def show_pronunciation_value(self): return self.get_value('show-pronunciation') @show_pronunciation.setter def show_pronunciation(self, state): self.set_boolean('show-pronunciation', state) @property def src_auto(self): return self.get_boolean('src-auto') @src_auto.setter def src_auto(self, state): self.set_boolean('src-auto', state) dialect-2.1.1/dialect/shortcuts.py000066400000000000000000000013521432512702200171340ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later from gi.repository import Gtk from dialect.define import RES_PATH from dialect.settings import Settings @Gtk.Template(resource_path=f'{RES_PATH}/shortcuts.ui') class DialectShortcutsWindow(Gtk.ShortcutsWindow): __gtype_name__ = 'DialectShortcutsWindow' translate_shortcut = Gtk.Template.Child() def __init__(self, **kwargs): super().__init__(**kwargs) self.connect('show', self._on_show) def _on_show(self, _data): self.translate_shortcut.set_visible(not Settings.get().live_translation) self.translate_shortcut.set_property('accelerator', Settings.get().translate_accel) dialect-2.1.1/dialect/theme_switcher.py000066400000000000000000000044211432512702200201100ustar00rootroot00000000000000# Copyright 2020 Manuel Genovés # Copyright 2022 Mufeed Ali # Copyright 2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later # Code modifed from Apostrophe # https://gitlab.gnome.org/World/apostrophe/-/blob/main/apostrophe/theme_switcher.py from gi.repository import Adw, Gio, GObject, Gtk from dialect.define import RES_PATH from dialect.settings import Settings @Gtk.Template(resource_path=f'{RES_PATH}/theme-switcher.ui') class DialectThemeSwitcher(Gtk.Box): __gtype_name__ = 'DialectThemeSwitcher' show_system = GObject.property(type=bool, default=True) color_scheme = 'light' system = Gtk.Template.Child() light = Gtk.Template.Child() dark = Gtk.Template.Child() @GObject.Property(type=str) def selected_color_scheme(self): """Read-write integer property.""" return self.color_scheme @selected_color_scheme.setter def selected_color_scheme(self, color_scheme): self.color_scheme = color_scheme if color_scheme == 'auto': self.system.set_active(True) self.style_manager.set_color_scheme(Adw.ColorScheme.PREFER_LIGHT) if color_scheme == 'light': self.light.set_active(True) self.style_manager.set_color_scheme(Adw.ColorScheme.FORCE_LIGHT) if color_scheme == 'dark': self.dark.set_active(True) self.style_manager.set_color_scheme(Adw.ColorScheme.FORCE_DARK) def __init__(self, **kwargs): super().__init__(**kwargs) self.style_manager = Adw.StyleManager.get_default() self.color_scheme = Settings.get().color_scheme Settings.get().bind( 'color-scheme', self, 'selected_color_scheme', Gio.SettingsBindFlags.DEFAULT ) self.style_manager.bind_property( 'system-supports-color-schemes', self, 'show_system', GObject.BindingFlags.SYNC_CREATE ) @Gtk.Template.Callback() def _on_color_scheme_changed(self, _widget, _paramspec): if self.system.get_active(): self.selected_color_scheme = 'auto' if self.light.get_active(): self.selected_color_scheme = 'light' if self.dark.get_active(): self.selected_color_scheme = 'dark' dialect-2.1.1/dialect/translators/000077500000000000000000000000001432512702200170775ustar00rootroot00000000000000dialect-2.1.1/dialect/translators/__init__.py000066400000000000000000000065161432512702200212200ustar00rootroot00000000000000import importlib from gettext import gettext as _ import pkgutil TRANSLATORS = {} for _importer, modname, _ispkg in pkgutil.iter_modules(__path__): if modname != 'basetrans': modclass = importlib.import_module('dialect.translators.' + modname).Translator TRANSLATORS[modclass.name] = modclass def check_backend_availability(backend_name): if backend_name in TRANSLATORS: return True return False def get_fallback_backend_name(): if TRANSLATORS: return next(iter(TRANSLATORS)) return None LANGUAGES = { 'af': _('Afrikaans'), 'sq': _('Albanian'), 'am': _('Amharic'), 'ar': _('Arabic'), 'hy': _('Armenian'), 'az': _('Azerbaijani'), 'eu': _('Basque'), 'be': _('Belarusian'), 'bn': _('Bengali'), 'bs': _('Bosnian'), 'bg': _('Bulgarian'), 'ca': _('Catalan'), 'ceb': _('Cebuano'), 'ny': _('Chichewa'), 'zh': _('Chinese'), 'zh-CN': _('Chinese (Simplified)'), 'zh-TW': _('Chinese (Traditional)'), 'zh_HANT': _('Chinese (Traditional)'), 'co': _('Corsican'), 'hr': _('Croatian'), 'cs': _('Czech'), 'da': _('Danish'), 'nl': _('Dutch'), 'en': _('English'), 'eo': _('Esperanto'), 'et': _('Estonian'), 'tl': _('Filipino'), 'fi': _('Finnish'), 'fr': _('French'), 'fy': _('Frisian'), 'gl': _('Galician'), 'ka': _('Georgian'), 'de': _('German'), 'el': _('Greek'), 'gu': _('Gujarati'), 'ht': _('Haitian Creole'), 'ha': _('Hausa'), 'haw': _('Hawaiian'), 'iw': _('Hebrew'), 'he': _('Hebrew'), 'hi': _('Hindi'), 'hmn': _('Hmong'), 'hu': _('Hungarian'), 'is': _('Icelandic'), 'ig': _('Igbo'), 'id': _('Indonesian'), 'ga': _('Irish'), 'it': _('Italian'), 'ja': _('Japanese'), 'jw': _('Javanese'), 'kn': _('Kannada'), 'kk': _('Kazakh'), 'km': _('Khmer'), 'rw': _('Kinyarwanda'), 'ko': _('Korean'), 'ku': _('Kurdish (Kurmanji)'), 'ky': _('Kyrgyz'), 'lo': _('Lao'), 'la': _('Latin'), 'lv': _('Latvian'), 'lt': _('Lithuanian'), 'lb': _('Luxembourgish'), 'mk': _('Macedonian'), 'mg': _('Malagasy'), 'ms': _('Malay'), 'ml': _('Malayalam'), 'mt': _('Maltese'), 'mi': _('Maori'), 'mr': _('Marathi'), 'mn': _('Mongolian'), 'my': _('Myanmar (Burmese)'), 'ne': _('Nepali'), 'no': _('Norwegian'), 'or': _('Odia (Oriya)'), 'ps': _('Pashto'), 'fa': _('Persian'), 'pl': _('Polish'), 'pt': _('Portuguese'), 'pa': _('Punjabi'), 'ro': _('Romanian'), 'ru': _('Russian'), 'sm': _('Samoan'), 'gd': _('Scots Gaelic'), 'sr': _('Serbian'), 'st': _('Sesotho'), 'sn': _('Shona'), 'sd': _('Sindhi'), 'si': _('Sinhala'), 'sk': _('Slovak'), 'sl': _('Slovenian'), 'so': _('Somali'), 'es': _('Spanish'), 'su': _('Sundanese'), 'sw': _('Swahili'), 'sv': _('Swedish'), 'tg': _('Tajik'), 'ta': _('Tamil'), 'tt': _('Tatar'), 'te': _('Telugu'), 'th': _('Thai'), 'tr': _('Turkish'), 'tk': _('Turkmen'), 'uk': _('Ukrainian'), 'ur': _('Urdu'), 'ug': _('Uyghur'), 'uz': _('Uzbek'), 'vi': _('Vietnamese'), 'cy': _('Welsh'), 'xh': _('Xhosa'), 'yi': _('Yiddish'), 'yo': _('Yoruba'), 'zu': _('Zulu'), } def get_lang_name(code): return LANGUAGES.get(code, code) dialect-2.1.1/dialect/translators/basetrans.py000066400000000000000000000072061432512702200214400ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later class TranslatorBase: name = '' prettyname = '' history = [] languages = ['en'] chars_limit = 0 supported_features = { 'detection': False, 'mistakes': False, 'pronunciation': False, 'change-instance': False, 'suggestions': False, 'api-key-supported': False, 'api-key-required': False, } instance_url = '' api_key = '' src_langs = ['en', 'fr', 'es', 'de'] dest_langs = ['fr', 'es', 'de', 'en'] validation_path = '' api_test_path = '' @staticmethod def format_url(url, path, http=False): protocol = 'https://' if url.startswith('localhost:') or http: protocol = 'http://' return protocol + url + path @staticmethod def validate_instance(data): pass def format_suggestion(self, text, src, dest, suggestion): pass def get_suggestion(self, data): pass def format_translation(self, text, src, dest): pass def get_translation(self, data): pass class TranslatorError(Exception): """Base Exception for Translator related errors.""" def __init__(self, cause, message='Translator Error'): self.cause = cause self.message = message super().__init__(self.message) def __str__(self): return f'{self.message}: {self.cause}' class ApiKeyRequired(TranslatorError): """Exception raised when API key is required.""" def __init__(self, cause, message='API Key Required'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class InvalidApiKey(TranslatorError): """Exception raised when an invalid API key is found.""" def __init__(self, cause, message='Invalid API Key'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class InvalidLangCode(TranslatorError): """Exception raised when an invalid lang code is sent.""" def __init__(self, cause, message='Invalid Lang Code'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class BatchSizeExceeded(TranslatorError): """Exception raised when the batch size limit has been exceeded.""" def __init__(self, cause, message='Batch Size Exceeded'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class CharactersLimitExceeded(TranslatorError): """Exception raised when the char limit has been exceeded.""" def __init__(self, cause, message='Characters Limit Exceeded'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class ServiceLimitReached(TranslatorError): """Exception raised when the service limit has been reached.""" def __init__(self, cause, message='Service Limit Reached'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class TranslationError(TranslatorError): """Exception raised when translation fails.""" def __init__(self, cause, message='Translation has failed'): self.cause = cause self.message = message super().__init__(self.cause, self.message) class Translation: text = None extra_data = { 'possible-mistakes': None, 'src-pronunciation': None, 'dest-pronunciation': None, } def __init__(self, text, extra_data): self.text = text self.extra_data = extra_data dialect-2.1.1/dialect/translators/gtrans.py000066400000000000000000000326101432512702200207510ustar00rootroot00000000000000# Copyright 2022 Mufeed Ali # Copyright 2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import html import json import random import re from typing import List from dialect.translators.basetrans import TranslatorBase, Translation, TranslationError, TranslatorError RPC_ID = 'MkEWBc' # Predefined URLs used to make google translate requests. TRANSLATE_RPC = '{host}/_/TranslateWebserverUi/data/batchexecute' DEFAULT_SERVICE_URLS = ('translate.google.ac', 'translate.google.ad', 'translate.google.ae', 'translate.google.al', 'translate.google.am', 'translate.google.as', 'translate.google.at', 'translate.google.az', 'translate.google.ba', 'translate.google.be', 'translate.google.bf', 'translate.google.bg', 'translate.google.bi', 'translate.google.bj', 'translate.google.bs', 'translate.google.bt', 'translate.google.by', 'translate.google.ca', 'translate.google.cat', 'translate.google.cc', 'translate.google.cd', 'translate.google.cf', 'translate.google.cg', 'translate.google.ch', 'translate.google.ci', 'translate.google.cl', 'translate.google.cm', 'translate.google.cn', 'translate.google.co.ao', 'translate.google.co.bw', 'translate.google.co.ck', 'translate.google.co.cr', 'translate.google.co.id', 'translate.google.co.il', 'translate.google.co.in', 'translate.google.co.jp', 'translate.google.co.ke', 'translate.google.co.kr', 'translate.google.co.ls', 'translate.google.co.ma', 'translate.google.co.mz', 'translate.google.co.nz', 'translate.google.co.th', 'translate.google.co.tz', 'translate.google.co.ug', 'translate.google.co.uk', 'translate.google.co.uz', 'translate.google.co.ve', 'translate.google.co.vi', 'translate.google.co.za', 'translate.google.co.zm', 'translate.google.co.zw', 'translate.google.com.af', 'translate.google.com.ag', 'translate.google.com.ai', 'translate.google.com.ar', 'translate.google.com.au', 'translate.google.com.bd', 'translate.google.com.bh', 'translate.google.com.bn', 'translate.google.com.bo', 'translate.google.com.br', 'translate.google.com.bz', 'translate.google.com.co', 'translate.google.com.cu', 'translate.google.com.cy', 'translate.google.com.do', 'translate.google.com.ec', 'translate.google.com.eg', 'translate.google.com.et', 'translate.google.com.fj', 'translate.google.com.gh', 'translate.google.com.gi', 'translate.google.com.gt', 'translate.google.com.hk', 'translate.google.com.jm', 'translate.google.com.kh', 'translate.google.com.kw', 'translate.google.com.lb', 'translate.google.com.ly', 'translate.google.com.mm', 'translate.google.com.mt', 'translate.google.com.mx', 'translate.google.com.my', 'translate.google.com.na', 'translate.google.com.ng', 'translate.google.com.ni', 'translate.google.com.np', 'translate.google.com.om', 'translate.google.com.pa', 'translate.google.com.pe', 'translate.google.com.pg', 'translate.google.com.ph', 'translate.google.com.pk', 'translate.google.com.pr', 'translate.google.com.py', 'translate.google.com.qa', 'translate.google.com.sa', 'translate.google.com.sb', 'translate.google.com.sg', 'translate.google.com.sl', 'translate.google.com.sv', 'translate.google.com.tj', 'translate.google.com.tr', 'translate.google.com.tw', 'translate.google.com.ua', 'translate.google.com.uy', 'translate.google.com.vc', 'translate.google.com.vn', 'translate.google.com', 'translate.google.cv', 'translate.google.cz', 'translate.google.de', 'translate.google.dj', 'translate.google.dk', 'translate.google.dm', 'translate.google.dz', 'translate.google.ee', 'translate.google.es', 'translate.google.fi', 'translate.google.fm', 'translate.google.fr', 'translate.google.ga', 'translate.google.ge', 'translate.google.gg', 'translate.google.gl', 'translate.google.gm', 'translate.google.gp', 'translate.google.gr', 'translate.google.gy', 'translate.google.hn', 'translate.google.hr', 'translate.google.ht', 'translate.google.hu', 'translate.google.ie', 'translate.google.im', 'translate.google.iq', 'translate.google.is', 'translate.google.it', 'translate.google.je', 'translate.google.jo', 'translate.google.kg', 'translate.google.ki', 'translate.google.kz', 'translate.google.la', 'translate.google.li', 'translate.google.lk', 'translate.google.lt', 'translate.google.lu', 'translate.google.lv', 'translate.google.md', 'translate.google.me', 'translate.google.mg', 'translate.google.mk', 'translate.google.ml', 'translate.google.mn', 'translate.google.ms', 'translate.google.mu', 'translate.google.mv', 'translate.google.mw', 'translate.google.ne', 'translate.google.nl', 'translate.google.no', 'translate.google.nr', 'translate.google.nu', 'translate.google.pl', 'translate.google.pn', 'translate.google.ps', 'translate.google.pt', 'translate.google.ro', 'translate.google.rs', 'translate.google.ru', 'translate.google.rw', 'translate.google.sc', 'translate.google.se', 'translate.google.sh', 'translate.google.si', 'translate.google.sk', 'translate.google.sm', 'translate.google.sn', 'translate.google.so', 'translate.google.sr', 'translate.google.st', 'translate.google.td', 'translate.google.tg', 'translate.google.tk', 'translate.google.tl', 'translate.google.tm', 'translate.google.tn', 'translate.google.to', 'translate.google.tt', 'translate.google.us', 'translate.google.vg', 'translate.google.vu', 'translate.google.ws') class Translator(TranslatorBase): name = 'google' prettyname = 'Google Translate' client = None history = [] languages = [ 'af', 'sq', 'am', 'ar', 'hy', 'az', 'eu', 'be', 'bn', 'bs', 'bg', 'ca', 'ceb', 'ny', 'zh-CN', 'zh-TW', 'co', 'hr', 'cs', 'da', 'nl', 'en', 'eo', 'et', 'tl', 'fi', 'fr', 'fy', 'gl', 'ka', 'de', 'el', 'gu', 'ht', 'ha', 'haw', 'iw', 'hi', 'hmn', 'hu', 'is', 'ig', 'id', 'ga', 'it', 'ja', 'jw', 'kn', 'kk', 'km', 'rw', 'ko', 'ku', 'ky', 'lo', 'la', 'lv', 'lt', 'lb', 'mk', 'mg', 'ms', 'ml', 'mt', 'mi', 'mr', 'mn', 'my', 'ne', 'no', 'or', 'ps', 'fa', 'pl', 'pt', 'pa', 'ro', 'ru', 'sm', 'gd', 'sr', 'st', 'sn', 'sd', 'si', 'sk', 'sl', 'so', 'es', 'su', 'sw', 'sv', 'tg', 'ta', 'tt', 'te', 'th', 'tr', 'tk', 'uk', 'ur', 'ug', 'uz', 'vi', 'cy', 'xh', 'yi', 'yo', 'zu' ] chars_limit = 2000 supported_features = { 'detection': True, 'mistakes': True, 'pronunciation': True, 'change-instance': False, 'suggestions': False, 'api-key-supported': False, 'api-key-required': False, } _service_urls = DEFAULT_SERVICE_URLS _headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)', 'Referer': 'https://translate.google.com', } _src_lang = None _dest_lang = None def __init__(self, **kwargs): pass @staticmethod def _build_rpc_request(text: str, src: str, dest: str): return json.dumps([[ [ RPC_ID, json.dumps([[text, src, dest, True], [None]], separators=(',', ':')), None, 'generic', ], ]], separators=(',', ':')) def _pick_service_url(self): if len(self._service_urls) == 1: return self._service_urls[0] return random.choice(self._service_urls) @property def translate_url(self): url = TRANSLATE_RPC.format(host=self._pick_service_url()) + '?' params_dict = { 'rpcids': RPC_ID, 'bl': 'boq_translate-webserver_20201207.13_p0', 'soc-app': '1', 'soc-platform': '1', 'soc-device': '1', 'rt': 'c', } params = [] for item in params_dict: params.append('='.join([item, params_dict[item]])) return self.format_url(url, '&'.join(params)) def format_translation(self, text, src, dest): data = { 'f.req': self._build_rpc_request(text, src, dest), } self._src_lang = src self._dest_lang = dest return ('POST', data, self._headers, True) def get_translation(self, data): try: token_found = False square_bracket_counts = [0, 0] resp = '' data = data.decode('utf-8') for line in data.split('\n'): token_found = token_found or f'"{RPC_ID}"' in line[:30] if not token_found: continue is_in_string = False for index, char in enumerate(line): if char == '\"' and line[max(0, index - 1)] != '\\': is_in_string = not is_in_string if not is_in_string: if char == '[': square_bracket_counts[0] += 1 elif char == ']': square_bracket_counts[1] += 1 resp += line if square_bracket_counts[0] == square_bracket_counts[1]: break data = json.loads(resp) parsed = json.loads(data[0][2]) should_spacing = parsed[1][0][0][3] translated_parts = None translated = None try: translated_parts = list( map( lambda part: TranslatedPart( part[0] if len(part) > 0 else '', part[1] if len(part) >= 2 else [] ), parsed[1][0][0][5] ) ) except TypeError: translated_parts = [ TranslatedPart( parsed[1][0][1][0], [parsed[1][0][0][0], parsed[1][0][1][0]] ) ] translated = (' ' if should_spacing else '').join(map(lambda part: part.text, translated_parts)) src = None try: src = parsed[1][-1][1] except (IndexError, TypeError): pass if not src == self._src_lang: raise TranslationError('source language mismatch') if src == 'auto': try: if parsed[0][2] in self.languages: src = parsed[0][2] except (IndexError, TypeError): pass dest = None try: dest = parsed[1][-1][2] except (IndexError, TypeError): pass if not dest == self._dest_lang: raise TranslationError('destination language mismatch') origin_pronunciation = None try: origin_pronunciation = parsed[0][0] except (IndexError, TypeError): pass pronunciation = None try: pronunciation = parsed[1][0][0][1] except (IndexError, TypeError): pass mistake = None try: mistake = parsed[0][1][0][0][1] except (IndexError, TypeError): pass result = Translation( translated, { 'possible-mistakes': [mistake, self._strip_html_tags(mistake)], 'src-pronunciation': origin_pronunciation, 'dest-pronunciation': pronunciation, } ) return (result, src) except TranslationError as e: raise e except Exception as e: raise TranslatorError(str(e)) def _strip_html_tags(self, text): """Strip html tags""" if text is None: return None tags_re = re.compile(r'(|<[^>]*>)') tags_removed = tags_re.sub('', text) escaped = html.escape(tags_removed) return escaped class TranslatedPart: def __init__(self, text: str, candidates: List[str]): self.text = text self.candidates = candidates def __str__(self): return self.text def __dict__(self): return { 'text': self.text, 'candidates': self.candidates, } dialect-2.1.1/dialect/translators/libretrans.py000066400000000000000000000136071432512702200216250ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import logging from gi.repository import Soup from dialect.translators.basetrans import ( ApiKeyRequired, BatchSizeExceeded, CharactersLimitExceeded, InvalidLangCode, InvalidApiKey, TranslatorBase, Translation, TranslationError, TranslatorError ) from dialect.session import Session, ResponseEmpty class Translator(TranslatorBase): name = 'libretranslate' prettyname = 'LibreTranslate' history = [] languages = [] chars_limit = 0 supported_features = { 'detection': True, 'mistakes': False, 'pronunciation': False, 'change-instance': True, 'suggestions': False, 'api-key-supported': False, 'api-key-required': False, } instance_url = 'libretranslate.de' api_key = '' validation_path = '/spec' api_test_path = '/translate' def __init__(self, callback, base_url=None, api_key='', **kwargs): def on_loaded(): callback(self.langs_success and self.settings_success, self.error, self.network_error) def on_langs_response(session, result): try: data = Session.get_response(session, result) self._check_errors(data) for lang in data: self.languages.append(lang['code']) self.langs_success = True except (TranslatorError, ResponseEmpty) as exc: logging.warning(exc) self.error = str(exc) except Exception as exc: logging.warning(exc) self.error = str(exc) self.network_error = True def on_settings_response(session, result): try: data = Session.get_response(session, result) self._check_errors(data) self.supported_features['suggestions'] = data.get('suggestions', False) self.supported_features['api-key-supported'] = data.get('apiKeys', False) self.supported_features['api-key-required'] = data.get('keyRequired', False) self.chars_limit = data.get('charLimit', 0) self.settings_success = True except (TranslatorError, ResponseEmpty) as exc: logging.warning(exc) self.error = str(exc) except Exception as exc: logging.warning(exc) self.error = str(exc) self.network_error = True self.langs_success = False self.settings_success = False self.network_error = False self.error = '' if base_url is not None: self.instance_url = base_url self.api_key = api_key lang_message = Soup.Message.new('GET', self.lang_url) settings_message = Soup.Message.new('GET', self._frontend_settings_url) Session.get().multiple( [ [lang_message, on_langs_response], [settings_message, on_settings_response] ], on_loaded ) @property def _frontend_settings_url(self): return self.format_url(self.instance_url, '/frontend/settings') @property def detect_url(self): return self.format_url(self.instance_url, '/detect') @property def lang_url(self): return self.format_url(self.instance_url, '/languages') @property def suggest_url(self): return self.format_url(self.instance_url, '/suggest') @property def translate_url(self): return self.format_url(self.instance_url, '/translate') @staticmethod def validate_instance(data): valid = False if data and data is not None: valid = data['info']['title'] == 'LibreTranslate' return valid @staticmethod def format_api_key_test(api_key): data = { 'q': 'hello', 'source': 'en', 'target': 'es', 'api_key': api_key, } return (data, {}) def format_suggestion(self, text, src, dest, suggestion): data = { 'q': text, 'source': src, 'target': dest, 's': suggestion, } if self.api_key: data['api_key'] = self.api_key return (data, {}) def get_suggestion(self, data): self._check_errors(data) return data.get('success', False) def format_translation(self, text, src, dest): data = { 'q': text, 'source': src, 'target': dest, } if self.api_key: data['api_key'] = self.api_key return ('POST', data, {}, False) def get_translation(self, data): self._check_errors(data) translation = Translation( data['translatedText'], { 'possible-mistakes': None, 'src-pronunciation': None, 'dest-pronunciation': None, }, ) return (translation, None) def _check_errors(self, data): """Raises a proper Exception if an error is found in the data.""" if 'error' in data: error = data['error'] if error == 'Please contact the server operator to obtain an API key': raise ApiKeyRequired(error) elif error == 'Invalid API key': raise InvalidApiKey(error) elif 'is not supported' in error: raise InvalidLangCode(error) elif 'exceeds text limit' in error: raise BatchSizeExceeded(error) elif 'exceeds character limit' in error: raise CharactersLimitExceeded(error) elif 'Cannot translate text' in error or 'format is not supported' in error: raise TranslationError(error) else: raise TranslatorError(error) dialect-2.1.1/dialect/translators/lingva.py000066400000000000000000000060631432512702200207360ustar00rootroot00000000000000# Copyright 2021 Mufeed Ali # Copyright 2021 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import logging from gi.repository import Soup from dialect.translators.basetrans import ( InvalidLangCode, TranslatorBase, Translation, TranslatorError ) from dialect.session import Session, ResponseEmpty class Translator(TranslatorBase): name = 'lingva' prettyname = 'Lingva Translate' history = [] languages = [] chars_limit = 5000 supported_features = { 'detection': True, 'mistakes': False, 'pronunciation': False, 'change-instance': True, 'suggestions': False, 'api-key-supported': False, 'api-key-required': False, } instance_url = 'lingva.ml' validation_path = '/api/v1/en/es/hello' def __init__(self, callback, base_url=None, _api_key='', **kwargs): def on_langs_response(session, result): success = False network_error = False error = '' try: data = Session.get_response(session, result) self._check_errors(data) if 'languages' in data: for lang in data['languages']: if lang['code'] != 'auto': self.languages.append(lang['code']) success = True except (TranslatorError, ResponseEmpty) as exc: logging.warning(exc) error = str(exc) except Exception as exc: logging.warning(exc) error = str(exc) network_error = True callback(success, error, network_error) if base_url is not None: self.instance_url = base_url lang_message = Soup.Message.new('GET', self.lang_url) Session.get().send_and_read_async(lang_message, 0, None, on_langs_response) @property def lang_url(self): return self.format_url(self.instance_url, '/api/v1/languages/') @property def translate_url(self): return self.format_url(self.instance_url, '/api/v1/{src}/{dest}/{text}') @staticmethod def validate_instance(data): valid = False if data and 'translation' in data: valid = True return valid def format_translation(self, _text, _src, _dest): return ('GET', {}, {}, False) def get_translation(self, data): self._check_errors(data) translation = Translation( data['translation'], { 'possible-mistakes': None, 'src-pronunciation': None, 'dest-pronunciation': None, }, ) return (translation, None) def _check_errors(self, data): """Raises a proper Exception if an error is found in the data.""" if 'error' in data: error = data['error'] if error == 'Invalid target language' or error == 'Invalid source language': raise InvalidLangCode(error) else: raise TranslatorError(error) dialect-2.1.1/dialect/tts/000077500000000000000000000000001432512702200153355ustar00rootroot00000000000000dialect-2.1.1/dialect/tts/__init__.py000066400000000000000000000004011432512702200174410ustar00rootroot00000000000000import importlib import pkgutil TTS = {} for _importer, modname, _ispkg in pkgutil.iter_modules(__path__): if modname != 'basetts': modclass = importlib.import_module('dialect.tts.' + modname).TextToSpeech TTS[modclass.name] = modclass dialect-2.1.1/dialect/tts/basetts.py000066400000000000000000000010011432512702200173440ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later class TextToSpeechBase: name = '' prettyname = '' languages = ['en'] def download_voice(self, text, language, file): pass class TextToSpeechError(Exception): """Exception raised when tts fails.""" def __init__(self, cause, message='Text to Speech has failed'): self.cause = cause self.message = message super().__init__(self.message) dialect-2.1.1/dialect/tts/gtts.py000066400000000000000000000012711432512702200166710ustar00rootroot00000000000000# Copyright 2021-2022 Mufeed Ali # Copyright 2021-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later from gtts import gTTS, lang from dialect.tts.basetts import TextToSpeechBase, TextToSpeechError class TextToSpeech(TextToSpeechBase): name = 'google' prettyname = 'Google Text-to-Speech' languages = [] def __init__(self, **kwargs): self.languages = list(lang.tts_langs().keys()) def download_voice(self, text, language, file): try: tts = gTTS(text, lang=language, lang_check=False) tts.write_to_fp(file) file.seek(0) except Exception as exc: raise TextToSpeechError(exc) from exc dialect-2.1.1/dialect/window.py000066400000000000000000001370001432512702200164050ustar00rootroot00000000000000# Copyright 2020 gi-lom # Copyright 2020-2022 Mufeed Ali # Copyright 2020-2022 Rafael Mardojai CM # SPDX-License-Identifier: GPL-3.0-or-later import logging import threading from gettext import gettext as _ from tempfile import NamedTemporaryFile from gi.repository import Adw, Gdk, Gio, GLib, GObject, Gst, Gtk from dialect.define import APP_ID, PROFILE, RES_PATH, TRANS_NUMBER from dialect.lang_selector import DialectLangSelector from dialect.session import Session, ResponseEmpty, ResponseError from dialect.settings import Settings from dialect.shortcuts import DialectShortcutsWindow from dialect.theme_switcher import DialectThemeSwitcher from dialect.translators import TRANSLATORS, get_lang_name from dialect.translators.basetrans import ApiKeyRequired, InvalidApiKey, TranslatorError from dialect.tts import TTS @Gtk.Template(resource_path=f'{RES_PATH}/window.ui') class DialectWindow(Adw.ApplicationWindow): __gtype_name__ = 'DialectWindow' # Get widgets menu_btn = Gtk.Template.Child() main_stack = Gtk.Template.Child() error_page = Gtk.Template.Child() translator_box = Gtk.Template.Child() key_page = Gtk.Template.Child() rmv_key_btn = Gtk.Template.Child() error_api_key_btn = Gtk.Template.Child() title_stack = Gtk.Template.Child() langs_button_box = Gtk.Template.Child() switch_btn = Gtk.Template.Child() src_lang_btn = Gtk.Template.Child() src_lang_label = Gtk.Template.Child() dest_lang_btn = Gtk.Template.Child() dest_lang_label = Gtk.Template.Child() return_btn = Gtk.Template.Child() forward_btn = Gtk.Template.Child() src_pron_revealer = Gtk.Template.Child() src_pron_label = Gtk.Template.Child() mistakes = Gtk.Template.Child() mistakes_label = Gtk.Template.Child() char_counter = Gtk.Template.Child() src_text = Gtk.Template.Child() clear_btn = Gtk.Template.Child() paste_btn = Gtk.Template.Child() src_voice_btn = Gtk.Template.Child() translate_btn = Gtk.Template.Child() dest_box = Gtk.Template.Child() dest_pron_revealer = Gtk.Template.Child() dest_pron_label = Gtk.Template.Child() dest_text = Gtk.Template.Child() dest_toolbar_stack = Gtk.Template.Child() trans_spinner = Gtk.Template.Child() trans_warning = Gtk.Template.Child() edit_btn = Gtk.Template.Child() copy_btn = Gtk.Template.Child() dest_voice_btn = Gtk.Template.Child() actionbar = Gtk.Template.Child() src_lang_btn2 = Gtk.Template.Child() switch_btn2 = Gtk.Template.Child() dest_lang_btn2 = Gtk.Template.Child() toast = None # for notification management toast_overlay = Gtk.Template.Child() src_key_ctrlr = Gtk.Template.Child() win_key_ctrlr = Gtk.Template.Child() # Translator translator = None # Translator object # Text to speech tts = None tts_langs = None voice_loading = False # tts loading status # Preset language values src_langs = [] dest_langs = [] current_history = 0 # for history management # Translation-related variables next_trans = {} # for ongoing translation ongoing_trans = False # for ongoing translation trans_failed = False # for monitoring connectivity issues trans_mistakes = [None, None] # "mistakes" suggestions # Pronunciations trans_src_pron = None trans_dest_pron = None # Suggestions before_suggest = None mobile_mode = False # UI mode # Propeties backend_loading = GObject.Property(type=bool, default=False) def __init__(self, text, langs, **kwargs): super().__init__(**kwargs) # Options passed to command line self.launch_text = text self.launch_langs = langs # Application object self.app = kwargs['application'] # GStreamer playbin object and related setup self.player = Gst.ElementFactory.make('playbin', 'player') bus = self.player.get_bus() bus.add_signal_watch() bus.connect('message', self.on_gst_message) self.player_event = threading.Event() # An event for letting us know when Gst is done playing # Setup window self.setup_actions() self.setup() def setup(self): self.set_default_icon_name(APP_ID) # Set devel style if PROFILE == 'Devel': self.get_style_context().add_class('devel') # Theme Switcher theme_switcher = DialectThemeSwitcher() self.menu_btn.get_popover().add_child(theme_switcher, 'theme') # Save settings on close self.connect('unrealize', self.save_settings) self.setup_headerbar() self.setup_translation() self.set_help_overlay(DialectShortcutsWindow()) # Load translator self.load_translator(True) # Get languages available for speech if Settings.get().active_tts != '': threading.Thread(target=self.load_lang_speech, daemon=True).start() def do_size_allocate(self, width, height, baseline): if width < 680: if self.mobile_mode is False: self.mobile_mode = True self.toggle_mobile_mode() else: if self.mobile_mode is True: self.mobile_mode = False self.toggle_mobile_mode() Adw.ApplicationWindow.do_size_allocate(self, width, height, baseline) def setup_actions(self): back = Gio.SimpleAction.new('back', None) back.set_enabled(False) back.connect('activate', self.ui_return) self.add_action(back) forward_action = Gio.SimpleAction.new('forward', None) forward_action.set_enabled(False) forward_action.connect('activate', self.ui_forward) self.add_action(forward_action) switch_action = Gio.SimpleAction.new('switch', None) switch_action.connect('activate', self.ui_switch) self.add_action(switch_action) clear_action = Gio.SimpleAction.new('clear', None) clear_action.set_enabled(False) clear_action.connect('activate', self.ui_clear) self.add_action(clear_action) paste_action = Gio.SimpleAction.new('paste', None) paste_action.connect('activate', self.ui_paste) self.add_action(paste_action) copy_action = Gio.SimpleAction.new('copy', None) copy_action.set_enabled(False) copy_action.connect('activate', self.ui_copy) self.add_action(copy_action) listen_dest_action = Gio.SimpleAction.new('listen-dest', None) listen_dest_action.connect('activate', self.ui_dest_voice) self.add_action(listen_dest_action) suggest_action = Gio.SimpleAction.new('suggest', None) suggest_action.set_enabled(False) suggest_action.connect('activate', self.ui_suggest) self.add_action(suggest_action) suggest_ok_action = Gio.SimpleAction.new('suggest-ok', None) suggest_ok_action.connect('activate', self.ui_suggest_ok) self.add_action(suggest_ok_action) suggest_cancel_action = Gio.SimpleAction.new('suggest-cancel', None) suggest_cancel_action.connect('activate', self.ui_suggest_cancel) self.add_action(suggest_cancel_action) listen_src_action = Gio.SimpleAction.new('listen-src', None) listen_src_action.connect('activate', self.ui_src_voice) self.add_action(listen_src_action) translation_action = Gio.SimpleAction.new('translation', None) translation_action.set_enabled(False) translation_action.connect('activate', self.translation) self.add_action(translation_action) def load_translator(self, launch=False): def on_loaded(success, error='', network_error=False): if success: # Supported features if not self.translator.supported_features['mistakes']: self.mistakes.set_reveal_child(False) self.ui_suggest_cancel(None, None) if not self.translator.supported_features['suggestions']: self.edit_btn.set_visible(False) else: self.edit_btn.set_visible(True) if not self.translator.supported_features['pronunciation']: self.src_pron_revealer.set_reveal_child(False) self.dest_pron_revealer.set_reveal_child(False) self.app.lookup_action('pronunciation').set_enabled(False) else: self.app.lookup_action('pronunciation').set_enabled(True) # Update langs list self.src_lang_selector.set_languages(self.translator.languages) self.dest_lang_selector.set_languages(self.translator.languages) # Update selected langs set_auto = Settings.get().src_auto and self.translator.supported_features['detection'] self.src_lang_selector.set_selected( 'auto' if set_auto else self.src_langs[0], notify=False ) self.dest_lang_selector.set_selected(self.dest_langs[0], notify=False) # Update chars limit self.char_counter.set_text( f'{str(self.src_buffer.get_char_count())}/{self.translator.chars_limit}' ) self.set_property('backend-loading', False) self.check_apikey() else: # Show error view self.loading_failed(error, network_error) self.set_property('backend-loading', False) backend = Settings.get().active_translator # Get saved languages self.src_langs = Settings.get().src_langs self.dest_langs = Settings.get().dest_langs # Show loading view self.main_stack.set_visible_child_name('loading') # Translator object self.translator = TRANSLATORS[backend]( callback=on_loaded, base_url=Settings.get().instance_url, api_key=Settings.get().api_key, ) if not TRANSLATORS[backend].supported_features['change-instance']: on_loaded(True) # Assume successful loading. if launch: if self.launch_langs['src'] is not None: self.src_lang_selector.set_selected(self.launch_langs['src'], notify=False) if self.launch_langs['dest'] is not None and self.launch_langs['dest'] in self.translator.languages: self.dest_lang_selector.set_selected(self.launch_langs['dest'], notify=False) if self.launch_text != '': self.translate(self.launch_text, self.launch_langs['src'], self.launch_langs['dest']) def check_apikey(self): def on_response(session, result): try: data = Session.get_response(session, result) self.translator.get_translation(data) self.main_stack.set_visible_child_name('translate') except InvalidApiKey as exc: logging.warning(exc) self.key_page.set_title(_('The provided API key is invalid')) if self.translator.supported_features['api-key-required']: self.key_page.set_description(_('Please set a valid API key in the preferences.')) else: self.key_page.set_description( _('Please set a valid API key or unset the API key in the preferences.') ) self.rmv_key_btn.set_visible(True) self.error_api_key_btn.set_visible(True) self.main_stack.set_visible_child_name('api-key') except (TranslatorError, ResponseEmpty) as exc: logging.warning(exc) self.loading_failed(str(exc)) except Exception as exc: logging.warning(exc) self.loading_failed(str(exc), True) if self.translator.supported_features['api-key-supported']: if Settings.get().api_key: validation_url = self.translator.format_url( Settings.get().instance_url, self.translator.api_test_path ) (data, headers) = self.translator.format_api_key_test(Settings.get().api_key) message = Session.create_message('POST', validation_url, data, headers) Session.get().send_and_read_async(message, 0, None, on_response) elif not Settings.get().api_key and self.translator.supported_features['api-key-required']: self.key_page.set_title(_('API key is required to use the service')) self.key_page.set_description(_('Please set an API key in the preferences.')) self.main_stack.set_visible_child_name('api-key') else: self.main_stack.set_visible_child_name('translate') else: self.main_stack.set_visible_child_name('translate') def loading_failed(self, details='', network=False): self.main_stack.set_visible_child_name('error') service = self.translator.prettyname url = self.translator.instance_url title = _('Failed loading the translation service') description = _('Please report this in the Dialect bug tracker if the issue persists.') if self.translator.supported_features['change-instance']: description = _('Failed loading "{url}", check if the instance address is correct or report in the Dialect bug tracker if the issue persists.') description = description.format(url=url) if network: title = _('Couldn’t connect to the translation service') description = _('We can’t connect to the server. Please check for network issues.') if self.translator.supported_features['change-instance']: description = _('We can’t connect to the {service} instance "{url}".\n Please check for network issues or if the address is correct.') description = description.format(service=service, url=url) if details: description = description + '\n\n' + details + '' self.error_page.set_title(title) self.error_page.set_description(description) @Gtk.Template.Callback() def retry_load_translator(self, _button): self.load_translator() @Gtk.Template.Callback() def remove_key_and_reload(self, _button): Settings.get().reset_api_key() self.load_translator() def on_listen_failed(self, called_from): self.src_voice_btn.set_child(self.src_voice_warning) self.src_voice_spinner.stop() self.dest_voice_btn.set_child(self.dest_voice_warning) self.dest_voice_spinner.stop() tooltip_text = _('A network issue has occured. Retry?') self.src_voice_btn.set_tooltip_text(tooltip_text) self.dest_voice_btn.set_tooltip_text(tooltip_text) if called_from is not None: action = { 'label': _('Retry'), 'name': 'win.listen-src' if called_from == 'src' else 'win.listen-dest', } else: action = None self.send_notification( _('A network issue has occured. Please try again.'), action=action ) src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) if self.tts_langs: self.lookup_action('listen-src').set_enabled( self.src_lang_selector.get_property('selected') in self.tts_langs and src_text != '' ) self.lookup_action('listen-dest').set_enabled( self.dest_lang_selector.get_property('selected') in self.tts_langs and dest_text != '' ) else: self.lookup_action('listen-src').set_enabled(src_text != '') self.lookup_action('listen-dest').set_enabled(dest_text != '') def load_lang_speech(self, listen=False, text=None, language=None, called_from=None): """ Load the language list for TTS. text and language parameters are only needed with listen parameter. """ try: self.voice_loading = True self.tts = TTS[Settings.get().active_tts]() self.tts_langs = self.tts.languages if not listen: GLib.idle_add(self.toggle_voice_spinner, False) elif language in self.tts_langs and text != '': self.voice_download(text, language) except RuntimeError as exc: GLib.idle_add(self.on_listen_failed, called_from) logging.error('Error: ' + str(exc)) finally: if not listen: self.voice_loading = False def setup_headerbar(self): # Left lang selector self.src_lang_selector = DialectLangSelector() self.src_lang_selector.connect('notify::selected', self.on_src_lang_changed) self.src_lang_selector.connect('user-selection-changed', self.translation) # Set popover selector to button self.src_lang_btn.set_popover(self.src_lang_selector) # Right lang selector self.dest_lang_selector = DialectLangSelector() self.dest_lang_selector.connect('notify::selected', self.on_dest_lang_changed) self.dest_lang_selector.connect('user-selection-changed', self.translation) # Set popover selector to button self.dest_lang_btn.set_popover(self.dest_lang_selector) self.langs_button_box.set_homogeneous(False) def setup_translation(self): # Left buffer self.src_buffer = self.src_text.get_buffer() self.src_buffer.set_text(self.launch_text) self.src_buffer.connect('changed', self.on_src_text_changed) self.src_buffer.connect('end-user-action', self.user_action_ended) # Detect typing self.src_key_ctrlr.connect('key-pressed', self.update_trans_button) self.win_key_ctrlr.connect('key-pressed', self.on_key_event) # "Did you mean" links self.mistakes_label.connect('activate-link', self.on_mistakes_clicked) # Right buffer self.dest_buffer = self.dest_text.get_buffer() self.dest_buffer.set_text('') self.dest_buffer.connect('changed', self.on_dest_text_changed) # Translation progress spinner self.trans_spinner.hide() self.trans_warning.hide() # Voice buttons prep-work self.src_voice_warning = Gtk.Image.new_from_icon_name('dialog-warning-symbolic') self.src_voice_image = Gtk.Image.new_from_icon_name('audio-speakers-symbolic') self.src_voice_spinner = Gtk.Spinner() # For use while audio is running or still loading. self.dest_voice_warning = Gtk.Image.new_from_icon_name('dialog-warning-symbolic') self.dest_voice_image = Gtk.Image.new_from_icon_name('audio-speakers-symbolic') self.dest_voice_spinner = Gtk.Spinner() self.toggle_voice_spinner(True) self.src_voice_btn.set_visible(Settings.get().active_tts != '') self.dest_voice_btn.set_visible(Settings.get().active_tts != '') def toggle_mobile_mode(self): if self.mobile_mode: # Show actionbar self.actionbar.set_revealed(True) # Change headerbar title self.title_stack.set_visible_child_name('label') # Change translation box orientation self.translator_box.set_orientation(Gtk.Orientation.VERTICAL) # Change lang selectors position self.src_lang_btn.set_popover(None) self.src_lang_btn2.set_popover(self.src_lang_selector) self.dest_lang_btn.set_popover(None) self.dest_lang_btn2.set_popover(self.dest_lang_selector) else: # Hide actionbar self.actionbar.set_revealed(False) # Reset headerbar title self.title_stack.set_visible_child_name('selector') # Reset translation box orientation self.translator_box.set_orientation(Gtk.Orientation.HORIZONTAL) # Reset lang selectors position self.src_lang_btn2.set_popover(None) self.src_lang_btn.set_popover(self.src_lang_selector) self.dest_lang_btn2.set_popover(None) self.dest_lang_btn.set_popover(self.dest_lang_selector) def translate(self, text, src_lang, dest_lang): """ Translates the given text from auto detected language to last used language """ # Set src lang to Auto if src_lang is None: self.src_lang_selector.set_selected('auto', notify=False) else: self.src_lang_selector.set_selected(src_lang, notify=False) if dest_lang is not None and dest_lang in self.translator.languages: self.dest_lang_selector.set_selected(dest_lang) # Set text to src buffer self.src_buffer.set_text(text) # Run translation self.translation() def save_settings(self, *args, **kwargs): if not self.is_maximized(): size = self.get_default_size() Settings.get().window_size = (size.width, size.height) if self.translator is not None: Settings.get().src_langs = self.src_langs Settings.get().dest_langs = self.dest_langs Settings.get().save_translator_settings() def send_notification(self, text, queue=False, action=None, timeout=5, priority=Adw.ToastPriority.NORMAL): """ Display an in-app notification. Args: text (str): The text or message of the notification. queue (bool, optional): If True, the notification will be queued. action (dict, optional): A dict containing the action to be called. """ if not queue and self.toast is not None: self.toast.dismiss() self.toast = Adw.Toast.new(text) self.toast.connect('dismissed', self._toast_dismissed) if action is not None: self.toast.set_button_label(action['label']) self.toast.set_action_name(action['name']) self.toast.set_timeout(timeout) self.toast.set_priority(priority) self.toast_overlay.add_toast(self.toast) def _toast_dismissed(self, toast): self.toast = None def toggle_voice_spinner(self, active=True): if active: self.lookup_action('listen-src').set_enabled(False) self.src_voice_btn.set_child(self.src_voice_spinner) self.src_voice_spinner.start() self.lookup_action('listen-dest').set_enabled(False) self.dest_voice_btn.set_child(self.dest_voice_spinner) self.dest_voice_spinner.start() else: src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) self.lookup_action('listen-src').set_enabled( self.src_lang_selector.get_property('selected') in self.tts_langs and src_text != '' ) self.src_voice_btn.set_child(self.src_voice_image) self.src_voice_spinner.stop() dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) self.lookup_action('listen-dest').set_enabled( self.dest_lang_selector.get_property('selected') in self.tts_langs and dest_text != '' ) self.dest_voice_btn.set_child(self.dest_voice_image) self.dest_voice_spinner.stop() def on_src_lang_changed(self, _obj, _param): code = self.src_lang_selector.get_property('selected') dest_code = self.dest_lang_selector.get_property('selected') src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) if code == dest_code: code = self.dest_langs[1] if code == self.src_langs[0] else dest_code self.dest_lang_selector.set_selected(self.src_langs[0], notify=False) # Disable or enable listen function. if self.tts_langs and Settings.get().active_tts != '': self.lookup_action('listen-src').set_enabled( code in self.tts_langs and src_text != '' ) # Disable or enable switch function. self.lookup_action('switch').set_enabled( code != 'auto' ) if code in self.translator.languages: self.src_lang_label.set_label(get_lang_name(code)) # Update saved src langs list if code in self.src_langs: # Bring lang to the top self.src_langs.remove(code) elif code.lower() in self.src_langs: # Bring lang to the top self.src_langs.remove(code.lower()) elif len(self.src_langs) == 4: self.src_langs.pop() self.src_langs.insert(0, code) elif code == 'auto' and self.translator.supported_features['detection']: self.src_lang_label.set_label(_('Auto')) else: self.src_lang_label.set_label(get_lang_name(code)) # Rewrite recent langs self.src_lang_selector.clear_recent() if self.translator.supported_features['detection']: self.src_lang_selector.insert_recent('auto', _('Auto')) for code in self.src_langs: if code in self.translator.languages: self.src_lang_selector.insert_recent(code, get_lang_name(code)) # Refresh list self.src_lang_selector.refresh_selected() def on_dest_lang_changed(self, _obj, _param): code = self.dest_lang_selector.get_property('selected') src_code = self.src_lang_selector.get_property('selected') dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) if code == src_code: self.src_lang_selector.set_selected(self.dest_langs[0], notify=False) # Disable or enable listen function. if self.tts_langs and Settings.get().active_tts != '': self.lookup_action('listen-dest').set_enabled( code in self.tts_langs and dest_text != '' ) self.dest_lang_label.set_label(get_lang_name(code)) # Update saved dest langs list if code in self.dest_langs: # Bring lang to the top self.dest_langs.remove(code) elif code.lower() in self.dest_langs: # Bring lang to the top self.dest_langs.remove(code.lower()) elif len(self.src_langs) == 4: self.dest_langs.pop() self.dest_langs.insert(0, code) # Rewrite recent langs self.dest_lang_selector.clear_recent() for code in self.dest_langs: if code in self.translator.languages: self.dest_lang_selector.insert_recent(code, get_lang_name(code)) # Refresh list self.dest_lang_selector.refresh_selected() """ User interface functions """ def ui_return(self, _action, _param): """Go back one step in history.""" if self.current_history != TRANS_NUMBER: self.current_history += 1 self.history_update() def ui_forward(self, _action, _param): """Go forward one step in history.""" if self.current_history != 0: self.current_history -= 1 self.history_update() def add_history_entry(self, src_text, src_language, dest_language, dest_text): """Add a history entry to the history list.""" new_history_trans = { 'Languages': [src_language, dest_language], 'Text': [src_text, dest_text] } if self.current_history > 0: del self.translator.history[: self.current_history] self.current_history = 0 if len(self.translator.history) == TRANS_NUMBER: self.translator.history.pop() self.translator.history.insert(0, new_history_trans) GLib.idle_add(self.reset_return_forward_btns) def switch_all(self, src_language, dest_language, src_text, dest_text): self.src_lang_selector.set_selected(dest_language, notify=False) self.dest_lang_selector.set_selected(src_language, notify=False) self.src_buffer.set_text(dest_text) self.dest_buffer.set_text(src_text) self.add_history_entry(src_language, dest_language, src_text, dest_text) # Re-enable widgets self.langs_button_box.set_sensitive(True) self.lookup_action('translation').set_enabled(self.src_buffer.get_char_count() != 0) def ui_switch(self, _action, _param): # Get variables self.langs_button_box.set_sensitive(False) self.lookup_action('translation').set_enabled(False) src_language = self.src_lang_selector.get_property('selected') dest_language = self.dest_lang_selector.get_property('selected') src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) if src_language == 'auto': return # Switch all self.switch_all(src_language, dest_language, src_text, dest_text) def ui_clear(self, _action, _param): self.src_buffer.set_text('') self.src_buffer.emit('end-user-action') def ui_copy(self, _action, _param): dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) clipboard = Gdk.Display.get_default().get_clipboard() clipboard.set(dest_text) def ui_paste(self, _action, _param): clipboard = Gdk.Display.get_default().get_clipboard() def on_paste(_clipboard, result): text = clipboard.read_text_finish(result) if text is not None: end_iter = self.src_buffer.get_end_iter() self.src_buffer.insert(end_iter, text) cancellable = Gio.Cancellable() clipboard.read_text_async(cancellable, on_paste) def ui_suggest(self, _action, _param): self.dest_toolbar_stack.set_visible_child_name('edit') self.before_suggest = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) self.dest_text.set_editable(True) def ui_suggest_ok(self, _action, _param): dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) (data, headers) = self.translator.format_suggestion( self.translator.history[self.current_history]['Text'][0], self.translator.history[self.current_history]['Languages'][0], self.translator.history[self.current_history]['Languages'][1], dest_text ) message = Session.create_message( 'POST', self.translator.suggest_url, data, headers ) Session.get().send_and_read_async(message, 0, None, self.on_suggest_response) self.before_suggest = None def ui_suggest_cancel(self, _action, _param): self.dest_toolbar_stack.set_visible_child_name('default') if self.before_suggest is not None: self.dest_buffer.set_text(self.before_suggest) self.before_suggest = None self.dest_text.set_editable(False) def on_suggest_response(self, session, result): success = False self.dest_toolbar_stack.set_visible_child_name('default') try: data = Session.get_response(session, result) success = self.translator.get_suggestion(data) except Exception as exc: logging.error(exc) if success: self.send_notification(_('New translation has been suggested!')) else: self.send_notification(_('Suggestion failed.')) self.dest_text.set_editable(False) def ui_src_voice(self, _action, _param): src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) src_language = self.src_lang_selector.get_property('selected') self._voice(src_text, src_language, 'src') def ui_dest_voice(self, _action, _param): dest_text = self.dest_buffer.get_text( self.dest_buffer.get_start_iter(), self.dest_buffer.get_end_iter(), True ) dest_language = self.dest_lang_selector.get_property('selected') self._voice(dest_text, dest_language, 'dest') def _voice(self, text, lang, called_from): if text != '': self.toggle_voice_spinner(True) if self.tts_langs: threading.Thread( target=self.voice_download, args=(text, lang, called_from), daemon=True ).start() else: threading.Thread( target=self.load_lang_speech, args=(True, text, lang, called_from), daemon=True ).start() def on_gst_message(self, _bus, message): if message.type == Gst.MessageType.EOS: self.player.set_state(Gst.State.NULL) self.player_event.set() elif message.type == Gst.MessageType.ERROR: self.player.set_state(Gst.State.NULL) self.player_event.set() logging.error('Some error occurred while trying to play.') def voice_download(self, text, language, called_from): try: self.voice_loading = True with NamedTemporaryFile() as file_to_play: self.tts.download_voice(text, language, file_to_play) self.player.set_property('uri', 'file://' + file_to_play.name) self.player.set_state(Gst.State.PLAYING) self.player_event.wait() except Exception as exc: logging.error(exc) logging.error('Audio download failed.') GLib.idle_add(self.on_listen_failed, called_from) else: GLib.idle_add(self.toggle_voice_spinner, False) finally: self.voice_loading = False def on_key_event(self, _button, keyval, _keycode, state): modifiers = state & Gtk.accelerator_get_default_mod_mask() shift_mask = Gdk.ModifierType.SHIFT_MASK unicode_key_val = Gdk.keyval_to_unicode(keyval) if (GLib.unichar_isgraph(chr(unicode_key_val)) and modifiers in (shift_mask, 0) and not self.dest_text.get_editable() and not self.src_text.is_focus()): self.src_text.grab_focus() end_iter = self.src_buffer.get_end_iter() self.src_buffer.insert(end_iter, chr(unicode_key_val)) return Gdk.EVENT_STOP return Gdk.EVENT_PROPAGATE # This starts the translation if Ctrl+Enter button is pressed def update_trans_button(self, _button, keyval, _keycode, state): modifiers = state & Gtk.accelerator_get_default_mod_mask() control_mask = Gdk.ModifierType.CONTROL_MASK enter_keys = (Gdk.KEY_Return, Gdk.KEY_KP_Enter) if not Settings.get().live_translation: if control_mask == modifiers: if keyval in enter_keys: if not Settings.get().translate_accel_value: self.translation() return Gdk.EVENT_STOP return Gdk.EVENT_PROPAGATE elif keyval in enter_keys: if Settings.get().translate_accel_value: self.translation() return Gdk.EVENT_STOP return Gdk.EVENT_PROPAGATE return Gdk.EVENT_PROPAGATE def on_mistakes_clicked(self, _button, _data): self.mistakes.set_reveal_child(False) self.src_buffer.set_text(self.trans_mistakes[1]) # Run translation again self.translation() return Gdk.EVENT_STOP def on_src_text_changed(self, buffer): sensitive = buffer.get_char_count() != 0 self.lookup_action('translation').set_enabled(sensitive) self.lookup_action('clear').set_enabled(sensitive) if not self.voice_loading and self.tts_langs: self.lookup_action('listen-src').set_enabled( self.src_lang_selector.get_property('selected') in self.tts_langs and sensitive ) elif not self.voice_loading and not self.tts_langs: self.lookup_action('listen-src').set_enabled(sensitive) def on_dest_text_changed(self, buffer): sensitive = buffer.get_char_count() != 0 self.lookup_action('copy').set_enabled(sensitive) self.lookup_action('suggest').set_enabled( self.translator.supported_features['suggestions'] and sensitive ) if not self.voice_loading and self.tts_langs: self.lookup_action('listen-dest').set_enabled( self.dest_lang_selector.get_property('selected') in self.tts_langs and sensitive ) elif not self.voice_loading and not self.tts_langs: self.lookup_action('listen-dest').set_enabled(sensitive) def user_action_ended(self, buffer): # If the text is over the highest number of characters allowed, it is truncated. # This is done for avoiding exceeding the limit imposed by translation services. if buffer.get_char_count() >= self.translator.chars_limit: self.send_notification(_('{} characters limit reached!').format(self.translator.chars_limit)) buffer.delete( buffer.get_iter_at_offset(self.translator.chars_limit), buffer.get_end_iter() ) self.char_counter.set_text(f'{str(buffer.get_char_count())}/{self.translator.chars_limit}') if Settings.get().live_translation: self.translation() # The history part def reset_return_forward_btns(self): self.lookup_action('back').set_enabled(self.current_history < len(self.translator.history) - 1) self.lookup_action('forward').set_enabled(self.current_history > 0) # Retrieve translation history def history_update(self): self.reset_return_forward_btns() lang_hist = self.translator.history[self.current_history] self.src_lang_selector.set_selected(lang_hist['Languages'][0], notify=False) self.dest_lang_selector.set_selected(lang_hist['Languages'][1], notify=False) self.src_buffer.set_text(lang_hist['Text'][0]) self.dest_buffer.set_text(lang_hist['Text'][1]) def appeared_before(self): src_language = self.src_lang_selector.get_property('selected') dest_language = self.dest_lang_selector.get_property('selected') src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) if ( len(self.translator.history) >= self.current_history + 1 and (self.translator.history[self.current_history]['Languages'][0] == src_language or 'auto') and self.translator.history[self.current_history]['Languages'][1] == dest_language and self.translator.history[self.current_history]['Text'][0] == src_text ): return True return False def translation(self, _action=None, _param=None): # If it's like the last translation then it's useless to continue if not self.appeared_before(): src_text = self.src_buffer.get_text( self.src_buffer.get_start_iter(), self.src_buffer.get_end_iter(), True ) src_language = self.src_lang_selector.get_property('selected') dest_language = self.dest_lang_selector.get_property('selected') if self.ongoing_trans: self.next_trans = { 'text': src_text, 'src': src_language, 'dest': dest_language } return if self.next_trans: src_text = self.next_trans['text'] src_language = self.next_trans['src'] dest_language = self.next_trans['dest'] self.next_trans = {} # Show feedback for start of translation. self.translation_loading() # If the two languages are the same, nothing is done if src_language != dest_language: if src_text != '': self.ongoing_trans = True # Format data url = self.translator.translate_url.format( text=src_text, src=src_language, dest=dest_language ) (method, data, headers, raw) = self.translator.format_translation( src_text, src_language, dest_language ) message = Session.create_message(method, url, data, headers, raw) Session.get().send_and_read_async( message, 0, None, self.on_translation_response, (src_text, src_language, dest_language, raw) ) else: self.trans_failed = False self.trans_mistakes = [None, None] self.trans_src_pron = None self.trans_dest_pron = None self.dest_buffer.set_text('') if not self.ongoing_trans: self.translation_done() def on_translation_response(self, session, result, original): error = '' dest_text = '' self.trans_mistakes = [None, None] self.trans_src_pron = None self.trans_dest_pron = None try: data = Session.get_response(session, result, raw=original[3]) (translation, lang) = self.translator.get_translation(data) if lang and self.src_lang_selector.get_property('selected') == 'auto': if Settings.get().live_translation: lang = get_lang_name(lang) label = _('Auto') self.src_lang_label.set_label(f'{label} ({lang})') else: self.src_lang_selector.set_selected(lang, notify=False) dest_text = translation.text self.trans_mistakes = translation.extra_data['possible-mistakes'] self.trans_src_pron = translation.extra_data['src-pronunciation'] self.trans_dest_pron = translation.extra_data['dest-pronunciation'] self.trans_failed = False self.dest_buffer.set_text(dest_text) # Finally, everything is saved in history self.add_history_entry( original[0], original[1], original[2], dest_text ) except ResponseError as exc: logging.error(exc) error = 'network' self.trans_failed = True except InvalidApiKey as exc: logging.error(exc) error = 'invalid-api' self.trans_failed = True except ApiKeyRequired as exc: logging.error(exc) error = 'api-required' self.trans_failed = True except Exception as exc: logging.error(exc) self.trans_failed = True # Mistakes if self.translator.supported_features['mistakes'] and not self.trans_mistakes == [None, None]: mistake_text = self.trans_mistakes[0].replace('', '').replace('', '') self.mistakes_label.set_markup(_('Did you mean: ') + f'{mistake_text}') self.mistakes.set_reveal_child(True) elif self.mistakes.get_reveal_child(): self.mistakes.set_reveal_child(False) # Pronunciation reveal = Settings.get().show_pronunciation if self.translator.supported_features['pronunciation']: if self.trans_src_pron is not None and self.trans_mistakes == [None, None]: self.src_pron_label.set_text(self.trans_src_pron) self.src_pron_revealer.set_reveal_child(reveal) elif self.src_pron_revealer.get_reveal_child(): self.src_pron_revealer.set_reveal_child(False) if self.trans_dest_pron is not None: self.dest_pron_label.set_text(self.trans_dest_pron) self.dest_pron_revealer.set_reveal_child(reveal) elif self.dest_pron_revealer.get_reveal_child(): self.dest_pron_revealer.set_reveal_child(False) self.translation_failed(self.trans_failed, error) self.ongoing_trans = False if self.next_trans: self.translation() else: self.translation_done() def translation_loading(self): self.trans_spinner.show() self.trans_spinner.start() self.dest_box.set_sensitive(False) self.langs_button_box.set_sensitive(False) def translation_done(self): self.trans_spinner.stop() self.trans_spinner.hide() self.dest_box.set_sensitive(True) self.langs_button_box.set_sensitive(True) def translation_failed(self, failed, error=''): if failed: self.trans_warning.show() self.lookup_action('copy').set_enabled(False) self.lookup_action('listen-src').set_enabled(False) self.lookup_action('listen-dest').set_enabled(False) if error == 'network': self.send_notification( _('Translation failed, check for network issues'), action={ 'label': _('Retry'), 'name': 'win.translation', } ) elif error == 'invalid-api': self.send_notification( _('The provided API key is invalid'), action={ 'label': _('Preferences'), 'name': 'app.preferences', } ) elif error == 'api-required': self.send_notification( _('API key is required to use the service'), action={ 'label': _('Preferences'), 'name': 'app.preferences', } ) else: self.send_notification( _('Translation failed'), action={ 'label': _('Retry'), 'name': 'win.translation', } ) else: self.trans_warning.hide() def reload_backends(self): self.set_property('backend-loading', True) # Load translator self.load_translator() dialect-2.1.1/meson.build000066400000000000000000000040251432512702200152610ustar00rootroot00000000000000project('dialect', version: '2.1.1', meson_version: '>= 0.59.0', default_options: [ 'warning_level=2', ], ) python = import('python') i18n = import('i18n') base_id = 'app.drey.Dialect' pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) moduledir = join_paths(pkgdatadir, 'dialect') if get_option('profile') == 'development' profile = 'Devel' vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip() if vcs_tag == '' version_suffix = '-devel' else version_suffix = '-@0@'.format(vcs_tag) endif application_id = '@0@.@1@'.format(base_id, profile) object_path = '/app/drey/Dialect/Devel/SearchProvider' else profile = '' version_suffix = '' application_id = base_id object_path = '/app/drey/Dialect/SearchProvider' endif conf = configuration_data() conf.set('PYTHON', python.find_installation('python3').full_path()) conf.set('PROFILE', profile) conf.set('VERSION', meson.project_version() + version_suffix) conf.set('APP_ID', application_id) conf.set('BIN', join_paths(get_option('prefix'), get_option('bindir'), meson.project_name())) conf.set('object_path', object_path) conf.set('pkgdatadir', pkgdatadir) conf.set('datadir', get_option('datadir')) conf.set('prefix', get_option('prefix')) conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir'))) message('Looking for dependencies') py_installation = python.find_installation('python3') if not py_installation.found() error('No valid python3 binary found') else message('Found python3 binary') endif dependency('glib-2.0') dependency('gobject-introspection-1.0', version: '>= 1.35.0') dependency('gstreamer-1.0', version: '>= 1.18') dependency('gtk4', version: '>= 4.6') dependency('libadwaita-1', version: '>= 1.0') dependency('libsoup-3.0') dependency('pygobject-3.0', version: '>= 3.40') subdir('data') subdir('dialect') subdir('po') gnome.post_install( gtk_update_icon_cache: true, glib_compile_schemas: true, update_desktop_database: true, ) dialect-2.1.1/meson_options.txt000066400000000000000000000002661432512702200165570ustar00rootroot00000000000000option( 'profile', type: 'combo', choices: [ 'default', 'development' ], value: 'default', description: 'The build profile. One of "default" or "development".' ) dialect-2.1.1/po/000077500000000000000000000000001432512702200135345ustar00rootroot00000000000000dialect-2.1.1/preview-2.png000066400000000000000000001103131432512702200154430ustar00rootroot00000000000000PNG  IHDRt zTXtRaw profile type exifxڥkr$+Yo@fwwYґj#UweU& p;?˥Izr=>}>ׇOλQ_#G Rcx;ʇD_ =?(_&!Ey&ꯉR|.y,_0s|޲|6 :)ƝB. p߅>gk2玙)*DF+אyʗ }q,i.<}?gɹS\qu}=#O,aKô S꼄VRay"18!F8aߣ1jL{TRW8ɕ {Nݖp^]MXydo_oo8J!e+W93,r0"˩:⚈`1/[t;)f AN , m&E,]0&$"@B*bl!H!@cqPJ\sJPI,--ܡDN;fDV΅iYȡQRɥZZ˨Zj(ZvZې$YTi"eYzK} <{0`gy7lSfCIZjSѮcŕjKV_cM*ˮm}CN>ӎ~{^aQ )ޣަ'bFˁ7  -f^B"g1=R%bd`#yXNxOD-r?kS9gFBsOT׷(n49C֌-eb"WiRJɩiIskO A:_brv{Khߗmh3(֛5pe2m#Rw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R:fdCF[0a,2~Ӭy}i ɺϚæGR 6ӯ_k@"[n!}j V!3n2<:z& 96+d T?D33gy Kj>CXf/Pf֒ulV,Ydk֬ӦMpA-))&w7m۶mŋ߼[7KjKܤgdu.r8+e'h&{T2'Ih4G/Rb {PK,c1u(˚d4ӗ7I2&^ĸ(Ve7wqS_en4a31eqo;t[33 A3T@*dF} 5F*HsU2Z/e걙gJV*[3s6McȌM&#.ޑȦҪ)ezf:Rf]YoժXgG3}1dJw(n}l6*P"jkf"ɮg3к-3N }68 pÙLƿ!6O@̮IRYo|:kժi.k5!Pty82c7ZCԺ>J [mVajRY,Wǎ4sRЌ7U4OcVfO:#oAdæD!Ӫ;UYg[3&A38taLdbi`d5֪Ӹ]KYhZvJ:3VӸ8j<<d>(\iɴjiZtRT[,qiq,:~Zu%t'Q ܦ>r#7rh4/KefxVn*R5xJPJL6)P^fJ4ޚJ،z(^ ɺ9濭[jd nՌMbY*wM&^(4ڦ3!jI˧i\J،oe cxĻ,y)qh6yIr%Ԯ.V6YWxeK-PDcBf׍''Aj΄MdjfZ%(f96i^gxj,'B߉%kLu|'쯉3O)IDAT}ltjZYW\ьlyYeɛ2*ؙVt_Ñr4Me8 v'QK%3Q@FiuBHJ MTi53OAf%胦i\Dm51H'2J6^3tHλ:%hJ ɶ~΄TYP!SrVpJ, lt\v#`SnN Gvt>#8l!Srf;lFIwLqVR y2%gM)3a3]g3c45s3uiGL+0m~N<$fw`K'\v2%LMsypxf9Yey9ȎD1c_|^Vxr]u%Ɏו}8:dJºZL|'t|Ȕ/(Q|{_[A*_C] y09hqiNKBW|ȌL Q^ sX6C_^̨B L@ɧЖOeMN!7fT1bxKĄb a~8GAKb^dGфK#V{|:(CUr|F g ?$P? C%xIENDB`dialect-2.1.1/setup.cfg000066400000000000000000000001641432512702200147400ustar00rootroot00000000000000[flake8] max-line-length = 120 exclude = build-aux/flatpak max-complexity = 15 [pycodestyle] max-line-length = 120 dialect-2.1.1/subprojects/000077500000000000000000000000001432512702200154615ustar00rootroot00000000000000dialect-2.1.1/subprojects/blueprint-compiler.wrap000066400000000000000000000002621432512702200221700ustar00rootroot00000000000000[wrap-git] directory = blueprint-compiler url = https://gitlab.gnome.org/jwestman/blueprint-compiler.git revision = v0.4.0 depth = 1 [provide] program_names = blueprint-compiler