Skip to content

feat: translate skills, jobs and industries#285

Merged
muhammad-ammar merged 1 commit intomasterfrom
ammar/translate-jobs-industries-and-skills
Jan 29, 2026
Merged

feat: translate skills, jobs and industries#285
muhammad-ammar merged 1 commit intomasterfrom
ammar/translate-jobs-industries-and-skills

Conversation

@muhammad-ammar
Copy link
Contributor

@muhammad-ammar muhammad-ammar commented Jan 26, 2026

JIRA: https://2u-internal.atlassian.net/browse/ENT-11386

Add Taxonomy Translation Management Command

Summary

Adds populate_taxonomy_translations command to translate taxonomy data (jobs, skills, industries) from English to target languages using Xpert AI.

Changes

1. New Model: TaxonomyTranslation

  • Stores translations with source_hash for change detection
  • Unique constraint: (external_id, content_type, language_code)
  • Indexed for performance

2. Translation Utilities: taxonomy/translation_utils.py

  • translate_item_with_xpert(): Translates using Xpert AI
  • TranslationError: Validation exception
  • Supports: Spanish (es)

3. Management Command

# Basic usage
python manage.py populate_taxonomy_translations --language es

# Options
--content-type {job|skill|industry|all}  # Default: all
--batch-size N                            # Default: 100
--force                                   # Force retranslation

Merge checklist:

  • Any new requirements are in the right place (do not manually modify the requirements/*.txt files)
    • make upgrade && make requirements have been run to regenerate requirements
  • ./manage.py makemigrations has been run
    • Checkout the Database Migration Confluence page for helpful tips on creating migrations.
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.
  • Version bumped
  • Changelog record added

Post merge:

  • Tag pushed and a new version released
    • Note: Assets will be added automatically. You just need to provide a tag (should match your version number) and title and description.
  • After versioned build finishes in GitHub Actions, verify version has been pushed to PyPI
    • Each step in the release build has a condition flag that checks if the rest of the steps are done and if so will deploy to PyPi.
      (so basically once your build finishes, after maybe a minute you should see the new version in PyPi automatically (on refresh))
  • PR created in course-discovery to upgrade dependencies (including taxonomy-connector)
    • This must be done after the version is visible in PyPi as make upgrade in course-discovery will look for the latest version in PyPi.

@muhammad-ammar muhammad-ammar marked this pull request as draft January 26, 2026 13:25
@muhammad-ammar muhammad-ammar force-pushed the ammar/translate-jobs-industries-and-skills branch 11 times, most recently from 1b46b2b to 4be04bb Compare January 28, 2026 17:49
@muhammad-ammar muhammad-ammar marked this pull request as ready for review January 28, 2026 17:57
@muhammad-ammar muhammad-ammar force-pushed the ammar/translate-jobs-industries-and-skills branch 5 times, most recently from b3a3bca to d43b386 Compare January 29, 2026 05:05
@muhammad-ammar muhammad-ammar force-pushed the ammar/translate-jobs-industries-and-skills branch from d43b386 to 6f6bf38 Compare January 29, 2026 05:24
@muhammad-ammar muhammad-ammar merged commit 33b9645 into master Jan 29, 2026
10 checks passed
@muhammad-ammar muhammad-ammar deleted the ammar/translate-jobs-industries-and-skills branch January 29, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants