diff --git a/.github/workflows/translate_af.yml b/.github/workflows/translate_af.yml index 027419cd8..ea1f8acb8 100644 --- a/.github/workflows/translate_af.yml +++ b/.github/workflows/translate_af.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_de.yml b/.github/workflows/translate_de.yml index bff3dba78..e4ca9f445 100644 --- a/.github/workflows/translate_de.yml +++ b/.github/workflows/translate_de.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_el.yml b/.github/workflows/translate_el.yml index 743f1d2dd..9922d7220 100644 --- a/.github/workflows/translate_el.yml +++ b/.github/workflows/translate_el.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_es.yml b/.github/workflows/translate_es.yml index 7a1a78ee2..cc4100eb2 100644 --- a/.github/workflows/translate_es.yml +++ b/.github/workflows/translate_es.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_fr.yml b/.github/workflows/translate_fr.yml index 412c0b024..c4258ee6a 100644 --- a/.github/workflows/translate_fr.yml +++ b/.github/workflows/translate_fr.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_in.yml b/.github/workflows/translate_in.yml index cc0b94560..deaea7de2 100644 --- a/.github/workflows/translate_in.yml +++ b/.github/workflows/translate_in.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_it.yml b/.github/workflows/translate_it.yml index 035f02d99..8f05fd5aa 100644 --- a/.github/workflows/translate_it.yml +++ b/.github/workflows/translate_it.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_ja.yml b/.github/workflows/translate_ja.yml index 29379d9e7..0506a23b0 100644 --- a/.github/workflows/translate_ja.yml +++ b/.github/workflows/translate_ja.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_ko.yml b/.github/workflows/translate_ko.yml index 16669be6f..6e17eb052 100644 --- a/.github/workflows/translate_ko.yml +++ b/.github/workflows/translate_ko.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_pl.yml b/.github/workflows/translate_pl.yml index f0ebf6f61..33e394882 100644 --- a/.github/workflows/translate_pl.yml +++ b/.github/workflows/translate_pl.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_pt.yml b/.github/workflows/translate_pt.yml index b7dbb3249..30078c425 100644 --- a/.github/workflows/translate_pt.yml +++ b/.github/workflows/translate_pt.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_sr.yml b/.github/workflows/translate_sr.yml index 4a9290527..e98fa7e06 100644 --- a/.github/workflows/translate_sr.yml +++ b/.github/workflows/translate_sr.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_sw.yml b/.github/workflows/translate_sw.yml index 5e5fc46a9..0a31f0e8c 100644 --- a/.github/workflows/translate_sw.yml +++ b/.github/workflows/translate_sw.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_tr.yml b/.github/workflows/translate_tr.yml index f3c5359c1..a699ad76f 100644 --- a/.github/workflows/translate_tr.yml +++ b/.github/workflows/translate_tr.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_uk.yml b/.github/workflows/translate_uk.yml index 293f113e2..69bf6395b 100644 --- a/.github/workflows/translate_uk.yml +++ b/.github/workflows/translate_uk.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/.github/workflows/translate_zh.yml b/.github/workflows/translate_zh.yml index 76f12ba6a..3f1f21a32 100644 --- a/.github/workflows/translate_zh.yml +++ b/.github/workflows/translate_zh.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.12 - name: Install python dependencies run: | diff --git a/hacktricks-preprocessor.py b/hacktricks-preprocessor.py index 56a0cf0dc..615fa50e7 100644 --- a/hacktricks-preprocessor.py +++ b/hacktricks-preprocessor.py @@ -50,7 +50,7 @@ def ref(matchobj): dir = path.dirname(current_chapter['source_path']) logger.debug(f'Error getting chapter title: {href} trying with relative path {path.normpath(path.join(dir,href))}') chapter, _path = findtitle(path.normpath(path.join(dir,href)), book, "source_path") - logger.debug(f'Recursive title search result: {chapter['name']}') + logger.debug(f'Recursive title search result: {chapter["name"]}') title = chapter['name'] except Exception as e: logger.debug(f'Error getting chapter title: {path.normpath(path.join(dir,href))}') diff --git a/scripts/translator.py b/scripts/translator.py index d0dc3b489..065b44566 100644 --- a/scripts/translator.py +++ b/scripts/translator.py @@ -96,8 +96,20 @@ def translate_text(language, text, file_path, model, cont=0, slpitted=False, cli return text messages = [ - {"role": "system", "content": "You are a professional hacker, translator and writer. You write everything super clear and as concise as possible without loosing information. Do not return invalid Unicode output."}, - {"role": "system", "content": f"The following is content from a hacking book about hacking techiques. The following content is from the file {file_path}. Translate the relevant English text to {language} and return the translation keeping excatly the same markdown and html syntax. Do not translate things like code, hacking technique names, hacking word, cloud/SaaS platform names (like Workspace, aws, gcp...), the word 'leak', pentesting, and markdown tags. Also don't add any extra stuff apart from the translation and markdown syntax."}, + {"role": "system", "content": "You are a professional hacker, translator and writer. You translate everything super clear and as concise as possible without loosing information. Do not return invalid Unicode output and do not translate markdown or html tags or links."}, + {"role": "system", "content": f"""The following is content from a hacking book about hacking techiques. The following content is from the file {file_path}. +Translate the relevant English text to {language} and return the translation keeping exactly the same markdown and html syntax and following this guidance: + +- Don't translate things like code, hacking technique names, common hacking words, cloud/SaaS platform names (like Workspace, aws, gcp...), the word 'leak', pentesting, links and markdown tags. +- Don't translate links or paths, e.g. if a path is to "../lamda-post-exploitation" and you are asked to trasnlate to another language, don't translate the path. +- Don't translate or modify tags, links and paths like in: + - {{#tabs}} + - {{#tab name="Method1"}} + - {{#ref}}\ngeneric-methodologies-and-resources/pentesting-methodology.md\n{{#endref}} + - {{#include ./banners/hacktricks-training.md}} +- Don't translate any other tag + +Also don't add any extra stuff in your response apart from the translation and markdown syntax."""}, {"role": "user", "content": text}, ] try: