Fixed exported constant to match version 0.0.8

This commit is contained in:
Volodymyr Kozieiev 2017-12-27 18:30:06 +02:00
parent ffaeb5eb84
commit e4361722d5
No known key found for this signature in database
GPG Key ID: 1F706640AAF07516
2 changed files with 4 additions and 9 deletions

View File

@ -1,15 +1,12 @@
/**
* Copyright (C) 2016, Canonical Ltd.
* Copyright (c) 2017-present, Status Research and Development GmbH.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Author: Justin McPherson <justin.mcpherson@canonical.com>
*
*/
#include <memory>
#include "bridge.h"
@ -72,7 +69,8 @@ QList<ModuleMethod*> RNI18n::methodsToExport() {
}
QVariantMap RNI18n::constantsToExport() {
return QVariantMap{{"languages", d_ptr->languages()}};
QString locale = d_ptr->languages().count() > 0 ? d_ptr->languages().first().toString() : "en";
return QVariantMap{{"locale", locale}};
}
void RNI18n::setBridge(Bridge* bridge) {

View File

@ -1,14 +1,11 @@
/**
* Copyright (C) 2016, Canonical Ltd.
* Copyright (c) 2017-present, Status Research and Development GmbH.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* Author: Justin McPherson <justin.mcpherson@canonical.com>
*
*/
#ifndef RNI18NDESKTOP_H