diff --git a/apps/sumo/tests/test_googleanalytics.py b/apps/sumo/tests/test_googleanalytics.py index 75398dd56..6f06c4c16 100644 --- a/apps/sumo/tests/test_googleanalytics.py +++ b/apps/sumo/tests/test_googleanalytics.py @@ -166,8 +166,8 @@ VISITORS_BY_LOCALE_RESPONSE = { [u'/sl/', u'530'], [u'/son/', u'1'], [u'/sq/', u'27'], - [u'/sr-CYRL/', u'256'], - [u'/sr-LATN/', u'31'], + [u'/sr-Cyrl/', u'256'], + [u'/sr-Latn/', u'31'], [u'/sv/', u'1488'], [u'/ta-LK/', u'13'], [u'/ta/', u'13'], diff --git a/lib/languages.json b/lib/languages.json index e8dc01777..c320adfbe 100644 --- a/lib/languages.json +++ b/lib/languages.json @@ -84,7 +84,7 @@ "english": "Gujarati", "native": "\u0a97\u0ac1\u0a9c\u0ab0\u0abe\u0aa4\u0ac0" }, - "sr-CYRL": { + "sr-Cyrl": { "iso639_1": "sr", "english": "Serbian", "native": "\u0421\u0440\u043f\u0441\u043a\u0438" @@ -404,7 +404,7 @@ "english": "Arabic", "native": "\u0639\u0631\u0628\u064a" }, - "sr-LATN": { + "sr-Latn": { "iso639_1": "sr", "english": "Serbian", "native": "Srpski" diff --git a/migrations/203-fix-serbian-locale-codes.py b/migrations/203-fix-serbian-locale-codes.py new file mode 100644 index 000000000..434fd1b93 --- /dev/null +++ b/migrations/203-fix-serbian-locale-codes.py @@ -0,0 +1,18 @@ +from gallery.models import Image, Video +from users.models import Profile +from wiki.models import Document, Locale + + +def run(): + """Fix casing in locale code for sr-Cyrl and sr-Latn.""" + Document.objects.filter(locale='sr-CYRL').update(locale='sr-Cyrl') + Locale.objects.filter(locale='sr-CYRL').update(locale='sr-Cyrl') + Image.objects.filter(locale='sr-CYRL').update(locale='sr-Cyrl') + Video.objects.filter(locale='sr-CYRL').update(locale='sr-Cyrl') + Profile.objects.filter(locale='sr-CYRL').update(locale='sr-Cyrl') + + Document.objects.filter(locale='sr-LATN').update(locale='sr-Latn') + Locale.objects.filter(locale='sr-LATN').update(locale='sr-Latn') + Image.objects.filter(locale='sr-LATN').update(locale='sr-Latn') + Video.objects.filter(locale='sr-LATN').update(locale='sr-Latn') + Profile.objects.filter(locale='sr-LATN').update(locale='sr-Latn') diff --git a/settings.py b/settings.py index 13c917280..97a086044 100644 --- a/settings.py +++ b/settings.py @@ -154,8 +154,8 @@ SUMO_LANGUAGES = ( 'sl', 'son', 'sq', - 'sr-CYRL', - 'sr-LATN', + 'sr-Cyrl', + 'sr-Latn', 'sv', 'ta-LK', 'ta',