-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: whole course translations waffle (#34302)
* feat: add waffle flag for whole course translations * feat: put ai translations behind waffle * chore: add ai_translations to quality matrix * chore: add language and translation flag to courseware api (#34309) --------- Co-authored-by: Leangseu Kim <[email protected]>
- Loading branch information
1 parent
7cd15f2
commit 17e2f69
Showing
9 changed files
with
69 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Waffle config for the AI Translations service | ||
""" | ||
|
||
from openedx.core.djangoapps.waffle_utils import CourseWaffleFlag | ||
|
||
# Namespace | ||
WAFFLE_NAMESPACE = "ai_translations" | ||
LOG_PREFIX = "AI translations: " | ||
|
||
# .. toggle_name: SOME_FEATURE_NAME | ||
# .. toggle_implementation: CourseWaffleFlag | ||
# .. toggle_default: False | ||
# .. toggle_description: Enabling this feature allows course content to be sent to the AI Translations service | ||
# for automatic translation of course content. | ||
# .. toggle_warning: Requires ai-translations IDA to be available | ||
# .. toggle_use_cases: opt_in | ||
# .. toggle_creation_date: 2024-02-27 | ||
WHOLE_COURSE_TRANSLATIONS = CourseWaffleFlag( | ||
f"{WAFFLE_NAMESPACE}.whole_course_translations", __name__, LOG_PREFIX | ||
) | ||
|
||
|
||
def whole_course_translations_enabled_for_course(course_key): | ||
"""Helper to determine if whole course translation is enabled for the given context""" | ||
return WHOLE_COURSE_TRANSLATIONS.is_enabled(course_key=course_key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters