|
@@ -59,7 +59,18 @@ class EnumStringSetting(Setting):
|
59
|
59
|
self._validate_selection(self.value)
|
60
|
60
|
|
61
|
61
|
def parse(self, data):
|
62
|
|
- self._validate_selection(data)
|
|
62
|
+ if data not in self.choices and data != self.value:
|
|
63
|
+ # hack to give some backwards compatibility with old language cookies
|
|
64
|
+ data = str(data).replace('_', '-')
|
|
65
|
+ lang = data[:2]
|
|
66
|
+ if data in self.choices:
|
|
67
|
+ pass
|
|
68
|
+ elif lang in self.choices:
|
|
69
|
+ data = lang
|
|
70
|
+ elif data == 'ar-XA':
|
|
71
|
+ data = 'ar-SA'
|
|
72
|
+ else:
|
|
73
|
+ data = 'all'
|
63
|
74
|
self.value = data
|
64
|
75
|
|
65
|
76
|
|