Skip to main content

template GitHub license

CHANGELOG CONTRIBUTING CODE_OF_CONDUCT PULL_REQUEST_TEMPLATE

Dox-docs_Translator

Content

Overview

For popular programming languages such as C++, C, C#, Java, Python, etc., Doxygen is used to compile the documentation - software that generates documentation from comments of the established style in the project raws. For the generation of multilingual documentation, storing documentation comments in raw is bad, since in this case it is possible to write documentation in only one language. To solve this problem, Doxygen supports files with the .dox extension. That is, documenting comments can be exported from the code to a .dox file and several copies of it can be made with different translations. Since writing a translation takes a lot of time and it is easier to turn to Google translator - I decided to write this script.

The script opens the documentation file, reads it, breaks it into separate parts and translates the documentation part by part.

LICENSE

The full text of the license can be found at the following link.

Copyright © 2022 Kalynovsky Valentin. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and

Usage

To install the library, you need to execute the command:

pip install dox-docs-translator

Installing the dox_docs_translator library should also install googletrans, but if the googletrans library is not installed or this script doesn't work, you need to install/reinstall the googletrans:

pip uninstall googletrans
pip install googletrans==4.0.0-rc1

Here is an example of using the script from my own experience, as I used it to translate the documentation of my ALGOR project:

from dox_docs_translator import *

if __name__ == '__main__':
    doc_translator = DoxDocsTranslator()
    doc_translator.start_global_translate()

In this case, the DOCUMENTATION.ua.dox file will be translated from Ukrainian to English into the DOCUMENTATION.en.dox file. If you need to change these values, you can specify them in the class constructor:

from dox_docs_translator import *

if __name__ == '__main__':
    doc_translator = DoxDocsTranslator('docs_file.dox', 'translated_docs.dox', 'en', 'fr')
    doc_translator.start_global_translate()

or

from dox_docs_translator import *

if __name__ == '__main__':
    doc_translator = DoxDocsTranslator(from_lang='en',
                                       origin_doc_file='docs_file.dox',
                                       to_lang='fr',
                                       translated_doc_file='translated_docs.dox')
    doc_translator.start_global_translate()

Artifacts may appear after translation. This happens during translation, and therefore the errors are not related to this library. After the translation, you should view the received file and correct the artifacts yourself.

Troubleshooting

All algorithms have been tested by me, but if you have problems using the library, the code does not work, have suggestions for optimization or advice to improve the style of the code and the name - I invite you here and here.

Authors


Kalynovsky Valentin

"Ideological inspirer and Author"

Metadata

Release files for dox-docs-translator 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dox-docs-translator 0.1.1
File Size Uploaded
dox_docs_translator-0.1.1.tar.gz 9.3 kB Details

Release files / dox_docs_translator-0.1.1.tar.gz

Download URL dox_docs_translator-0.1.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4b56eb46f54f3a412160b9d36bd2ab39495f538f557c2d0994cce758bc34ef79
BLAKE2b-256 checksum
How to use checksums
fcbbf120af681c060c5398947f9381683b031eba6291ba18ea195b54ed4fd44e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page