You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2015/08/19 20:30:44 UTC
allura git commit: [#7969] add phone.lang option
Repository: allura
Updated Branches:
refs/heads/db/7969 [created] a0134a1f5
[#7969] add phone.lang option
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a0134a1f
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a0134a1f
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a0134a1f
Branch: refs/heads/db/7969
Commit: a0134a1f5a0582215ed6b0062a079fbaa8f6ce75
Parents: 1cb99fa
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Aug 19 18:30:34 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 19 18:30:34 2015 +0000
----------------------------------------------------------------------
Allura/allura/lib/phone/nexmo.py | 2 ++
Allura/allura/tests/unit/phone/test_nexmo.py | 5 +++++
Allura/development.ini | 2 ++
3 files changed, 9 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/a0134a1f/Allura/allura/lib/phone/nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/phone/nexmo.py b/Allura/allura/lib/phone/nexmo.py
index dfb1bf0..9c1eb61 100644
--- a/Allura/allura/lib/phone/nexmo.py
+++ b/Allura/allura/lib/phone/nexmo.py
@@ -47,6 +47,8 @@ class NexmoPhoneService(PhoneService):
'api_key': self.api_key,
'api_secret': self.api_secret,
}
+ if self.config.get('phone.lang'):
+ common['lg'] = self.config['phone.lang']
return dict(params, **common)
def error(self, code=None, msg=None, number=''):
http://git-wip-us.apache.org/repos/asf/allura/blob/a0134a1f/Allura/allura/tests/unit/phone/test_nexmo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/phone/test_nexmo.py b/Allura/allura/tests/unit/phone/test_nexmo.py
index 640aab6..cf0d5cf 100644
--- a/Allura/allura/tests/unit/phone/test_nexmo.py
+++ b/Allura/allura/tests/unit/phone/test_nexmo.py
@@ -40,6 +40,11 @@ class TestPhoneService(object):
'api_secret': 'test-api-secret'}
assert_equal(expected, res)
+ self.phone.config['phone.lang'] = 'it-it'
+ res = self.phone.add_common_params(params)
+ expected['lg'] = 'it-it'
+ assert_equal(expected, res)
+
def test_error(self):
res = self.phone.error()
expected = {'status': 'error',
http://git-wip-us.apache.org/repos/asf/allura/blob/a0134a1f/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 934ea67..7ea657b 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -197,6 +197,8 @@ site_admin_project_nbhd = Projects
; phone.method = nexmo
; phone.api_key =
; phone.api_secret =
+; Language to use, if provider supports it. Values for Nexmo Verify: https://docs.nexmo.com/index.php/verify#localization
+; phone.lang = en-us
; Use phone verification on project registration (false by default)
; project.verify_phone = true