feat: construct and index Spanish Algolia objects for skills, jobs and industries - #307
Merged
marlonkeating merged 1 commit intoJun 2, 2026
Merged
Conversation
marlonkeating
requested changes
May 29, 2026
marlonkeating
left a comment
Contributor
There was a problem hiding this comment.
Reviewed with assistance from Claude Sonnet 4.6
rgopalrao-sonata-png
force-pushed
the
rgopalrao/11386
branch
2 times, most recently
from
June 1, 2026 04:29
869f3df to
dea652e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds multi-locale (starting with Spanish) support to the Algolia jobs index by duplicating English job records into per-locale variants using TaxonomyTranslation, and indexing all languages in one atomic Algolia replace operation.
Changes:
- Build translation lookup maps and helper translators for jobs/skills/industries; generate localized job-record variants per configured locale.
- Stamp English records with
metadata_language='en'and addlanguage_sort_priorityto enforce English-first ranking. - Add Algolia index settings updates and a new comprehensive test suite for translation behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| taxonomy/algolia/utils.py | Adds translation map builders, record translation helpers, localized job record generation, and multi-locale indexing flow. |
| taxonomy/algolia/constants.py | Adds metadata_language faceting and language_sort_priority custom ranking; defines enabled locales list. |
| taxonomy/tests/test_algolia_translations.py | New tests covering translation mapping and indexing behavior across locales. |
| taxonomy/init.py | Version bump to 3.0.0. |
| CHANGELOG.rst | Adds 3.0.0 changelog entry for the localization/indexing feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rgopalrao-sonata-png
force-pushed
the
rgopalrao/11386
branch
2 times, most recently
from
June 1, 2026 14:19
86ed181 to
726bc7a
Compare
marlonkeating
approved these changes
Jun 1, 2026
rgopalrao-sonata-png
force-pushed
the
rgopalrao/11386
branch
from
June 2, 2026 10:01
726bc7a to
0d05b49
Compare
…d industries test: improve algolia translation coverage fix: address review comments - external_id skill keys, early return, searchable metadata_language
rgopalrao-sonata-png
force-pushed
the
rgopalrao/11386
branch
from
June 2, 2026 10:17
0d05b49 to
77daada
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JIRA: https://2u-internal.atlassian.net/browse/ENT-11386
Re-raises and rebases #286 onto the latest
master.Summary
Implements Spanish (and extensible multi-language) localization for the Algolia jobs index. For each enabled locale in
TAXONOMY_TRANSLATION_LOCALES, a duplicate set of Algolia records is created with translated names and descriptions from the existingTaxonomyTranslationmodel. All records (English + localized) are indexed in a single atomic operation with zero downtime.Key Changes
taxonomy/algolia/utils.pybuild_name_translation_maps(language_code)— builds{English name → Translated name}dicts for jobs/skills/industries using one DB query per locale (O(1) lookup during translation)translate_skill_dict,translate_industries_array,translate_job_record— translation helpers that preserve schema and fall back to English when no translation existscreate_localized_job_records— orchestrates building translation maps and producing localized job variantsindex_jobs_data_in_algolia— loops overTAXONOMY_TRANSLATION_LOCALES, appends localized batches before the atomic Algolia writefetch_jobs_data— stamps each English record withmetadata_language: 'en'taxonomy/algolia/constants.pymetadata_languageadded to Algolia searchable attributes andcustomRankingTAXONOMY_TRANSLATION_LOCALES = ['es']— add more ISO codes to enable additional languages, zero code changes neededtaxonomy/tests/test_algolia_translations.py(new, 519 lines)Version
2.4.0→3.0.0Merge Checklist
TaxonomyTranslationmodel)3.0.0)upstream/master(68c3f24)Post Merge
3.0.0on PyPI