Kaydet (Commit) bfaf6580 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

Fallback to English, if sender's locale is missing

üst f71432dd
......@@ -337,7 +337,18 @@ c_i18n(PyObject *self, PyObject *args)
return NULL;
return PyDict_GetItemString(py_dict, sender_language());
PyObject *py_lang = PyString_FromString(sender_language());
if (!PyDict_Contains(py_dict, py_lang)) {
py_lang = PyString_FromString("en");
if (PyDict_Contains(py_dict, py_lang)) {
return PyDict_GetItem(py_dict, py_lang);
else {
PyErr_Format(PyExc_COMAR_Script, "Script is lack of default ('en') locale string.");
return NULL;
//! Signal emitter method, used in scripts
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment