Ensure a unicode string is returned
This commit is contained in:
parent
c522d19c2b
commit
23e54c67a7
@ -15,14 +15,15 @@ ANSIBLE_METADATA = {
|
|||||||
import gettext
|
import gettext
|
||||||
from ansible.errors import AnsibleFilterError
|
from ansible.errors import AnsibleFilterError
|
||||||
from ansible.utils import helpers
|
from ansible.utils import helpers
|
||||||
|
from ansible.module_utils._text import to_text
|
||||||
|
|
||||||
|
|
||||||
def translate_yavdr(text):
|
def translate_yavdr(text):
|
||||||
gettext.textdomain('yavdr')
|
gettext.textdomain('yavdr')
|
||||||
try:
|
try:
|
||||||
return gettext.gettext(text)
|
return to_text(gettext.gettext(text))
|
||||||
except:
|
except:
|
||||||
return text
|
return to_text(text)
|
||||||
|
|
||||||
# ---- Ansible filters ----
|
# ---- Ansible filters ----
|
||||||
class FilterModule(object):
|
class FilterModule(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user