Skip to content

feat: replace languages api with languages from distribution#330

Merged
andrii-bodnar merged 3 commits intomasterfrom
feat/new-languages-api
Feb 5, 2026
Merged

feat: replace languages api with languages from distribution#330
andrii-bodnar merged 3 commits intomasterfrom
feat/new-languages-api

Conversation

@MykhailoNester
Copy link
Collaborator

@MykhailoNester MykhailoNester commented Jan 14, 2026

  • replace languages api with languages from distribution;
  • update logic for supported languages and remove deprecated models;
  • add new tests;

Note

Medium Risk
Moderate risk because it changes the supported-language source/type and caching behavior, which affects locale matching and downstream translation/loading flows; failures could surface as missing language info or incorrect language selection.

Overview
Switches supported-language resolution from the Crowdin core API to the distribution endpoint /{hash}/languages.json, replacing the old LanguagesInfo/custom_languages models with a SupportedLanguages map (code -> {name, locale}).

Adds timestamp-based caching of supported languages in DataManager via CachedLanguages keyed to the current SyncData/manifest timestamp, and updates locale matching (getMatchedCode) plus string/translation loading and realtime updates to rely on this map with clearer failure handling when language details are missing.

Written by Cursor Bugbot for commit e1f82eb. This will update automatically on new commits. Configure here.

- update logic for supported languages and remove deprecated models;
- add new tests;
@MykhailoNester MykhailoNester self-assigned this Jan 14, 2026
@MykhailoNester MykhailoNester added the enhancement New feature or request label Jan 14, 2026
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 73.01587% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.10%. Comparing base (5fbd84f) to head (e1f82eb).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
.../platform/data/remote/TranslationDataRepository.kt 62.50% 4 Missing and 5 partials ⚠️
...platform/data/remote/StringDataRemoteRepository.kt 57.15% 2 Missing and 1 partial ⚠️
...crowdin/platform/data/remote/CrowdingRepository.kt 77.78% 0 Missing and 2 partials ⚠️
...n/platform/realtimeupdate/RealTimeUpdateManager.kt 0.00% 2 Missing ⚠️
...wdin/src/main/java/com/crowdin/platform/Crowdin.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master     #330       +/-   ##
=============================================
+ Coverage          0   58.10%   +58.10%     
- Complexity        0      403      +403     
=============================================
  Files             0       57       +57     
  Lines             0     1785     +1785     
  Branches          0      321      +321     
=============================================
+ Hits              0     1037     +1037     
- Misses            0      524      +524     
- Partials          0      224      +224     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@andrii-bodnar andrii-bodnar changed the title feat: Replace languages api with languages from distribution; feat: replace languages api with languages from distribution Jan 14, 2026
@andrii-bodnar andrii-bodnar merged commit d7ffafb into master Feb 5, 2026
7 checks passed
@andrii-bodnar andrii-bodnar deleted the feat/new-languages-api branch February 5, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants