Skip to content

Commit

Permalink
Replace another usage of the crowdin v1 api
Browse files Browse the repository at this point in the history
  • Loading branch information
felixoi authored Nov 2, 2020
1 parent a94b467 commit 042d288
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/theme/languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def load_languages():
languages = json.load(f)
else:
# Load Crowdin languages from API
r = requests.get('https://api.crowdin.com/api/supported-languages?json')
r = requests.get('https://api.crowdin.com/api/v2/languages?limit=500')
r.raise_for_status()

languages = {lang['locale'].replace('-', '_'): {
'name': lang['name'],
'code': lang['crowdin_code']
} for lang in r.json()}
languages = {lang['data']['locale'].replace('-', '_'): {
'name': lang['data']['name'],
'code': lang['data']['id']
} for lang in r.json()['data']}

# Load locale data
with open(LOCAL_LANGUAGES_FILE, 'r') as f:
Expand Down

0 comments on commit 042d288

Please sign in to comment.