From 0bb58e634794b9d9523bb227750d2899adba8006 Mon Sep 17 00:00:00 2001 From: signedav Date: Mon, 9 Oct 2023 21:30:38 +0200 Subject: [PATCH] fix transifex filter --- docs/.utils/transifex_utils.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/.utils/transifex_utils.py b/docs/.utils/transifex_utils.py index 5a1b3fb44..cae3e5261 100644 --- a/docs/.utils/transifex_utils.py +++ b/docs/.utils/transifex_utils.py @@ -33,9 +33,12 @@ def create_transifex_config(): if tx_slug: print(f"Found file with tx_slug defined: {relative_path}, {tx_slug}") f.write(f"[o:{TX_ORGANIZATION}:p:{TX_PROJECT}:r:{tx_slug}]\n") - f.write( - f"file_filter = {''.join(relative_path.split('.')[:-2])}..md\n" - ) + if ( + relative_path.count(".") == 1 + ): # if no dots defining language (to filter out the indes.de.md etc.) + f.write( + f"file_filter = {os.path.splitext(relative_path)[0]}..md\n" + ) f.write(f"source_file = {relative_path}\n") f.write(f"source_lang = {TX_SOURCE_LANG}\n") f.write(f"type = {TX_TYPE}\n\n")