From e4f09478217697742163df5a61b45abf6e855853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sat, 16 May 2020 15:17:24 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Allow=20Unicode=20in=20MkDocs=20for?= =?UTF-8?q?=20translations=20instead=20of=20escaped=20chars=20(#1419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/docs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/docs.py b/scripts/docs.py index 73f21371b..33297dd8f 100644 --- a/scripts/docs.py +++ b/scripts/docs.py @@ -93,7 +93,8 @@ def new_lang(lang: str = typer.Argument(..., callback=lang_callback)): new_config = get_base_lang_config(lang) new_config_path: Path = Path(new_path) / mkdocs_name new_config_path.write_text( - yaml.dump(new_config, sort_keys=False, width=200), encoding="utf-8" + yaml.dump(new_config, sort_keys=False, width=200, allow_unicode=True), + encoding="utf-8", ) new_config_docs_path: Path = new_path / "docs" new_config_docs_path.mkdir() @@ -177,7 +178,8 @@ def build_lang( lang_config["nav"] = export_lang_nav build_lang_config_path: Path = build_lang_path / mkdocs_name build_lang_config_path.write_text( - yaml.dump(lang_config, sort_keys=False, width=200), encoding="utf-8" + yaml.dump(lang_config, sort_keys=False, width=200, allow_unicode=True), + encoding="utf-8", ) current_dir = os.getcwd() os.chdir(build_lang_path) @@ -295,7 +297,8 @@ def update_config(lang: str): languages.append({name: f"/{name}/"}) config["nav"][1] = {"Languages": languages} config_path.write_text( - yaml.dump(config, sort_keys=False, width=200), encoding="utf-8" + yaml.dump(config, sort_keys=False, width=200, allow_unicode=True), + encoding="utf-8", )