Returns the value from the function with the given name in the given language module. By default, language="en".
(function, *args, **kwargs)
| 1794 | |
| 1795 | _modules = {} |
| 1796 | def _multilingual(function, *args, **kwargs): |
| 1797 | """ Returns the value from the function with the given name in the given language module. |
| 1798 | By default, language="en". |
| 1799 | """ |
| 1800 | language = kwargs.pop("language", "en") |
| 1801 | module = _modules.setdefault(language, __import__(language, globals(), {}, [], -1)) |
| 1802 | return getattr(module, function)(*args, **kwargs) |
| 1803 | |
| 1804 | def tokenize(*args, **kwargs): |
| 1805 | return _multilingual("tokenize", *args, **kwargs) |
no test coverage detected
searching dependent graphs…