ol-openedx-course-translations 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ol-openedx-course-translations might be problematic. Click here for more details.

Files changed (35) hide show
  1. ol_openedx_course_translations/apps.py +12 -2
  2. ol_openedx_course_translations/glossaries/machine_learning/ar.txt +175 -0
  3. ol_openedx_course_translations/glossaries/machine_learning/de.txt +175 -0
  4. ol_openedx_course_translations/glossaries/machine_learning/el.txt +988 -0
  5. ol_openedx_course_translations/glossaries/machine_learning/es.txt +175 -0
  6. ol_openedx_course_translations/glossaries/machine_learning/fr.txt +175 -0
  7. ol_openedx_course_translations/glossaries/machine_learning/ja.txt +175 -0
  8. ol_openedx_course_translations/glossaries/machine_learning/pt-br.txt +175 -0
  9. ol_openedx_course_translations/glossaries/machine_learning/ru.txt +213 -0
  10. ol_openedx_course_translations/management/commands/sync_and_translate_language.py +1866 -0
  11. ol_openedx_course_translations/management/commands/translate_course.py +419 -470
  12. ol_openedx_course_translations/middleware.py +143 -0
  13. ol_openedx_course_translations/providers/__init__.py +1 -0
  14. ol_openedx_course_translations/providers/base.py +278 -0
  15. ol_openedx_course_translations/providers/deepl_provider.py +292 -0
  16. ol_openedx_course_translations/providers/llm_providers.py +565 -0
  17. ol_openedx_course_translations/settings/cms.py +17 -0
  18. ol_openedx_course_translations/settings/common.py +57 -30
  19. ol_openedx_course_translations/settings/lms.py +15 -0
  20. ol_openedx_course_translations/tasks.py +222 -0
  21. ol_openedx_course_translations/urls.py +16 -0
  22. ol_openedx_course_translations/utils/__init__.py +0 -0
  23. ol_openedx_course_translations/utils/command_utils.py +197 -0
  24. ol_openedx_course_translations/utils/constants.py +216 -0
  25. ol_openedx_course_translations/utils/course_translations.py +581 -0
  26. ol_openedx_course_translations/utils/translation_sync.py +808 -0
  27. ol_openedx_course_translations/views.py +73 -0
  28. ol_openedx_course_translations-0.3.0.dist-info/METADATA +407 -0
  29. ol_openedx_course_translations-0.3.0.dist-info/RECORD +35 -0
  30. ol_openedx_course_translations-0.3.0.dist-info/entry_points.txt +5 -0
  31. ol_openedx_course_translations-0.1.0.dist-info/METADATA +0 -63
  32. ol_openedx_course_translations-0.1.0.dist-info/RECORD +0 -11
  33. ol_openedx_course_translations-0.1.0.dist-info/entry_points.txt +0 -2
  34. {ol_openedx_course_translations-0.1.0.dist-info → ol_openedx_course_translations-0.3.0.dist-info}/WHEEL +0 -0
  35. {ol_openedx_course_translations-0.1.0.dist-info → ol_openedx_course_translations-0.3.0.dist-info}/licenses/LICENSE.txt +0 -0
@@ -0,0 +1,73 @@
1
+ """
2
+ API Views for ol_openedx_course_translations App
3
+ """
4
+
5
+ import logging
6
+
7
+ from opaque_keys import InvalidKeyError
8
+ from opaque_keys.edx.keys import CourseKey
9
+ from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
10
+ from rest_framework import status
11
+ from rest_framework.permissions import IsAuthenticated
12
+ from rest_framework.response import Response
13
+ from rest_framework.views import APIView
14
+
15
+ log = logging.getLogger(__name__)
16
+
17
+
18
+ class CourseLanguageView(APIView):
19
+ """
20
+ API View to retrieve the language of a specified course.
21
+
22
+ Sample Request:
23
+ GET /course-translations/api/course_language/{course_key}/
24
+
25
+ Sample Response:
26
+ 200 OK
27
+ {
28
+ "language": "en"
29
+ }
30
+
31
+ Error Responses:
32
+ 400 Bad Request
33
+ {
34
+ "error": "Invalid course_key."
35
+ }
36
+ 404 Not Found
37
+ {
38
+ "error": "Course not found."
39
+ }
40
+ 400 Bad Request
41
+ {
42
+ "error": "An unexpected error occurred."
43
+ }
44
+ """
45
+
46
+ permission_classes = [IsAuthenticated]
47
+
48
+ def get(self, request, course_key_string): # noqa: ARG002
49
+ """
50
+ Retrieve the language of the specified course.
51
+ """
52
+ try:
53
+ course_key = CourseKey.from_string(course_key_string)
54
+ course = CourseOverview.get_from_id(course_key)
55
+ except InvalidKeyError:
56
+ log.info("Invalid course key %s", course_key_string)
57
+ return Response(
58
+ {"error": "Invalid course_key."},
59
+ status=status.HTTP_400_BAD_REQUEST,
60
+ )
61
+ except CourseOverview.DoesNotExist:
62
+ log.info("Course not found for key %s", course_key_string)
63
+ return Response(
64
+ {"error": "Course not found."},
65
+ status=status.HTTP_404_NOT_FOUND,
66
+ )
67
+ except Exception:
68
+ log.exception("Unexpected error retrieving course %s", course_key_string)
69
+ return Response(
70
+ {"error": "An unexpected error occurred."},
71
+ status=status.HTTP_400_BAD_REQUEST,
72
+ )
73
+ return Response({"language": course.language})
@@ -0,0 +1,407 @@
1
+ Metadata-Version: 2.4
2
+ Name: ol-openedx-course-translations
3
+ Version: 0.3.0
4
+ Summary: An Open edX plugin to translate courses
5
+ Author: MIT Office of Digital Learning
6
+ License-Expression: BSD-3-Clause
7
+ License-File: LICENSE.txt
8
+ Keywords: Python,edx
9
+ Requires-Python: >=3.11
10
+ Requires-Dist: deepl>=1.25.0
11
+ Requires-Dist: django>=4.0
12
+ Requires-Dist: djangorestframework>=3.14.0
13
+ Requires-Dist: gitpython>=3.1.40
14
+ Requires-Dist: litellm>=1.0.0
15
+ Requires-Dist: polib>=1.2.0
16
+ Requires-Dist: requests>=2.31.0
17
+ Requires-Dist: srt>=3.5.3
18
+ Description-Content-Type: text/x-rst
19
+
20
+ OL Open edX Course Translations
21
+ ===============================
22
+
23
+ An Open edX plugin to manage course translations.
24
+
25
+ Purpose
26
+ *******
27
+
28
+ Translate course content into multiple languages to enhance accessibility for a global audience.
29
+
30
+ Setup
31
+ =====
32
+
33
+ For detailed installation instructions, please refer to the `plugin installation guide <../../docs#installation-guide>`_.
34
+
35
+ Installation required in:
36
+
37
+ * Studio (CMS)
38
+ * LMS (for auto language selection feature)
39
+
40
+ Configuration
41
+ =============
42
+
43
+ - Add the following configuration values to the config file in Open edX. For any release after Juniper, that config file is ``/edx/etc/lms.yml`` and ``/edx/etc/cms.yml``. If you're using ``private.py``, add these values to ``lms/envs/private.py`` and ``cms/envs/private.py``. These should be added to the top level. **Ask a fellow developer for these values.**
44
+
45
+ .. code-block:: python
46
+
47
+ # Enable auto language selection
48
+ ENABLE_AUTO_LANGUAGE_SELECTION: true
49
+
50
+ # Translation providers configuration
51
+ TRANSLATIONS_PROVIDERS: {
52
+ "default_provider": "mistral", # Default provider to use
53
+ "deepl": {
54
+ "api_key": "<YOUR_DEEPL_API_KEY>",
55
+ },
56
+ "openai": {
57
+ "api_key": "<YOUR_OPENAI_API_KEY>",
58
+ "default_model": "gpt-5.2",
59
+ },
60
+ "gemini": {
61
+ "api_key": "<YOUR_GEMINI_API_KEY>",
62
+ "default_model": "gemini-3-pro-preview",
63
+ },
64
+ "mistral": {
65
+ "api_key": "<YOUR_MISTRAL_API_KEY>",
66
+ "default_model": "mistral-large-latest",
67
+ },
68
+ }
69
+ TRANSLATIONS_GITHUB_TOKEN: <YOUR_GITHUB_TOKEN>
70
+ TRANSLATIONS_REPO_PATH: ""
71
+ TRANSLATIONS_REPO_URL: "https://github.com/mitodl/mitxonline-translations.git"
72
+
73
+ - For Tutor installations, these values can also be managed through a `custom Tutor plugin <https://docs.tutor.edly.io/tutorials/plugin.html#plugin-development-tutorial>`_.
74
+
75
+ Translation Providers
76
+ =====================
77
+
78
+ The plugin supports multiple translation providers:
79
+
80
+ - DeepL
81
+ - OpenAI (GPT models)
82
+ - Gemini (Google)
83
+ - Mistral
84
+
85
+ **Configuration**
86
+
87
+ All providers are configured through the ``TRANSLATIONS_PROVIDERS`` dictionary in your settings:
88
+
89
+ .. code-block:: python
90
+
91
+ TRANSLATIONS_PROVIDERS = {
92
+ "default_provider": "mistral", # Optional: default provider for commands
93
+ "deepl": {
94
+ "api_key": "<YOUR_DEEPL_API_KEY>",
95
+ },
96
+ "openai": {
97
+ "api_key": "<YOUR_OPENAI_API_KEY>",
98
+ "default_model": "gpt-5.2", # Optional: used when model not specified
99
+ },
100
+ "gemini": {
101
+ "api_key": "<YOUR_GEMINI_API_KEY>",
102
+ "default_model": "gemini-3-pro-preview",
103
+ },
104
+ "mistral": {
105
+ "api_key": "<YOUR_MISTRAL_API_KEY>",
106
+ "default_model": "mistral-large-latest",
107
+ },
108
+ }
109
+
110
+ **Important Notes:**
111
+
112
+ 1. **DeepL Configuration**: DeepL must be configured in ``TRANSLATIONS_PROVIDERS['deepl']['api_key']``.
113
+
114
+ 2. **DeepL for Subtitle Repair**: DeepL is used as a fallback repair mechanism for subtitle translations when LLM providers fail validation. Even if you use LLM providers for primary translation, you should configure DeepL to enable automatic repair.
115
+
116
+ 3. **Default Models**: The ``default_model`` in each provider's configuration is used when you specify a provider without a model (e.g., ``openai`` instead of ``openai/gpt-5.2``).
117
+
118
+ **Provider Selection**
119
+
120
+ You can specify providers in three ways:
121
+
122
+ 1. **Provider only** (uses default model from settings):
123
+
124
+ .. code-block:: bash
125
+
126
+ ./manage.py cms translate_course \
127
+ --target-language AR \
128
+ --course-dir /path/to/course.tar.gz \
129
+ --content-translation-provider openai \
130
+ --srt-translation-provider gemini
131
+
132
+ 2. **Provider with specific model**:
133
+
134
+ .. code-block:: bash
135
+
136
+ ./manage.py cms translate_course \
137
+ --target-language AR \
138
+ --course-dir /path/to/course.tar.gz \
139
+ --content-translation-provider openai/gpt-5.2 \
140
+ --srt-translation-provider gemini/gemini-3-pro-preview
141
+
142
+ 3. **DeepL** (no model needed):
143
+
144
+ .. code-block:: bash
145
+
146
+ ./manage.py cms translate_course \
147
+ --target-language AR \
148
+ --course-dir /path/to/course.tar.gz \
149
+ --content-translation-provider deepl \
150
+ --srt-translation-provider deepl
151
+
152
+ **Note:** If you specify a provider without a model (e.g., ``openai`` instead of ``openai/gpt-5.2``), the system will use the ``default_model`` configured in ``TRANSLATIONS_PROVIDERS`` for that provider.
153
+
154
+ Translating a Course
155
+ ====================
156
+ 1. Open the course in Studio.
157
+ 2. Go to Tools -> Export Course.
158
+ 3. Export the course as a .tar.gz file.
159
+ 4. Go to the CMS shell
160
+ 5. Run the management command to translate the course:
161
+
162
+ .. code-block:: bash
163
+
164
+ ./manage.py cms translate_course \
165
+ --source-language EN \
166
+ --target-language AR \
167
+ --course-dir /path/to/course.tar.gz \
168
+ --content-translation-provider openai \
169
+ --srt-translation-provider gemini \
170
+ --glossary-dir /path/to/glossary
171
+
172
+ **Command Options:**
173
+
174
+ - ``--source-language``: Source language code (default: EN)
175
+ - ``--target-language``: Target language code (required)
176
+ - ``--course-dir``: Path to exported course tar.gz file (required)
177
+ - ``--content-translation-provider``: Translation provider for content (XML/HTML and text) (required).
178
+
179
+ Format:
180
+
181
+ - ``deepl`` - uses DeepL (no model needed)
182
+ - ``PROVIDER`` - uses provider with default model from settings (e.g., ``openai``, ``gemini``, ``mistral``)
183
+ - ``PROVIDER/MODEL`` - uses provider with specific model (e.g., ``openai/gpt-5.2``, ``gemini/gemini-3-pro-preview``, ``mistral/mistral-large-latest``)
184
+
185
+ - ``--srt-translation-provider``: Translation provider for SRT subtitles (required). Same format as ``--content-translation-provider``
186
+ - ``--glossary-dir``: Path to glossary directory (optional)
187
+
188
+ **Examples:**
189
+
190
+ .. code-block:: bash
191
+
192
+ # Use DeepL for both content and subtitles
193
+ ./manage.py cms translate_course \
194
+ --target-language AR \
195
+ --course-dir /path/to/course.tar.gz \
196
+ --content-translation-provider deepl \
197
+ --srt-translation-provider deepl
198
+
199
+ # Use OpenAI and Gemini with default models from settings
200
+ ./manage.py cms translate_course \
201
+ --target-language FR \
202
+ --course-dir /path/to/course.tar.gz \
203
+ --content-translation-provider openai \
204
+ --srt-translation-provider gemini
205
+
206
+ # Use OpenAI with specific model for content, Gemini with default for subtitles
207
+ ./manage.py cms translate_course \
208
+ --target-language FR \
209
+ --course-dir /path/to/course.tar.gz \
210
+ --content-translation-provider openai/gpt-5.2 \
211
+ --srt-translation-provider gemini
212
+
213
+ # Use Mistral with specific model and glossary
214
+ ./manage.py cms translate_course \
215
+ --target-language ES \
216
+ --course-dir /path/to/course.tar.gz \
217
+ --content-translation-provider mistral/mistral-large-latest \
218
+ --srt-translation-provider mistral/mistral-large-latest \
219
+ --glossary-dir /path/to/glossary
220
+
221
+ **Glossary Support:**
222
+
223
+ Create language-specific glossary files in the glossary directory:
224
+
225
+ .. code-block:: bash
226
+
227
+ glossaries/machine_learning/
228
+ ├── ar.txt # Arabic glossary
229
+ ├── fr.txt # French glossary
230
+ └── es.txt # Spanish glossary
231
+
232
+ Format: One term per line as "source_term : translated_term"
233
+
234
+ .. code-block:: text
235
+
236
+ # ES HINTS
237
+ ## TERM MAPPINGS
238
+ These are preferred terminology choices for this language. Use them whenever they sound natural; adapt freely if context requires.
239
+
240
+ - 'accuracy' : 'exactitud'
241
+ - 'activation function' : 'función de activación'
242
+ - 'artificial intelligence' : 'inteligencia artificial'
243
+ - 'AUC' : 'AUC'
244
+
245
+ Subtitle Translation and Validation
246
+ ====================================
247
+
248
+ The course translation system includes robust subtitle (SRT) translation with automatic validation and repair mechanisms to ensure high-quality translations with preserved timing information.
249
+
250
+ **Translation Process**
251
+
252
+ The subtitle translation follows a multi-stage process with built-in quality checks:
253
+
254
+ 1. **Initial Translation**: Subtitles are translated using your configured provider (DeepL or LLM)
255
+ 2. **Validation**: Timestamps, subtitle count, and content are validated to ensure integrity
256
+ 3. **Automatic Retry**: If validation fails, the system automatically retries translation (up to 1 additional attempt)
257
+ 4. **DeepL Repair Fallback**: If retries fail, the system automatically falls back to DeepL for repair
258
+
259
+ **Why DeepL for Repair?**
260
+
261
+ When subtitle translations fail validation (mismatched timestamps, incorrect subtitle counts, or blank translations), the system automatically uses **DeepL as a repair mechanism**, regardless of which provider was initially used. This design choice is based on extensive testing and production experience:
262
+
263
+ - **Higher Reliability**: LLMs frequently fail to preserve subtitle structure and timestamps correctly, even with detailed prompting
264
+ - **Consistent Formatting**: DeepL's specialized subtitle translation API maintains timing precision through XML tag handling
265
+ - **Lower Failure Rate**: DeepL demonstrates significantly better success rates for subtitle translation compared to LLMs
266
+ - **Timestamp Preservation**: DeepL's built-in XML tag handling ensures start and end times remain intact during translation
267
+
268
+
269
+ **Validation Rules**
270
+
271
+ The system validates subtitle translations against these criteria:
272
+
273
+ - **Subtitle Count**: Translated file must have the same number of subtitle blocks as the original
274
+ - **Index Matching**: Each subtitle block index must match the original (e.g., if original has blocks 1-100, translation must have blocks 1-100 in the same order)
275
+ - **Timestamp Preservation**: Start and end times for each subtitle block must remain unchanged
276
+ - **Content Validation**: Non-empty original subtitles must have non-empty translations (blank translations are flagged as errors)
277
+
278
+ **Example Validation Process:**
279
+
280
+ .. code-block:: text
281
+
282
+ 1. Initial Translation (using OpenAI):
283
+ ✓ 150 subtitle blocks translated
284
+ ✗ Validation failed: 3 blocks have mismatched timestamps
285
+
286
+ 2. Retry Attempt:
287
+ ✓ 150 subtitle blocks translated
288
+ ✗ Validation failed: 2 blocks still have issues
289
+
290
+ 3. DeepL Repair:
291
+ ✓ 150 subtitle blocks retranslated using DeepL
292
+ ✓ Validation passed: All timestamps and content validated
293
+ ✅ Translation completed successfully
294
+
295
+ **Failure Handling**
296
+
297
+ If subtitle repair fails after all attempts (including DeepL fallback):
298
+
299
+ - The translation task will fail with a ``ValueError``
300
+ - The entire course translation will be aborted to prevent incomplete translations
301
+ - The translated course directory will be automatically cleaned up
302
+ - An error message will indicate which subtitle file caused the failure
303
+ - No partial or corrupted translation files will be left behind
304
+
305
+ Auto Language Selection
306
+ =======================
307
+
308
+ The plugin includes an auto language selection feature that automatically sets the user's language preference based on the course language. When enabled, users will see the static site content in the course's configured language.
309
+
310
+ To enable auto language selection:
311
+
312
+ 1. Set ``ENABLE_AUTO_LANGUAGE_SELECTION`` to ``true`` in your settings.
313
+
314
+ 2. Set ``SHARED_COOKIE_DOMAIN`` to your domain (e.g., ``.local.openedx.io`` for local tutor setup) to allow cookies to be shared between LMS and CMS.
315
+
316
+ **How it works:**
317
+
318
+ - **LMS**: The ``CourseLanguageCookieMiddleware`` automatically detects course URLs and sets the language preference based on the course's configured language.
319
+ - **CMS**: The ``CourseLanguageCookieResetMiddleware`` ensures Studio always uses English for the authoring interface.
320
+ - **Admin areas**: Admin URLs (``/admin``, ``/sysadmin``, instructor dashboards) are forced to use English regardless of course language.
321
+
322
+ MFE Integration
323
+ ===============
324
+
325
+ To make auto language selection work with Micro-Frontends (MFEs), you need to use a custom Footer component that handles language detection and switching.
326
+
327
+ **Setup:**
328
+
329
+ 1. Use the Footer component from `src/bridge/settings/openedx/mfe/slot_config/Footer.jsx <https://github.com/mitodl/ol-infrastructure/blob/main/src/bridge/settings/openedx/mfe/slot_config/Footer.jsx>`_ in the `ol-infrastructure <https://github.com/mitodl/ol-infrastructure>`_ repository.
330
+
331
+ 2. Enable auto language selection in each MFE by adding the following to their ``.env.development`` file:
332
+
333
+ .. code-block:: bash
334
+
335
+ ENABLE_AUTO_LANGUAGE_SELECTION="true"
336
+
337
+ 3. This custom Footer component:
338
+ - Detects the current course context in MFEs
339
+ - Automatically switches the MFE language based on the course's configured language
340
+ - Ensures consistent language experience across the platform
341
+
342
+ 4. Configure your MFE slot overrides to use this custom Footer component instead of the default one.
343
+
344
+ **Note:** The custom Footer is required because MFEs run as separate applications and need their own mechanism to detect and respond to course language settings. The environment variable must be set in each MFE's configuration for the feature to work properly.
345
+
346
+ Generating static content translations
347
+ ======================================
348
+
349
+ This command synchronizes translation keys from edx-platform and MFE's, translates empty keys using LLM, and automatically creates a pull request in the translations repository.
350
+
351
+ **What it does:**
352
+
353
+ 1. Syncs translation keys from edx-platform and MFE's to the translations repository
354
+ 2. Extracts empty translation keys that need translation
355
+ 3. Translates empty keys using the specified LLM provider and model
356
+ 4. Applies translations to JSON and PO files
357
+ 5. Commits changes to a new branch
358
+ 6. Creates a pull request with translation statistics
359
+
360
+ **Usage:**
361
+
362
+ 1. Go to the CMS shell
363
+ 2. Run the management command:
364
+
365
+ .. code-block:: bash
366
+
367
+ ./manage.py cms sync_and_translate_language <LANGUAGE_CODE> [OPTIONS]
368
+
369
+ **Required arguments:**
370
+
371
+ - ``LANGUAGE_CODE``: Language code (e.g., ``el``, ``fr``, ``es_ES``)
372
+
373
+ **Optional arguments:**
374
+
375
+ - ``--iso-code``: ISO code for JSON files (default: same as language code)
376
+ - ``--provider``: Translation provider (``openai``, ``gemini``, ``mistral``). Default is taken from ``TRANSLATIONS_PROVIDERS['default_provider']`` setting
377
+ - ``--model``: LLM model name. If not specified, uses the ``default_model`` for the selected provider from ``TRANSLATIONS_PROVIDERS``. Examples: ``gpt-5.2``, ``gemini-3-pro-preview``, ``mistral-large-latest``
378
+ - ``--repo-path``: Path to mitxonline-translations repository (can also be set via ``TRANSLATIONS_REPO_PATH`` setting or environment variable)
379
+ - ``--repo-url``: GitHub repository URL (default: ``https://github.com/mitodl/mitxonline-translations.git``, can also be set via ``TRANSLATIONS_REPO_URL`` setting or environment variable)
380
+ - ``--glossary``: Use glossary from plugin glossaries folder (looks for ``{plugin_dir}/glossaries/machine_learning/{lang_code}.txt``)
381
+ - ``--batch-size``: Number of keys to translate per API request (default: 200, recommended: 200-300 for most models)
382
+ - ``--mfe``: Filter by specific MFE(s). Use ``edx-platform`` for backend translations
383
+ - ``--dry-run``: Run without committing or creating PR
384
+
385
+ **Examples:**
386
+
387
+ .. code-block:: bash
388
+
389
+ # Use default provider (from TRANSLATIONS_PROVIDERS['default_provider']) with its default model
390
+ ./manage.py cms sync_and_translate_language el
391
+
392
+ # Use OpenAI provider with its default model (gpt-5.2)
393
+ ./manage.py cms sync_and_translate_language el --provider openai
394
+
395
+ # Use OpenAI provider with a specific model
396
+ ./manage.py cms sync_and_translate_language el --provider openai --model gpt-5.2
397
+
398
+ # Use Mistral provider with a specific model and glossary
399
+ ./manage.py cms sync_and_translate_language el --provider mistral --model mistral-large-latest --glossary --batch-size 250
400
+
401
+ License
402
+ *******
403
+
404
+ The code in this repository is licensed under the AGPL 3.0 unless
405
+ otherwise noted.
406
+
407
+ Please see `LICENSE.txt <LICENSE.txt>`_ for details.
@@ -0,0 +1,35 @@
1
+ ol_openedx_course_translations/__init__.py,sha256=qddojx2E0sw3CdZ_iyjwt3iTN_oTPCo1iPtRMSEgyHA,50
2
+ ol_openedx_course_translations/apps.py,sha256=F99ZzLzMIZB85uNEy2tIlvMM1JTf16XnTcpJY6FguIs,1013
3
+ ol_openedx_course_translations/middleware.py,sha256=pdcygHc-UdKOoaWDvZJIDWCr9o1jNHqzefCQZl2aJmw,4556
4
+ ol_openedx_course_translations/tasks.py,sha256=fxxd4mMV8HxtOY-y6kvM-oNjoif4iJE-V2aVyFua0OE,8071
5
+ ol_openedx_course_translations/urls.py,sha256=wDlOrRTtV_YRXAA1lpIhjEEf_fNkyfZUtmVPMD1PEi8,385
6
+ ol_openedx_course_translations/views.py,sha256=ESDmgSFAvyHKQE9s2hthyNgRZmMuLNWvfrGkR4isoec,2173
7
+ ol_openedx_course_translations/glossaries/machine_learning/ar.txt,sha256=f8Ga8GV3qXFVvmlYx3JAfBC-HNIMW5FbLrqTR_jIwWM,9065
8
+ ol_openedx_course_translations/glossaries/machine_learning/de.txt,sha256=dEQx_qeeMc5DMAwKM4liRuGor0ZJu0zxsseD3npJyeE,7865
9
+ ol_openedx_course_translations/glossaries/machine_learning/el.txt,sha256=i8dtMpI0S1sYcjej-kvzdXCXnoAsjETiPx43kvVsOT8,67171
10
+ ol_openedx_course_translations/glossaries/machine_learning/es.txt,sha256=mM5PAW6Jv7qd--saDJdVRwvPHnOe1RPnd3uUX_ckfOQ,7694
11
+ ol_openedx_course_translations/glossaries/machine_learning/fr.txt,sha256=q3JEPWa-C6GeY2vZhB528vERmhgUTgYiRmRn1vSsJCI,7892
12
+ ol_openedx_course_translations/glossaries/machine_learning/ja.txt,sha256=Xa83zxPdwfN05QB2H4NfzkFZyYsKoruoJ3e9D-ka2fY,8028
13
+ ol_openedx_course_translations/glossaries/machine_learning/pt-br.txt,sha256=68_mu_IEZpC-jswmrpEDiq3R86IF0zMdJ6Km7kCiDM4,7507
14
+ ol_openedx_course_translations/glossaries/machine_learning/ru.txt,sha256=d-p1UcxBy7cz0MJfB35sBQIOHV27PK9nIXpFfVEDGMU,11984
15
+ ol_openedx_course_translations/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ ol_openedx_course_translations/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
+ ol_openedx_course_translations/management/commands/sync_and_translate_language.py,sha256=E2sLaXYBTI1qCYcocV022Q-06y9iIA1YTMN5rHsb078,70176
18
+ ol_openedx_course_translations/management/commands/translate_course.py,sha256=L7wWlfiRq4swVaySV6kcCs0rRT0RIxkl_Qw4A628m_M,20486
19
+ ol_openedx_course_translations/providers/__init__.py,sha256=ZTWIG9KsYXYElfr-QwMsId7l6Sh6MypDKCWTivk3PME,48
20
+ ol_openedx_course_translations/providers/base.py,sha256=-1QV7w-6Wpwz4EMzCiOOuWOG2kDw4b2gZ1KSK6GFVLM,9264
21
+ ol_openedx_course_translations/providers/deepl_provider.py,sha256=hPuLVEZLU3Dm6a9H-8ztpcX53K9gUA8e57jUzn_HsKU,10076
22
+ ol_openedx_course_translations/providers/llm_providers.py,sha256=L3MwmQI2appwn8FTKzZhRfq_FNauP1ei0kenY-yBcgc,19369
23
+ ol_openedx_course_translations/settings/cms.py,sha256=SzoTxVUlvlWvjQ58GCoVygHjoMNAH3InME7T9K6dTQ4,392
24
+ ol_openedx_course_translations/settings/common.py,sha256=2UksaEnYLJFDdpzB7wTwgpoPkJ8X7z2wK9glHSCm88o,1733
25
+ ol_openedx_course_translations/settings/lms.py,sha256=4u6BjqxWcWHpMgxlgF4lNs7H9pDgKTQrEtjdhOg7Qv0,365
26
+ ol_openedx_course_translations/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ ol_openedx_course_translations/utils/command_utils.py,sha256=GRSGIBKm6ZnRCnv5oVRzxhS6UFwvjmNeJkvCEpLCks0,6482
28
+ ol_openedx_course_translations/utils/constants.py,sha256=D3ICk0OmMHFdERShJ9eq5MaTaXHLVaUcVO3ZIg_3umQ,8141
29
+ ol_openedx_course_translations/utils/course_translations.py,sha256=jlGYsIj7PBJRrPVDZt3Q4-QbwJKhHswaZPZPeicFAjE,20647
30
+ ol_openedx_course_translations/utils/translation_sync.py,sha256=IQL-auVk5GwSfUfyeGICUDhd1KPxZs_bthAzRYm9LSs,26739
31
+ ol_openedx_course_translations-0.3.0.dist-info/METADATA,sha256=YVqZ0XOrw8_5P1eUB4S4U92MF7ilsy7SDX1xHWz0n5Y,16716
32
+ ol_openedx_course_translations-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
33
+ ol_openedx_course_translations-0.3.0.dist-info/entry_points.txt,sha256=FPeAXhaGYIZqafskkDD8xPiljXJ6djil27_kTuNP0BI,239
34
+ ol_openedx_course_translations-0.3.0.dist-info/licenses/LICENSE.txt,sha256=iVk4rSDx0SwrA7AriwFblTY0vUxpuVib1oqJEEeejN0,1496
35
+ ol_openedx_course_translations-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ [cms.djangoapp]
2
+ ol_openedx_course_translations = ol_openedx_course_translations.apps:OLOpenedXCourseTranslationsConfig
3
+
4
+ [lms.djangoapp]
5
+ ol_openedx_course_translations = ol_openedx_course_translations.apps:OLOpenedXCourseTranslationsConfig
@@ -1,63 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ol-openedx-course-translations
3
- Version: 0.1.0
4
- Summary: An Open edX plugin to translate courses
5
- Author: MIT Office of Digital Learning
6
- License-Expression: BSD-3-Clause
7
- License-File: LICENSE.txt
8
- Keywords: Python,edx
9
- Requires-Python: >=3.11
10
- Requires-Dist: deepl>=1.25.0
11
- Requires-Dist: django>=4.0
12
- Requires-Dist: djangorestframework>=3.14.0
13
- Description-Content-Type: text/x-rst
14
-
15
- OL Open edX Course Translations
16
- ===============================
17
-
18
- An Open edX plugin to manage course translations.
19
-
20
- Purpose
21
- *******
22
-
23
- Translate course content into multiple languages to enhance accessibility for a global audience.
24
-
25
- Setup
26
- =====
27
-
28
- For detailed installation instructions, please refer to the `plugin installation guide <../../docs#installation-guide>`_.
29
-
30
- Installation required in:
31
-
32
- * Studio (CMS)
33
-
34
- Configuration
35
- =============
36
-
37
- - Add the following configuration values to the config file in Open edX. For any release after Juniper, that config file is ``/edx/etc/lms.yml``. If you're using ``private.py``, add these values to ``lms/envs/private.py``. These should be added to the top level. **Ask a fellow developer for these values.**
38
-
39
- .. code-block:: python
40
-
41
- DEEPL_API_KEY: <YOUR_DEEPL_API_KEY_HERE>
42
-
43
- - For Tutor installations, these values can also be managed through a `custom Tutor plugin <https://docs.tutor.edly.io/tutorials/plugin.html#plugin-development-tutorial>`_.
44
-
45
- Usage
46
- ====================
47
- 1. Open the course in Studio.
48
- 2. Go to Tools -> Export Course.
49
- 3. Export the course as a .tar.gz file.
50
- 4. Go to the CMS shell
51
- 5. Run the management command to translate the course:
52
-
53
- .. code-block:: bash
54
-
55
- ./manage.py cms translate_course --source-language <SOURCE_LANGUAGE_CODE, defaults to `EN`> --translation-language <TRANSLATION_LANGUAGE_CODE i.e. AR> --course-dir <PATH_TO_EXPORTED_COURSE_TAR_GZ>
56
-
57
- License
58
- *******
59
-
60
- The code in this repository is licensed under the AGPL 3.0 unless
61
- otherwise noted.
62
-
63
- Please see `LICENSE.txt <LICENSE.txt>`_ for details.
@@ -1,11 +0,0 @@
1
- ol_openedx_course_translations/__init__.py,sha256=qddojx2E0sw3CdZ_iyjwt3iTN_oTPCo1iPtRMSEgyHA,50
2
- ol_openedx_course_translations/apps.py,sha256=AUjqONJsiuip2qG4R_CmQ1IIXoFvdEt-_G64-YWtntU,637
3
- ol_openedx_course_translations/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- ol_openedx_course_translations/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- ol_openedx_course_translations/management/commands/translate_course.py,sha256=0H4jFC-9zbE3uMl325HW6kCXUnA4MgiS2X6Osg8xKB8,21781
6
- ol_openedx_course_translations/settings/common.py,sha256=lzxBIJ1K8upO8Zv6WESl42NUX0xnX5otd0eEa_ko_-c,1074
7
- ol_openedx_course_translations-0.1.0.dist-info/METADATA,sha256=s2ujGEgFhgJpWUoVxWWgNdmx1FKNSC66-Fc-vXV0G2A,1994
8
- ol_openedx_course_translations-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
9
- ol_openedx_course_translations-0.1.0.dist-info/entry_points.txt,sha256=07_M_0RSXTPpCQcstKi9xP27jZY-pSwZeeMrGX0mEf8,119
10
- ol_openedx_course_translations-0.1.0.dist-info/licenses/LICENSE.txt,sha256=iVk4rSDx0SwrA7AriwFblTY0vUxpuVib1oqJEEeejN0,1496
11
- ol_openedx_course_translations-0.1.0.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [cms.djangoapp]
2
- ol_openedx_course_translations = ol_openedx_course_translations.apps:OLOpenedXCourseTranslationsConfig