equal
deleted
inserted
replaced
21 |
21 |
22 if pycompat.TYPE_CHECKING: |
22 if pycompat.TYPE_CHECKING: |
23 from typing import ( |
23 from typing import ( |
24 Callable, |
24 Callable, |
25 List, |
25 List, |
26 Optional, |
|
27 ) |
26 ) |
28 |
27 |
29 |
28 |
30 # modelled after templater.templatepath: |
29 # modelled after templater.templatepath: |
31 if getattr(sys, 'frozen', None) is not None: |
30 if getattr(sys, 'frozen', None) is not None: |
69 |
68 |
70 _msgcache = {} # encoding: {message: translation} |
69 _msgcache = {} # encoding: {message: translation} |
71 |
70 |
72 |
71 |
73 def gettext(message): |
72 def gettext(message): |
74 # type: (Optional[bytes]) -> Optional[bytes] |
73 # type: (bytes) -> bytes |
75 """Translate message. |
74 """Translate message. |
76 |
75 |
77 The message is looked up in the catalog to get a Unicode string, |
76 The message is looked up in the catalog to get a Unicode string, |
78 which is encoded in the local encoding before being returned. |
77 which is encoded in the local encoding before being returned. |
79 |
78 |