[bug 1206870] Tag unsupported locale questions as english

This commit is contained in:
Rehan Dalal 2015-09-28 16:20:30 -04:00
Родитель 33717e78ab
Коммит 4ad7ac082a
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -125,12 +125,17 @@
post_question: function(text, user_meta) {
var endpoint = API_V2_BASE + 'question/';
endpoint += '?format=json'; // TODO bug 1088014
var supported_locale = _.find(Settings.LOCALES, function(locale) {
return locale[0] == user_meta.lang;
});
var data = {
title: text,
product: 'firefox-os',
content: ' ',
topic: 'basic-features',
locale: user_meta.lang
locale: supported_locale ? user_meta.lang : 'en-US'
};
// we need to create the question before we can set the metadata as we
// need the questions's id