Merge pull request #189 from rehandalal/question-locale-tag

[bug 1206870] Tag unsupported locale questions as english
This commit is contained in:
Mike Cooper 2015-09-30 13:07:00 -07:00
Родитель 5b5badb073 4ad7ac082a
Коммит 51ed78c6b2
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