feat: construct and index Spanish Algolia objects for skills, jobs and industries#307
Open
rgopalrao-sonata-png wants to merge 2 commits into
Open
feat: construct and index Spanish Algolia objects for skills, jobs and industries#307rgopalrao-sonata-png wants to merge 2 commits into
rgopalrao-sonata-png wants to merge 2 commits into
Conversation
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