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