Skip to content

Commit

Permalink
chore: add telugu language tag to languageTag model (openedx#4145)
Browse files Browse the repository at this point in the history
  • Loading branch information
AfaqShuaib09 authored Oct 16, 2023
1 parent 8911009 commit 2c68e9e
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 3.2.22 on 2023-10-12 12:11
from django.db import migrations

TELUGU_LANG_TAG = ('Telugu', 'te')

def add_telugu_language_tag(apps, schema_editor): # pylint: disable=unused-argument
LanguageTag = apps.get_model('ietf_language_tags', 'LanguageTag')
LanguageTagTranslation = apps.get_model('ietf_language_tags', 'LanguageTagTranslation')

LanguageTag.objects.update_or_create(code=TELUGU_LANG_TAG[1], defaults={'name': TELUGU_LANG_TAG[0]})
LanguageTagTranslation.objects.update_or_create(
master=LanguageTag.objects.get(code=TELUGU_LANG_TAG[1]),
language_code='en',
defaults={'name_t': TELUGU_LANG_TAG[0]}
)

class Migration(migrations.Migration):
dependencies = [
('ietf_language_tags', '0004_auto_20200804_1401'),
]

operations = [
migrations.RunPython(add_telugu_language_tag, migrations.RunPython.noop),
]

0 comments on commit 2c68e9e

Please sign in to comment.