diff --git a/scripts/crowdin_convert.py b/scripts/crowdin_convert.py index 3a535e7..70baf30 100644 --- a/scripts/crowdin_convert.py +++ b/scripts/crowdin_convert.py @@ -271,9 +271,14 @@ def handle_docstring(self, node: ast.AST, name: str) -> None: key_root = ".".join([*self.key, name]) key = key_root suffix = 1 - while key in self.used_keys: - key = f"{key_root}-{suffix}" - suffix += 1 + if isinstance(node, ast.FunctionDef): # ctx.id + for decorator in node.decorator_list: + if hasattr(decorator, "id"): + if decorator.id == "overload": + key = f"{key}-{suffix}" + while key in self.used_keys: + suffix += 1 + key = f"{key_root}-{suffix}" self.used_keys.add(key) update_docstring(node, key, en_json, translated_json)