diff --git a/moulinette/core.py b/moulinette/core.py index 4c0bdcf8..6f6fddd7 100644 --- a/moulinette/core.py +++ b/moulinette/core.py @@ -246,7 +246,7 @@ class Moulinette18n(object): for n in self._namespaces.values(): n.set_locale(locale) - def g(self, key, *args, **kwargs): + def g(self, key: str, *args, **kwargs) -> str: """Retrieve proper translation for a moulinette key Attempt to retrieve value for a key from moulinette translations @@ -258,7 +258,7 @@ class Moulinette18n(object): """ return self._global.translate(key, *args, **kwargs) - def n(self, key, *args, **kwargs): + def n(self, key: str, *args, **kwargs) -> str: """Retrieve proper translation for a moulinette key Attempt to retrieve value for a key from current loaded namespace @@ -271,7 +271,7 @@ class Moulinette18n(object): """ return self._namespaces[self._current_namespace].translate(key, *args, **kwargs) - def key_exists(self, key): + def key_exists(self, key: str) -> bool: """Check if a key exists in the translation files Keyword arguments: @@ -298,7 +298,7 @@ class MoulinetteError(Exception): super(MoulinetteError, self).__init__(msg) self.strerror = msg - def content(self): + def content(self) -> str: return self.strerror