Closed prophetmaster closed 3 years ago
Please update (bug summary) to related issue
Looking into the code I found some more strings which could probably be replaced by translated strings. But I have no idea where (Serial, UI, Ext UI, Host Promt) translations should happen and where the output should be English only. But maybe I could at least help with a janky script finding those strings:
#!/usr/bin/env python3
import re
import os
import sys
from pathlib import Path
strings = set()
str_pattern = re.compile(r'"(?:[^"\\]|\\.)*"')
with open('Marlin/src/lcd/language/language_en.h') as f:
for line in f:
for match in str_pattern.finditer(line):
strings.add(match[0])
pathes = []
for root, dirs, files in os.walk('.', topdown=True):
dirs[:] = [d for d in dirs if not (d.startswith('.') or d == 'language')]
for file in files:
path = Path(root, file)
if path.suffix.lower() in ['.h', '.c', '.cpp']:
pathes.append(path)
for path in sorted(pathes):
try:
with open(path) as f:
for i, line in enumerate(f):
line = line.strip().split('//', 1)[0]
for match in str_pattern.finditer(line):
if match[0] in strings:
print(f'{path}:{i+1}: {line}')
except UnicodeDecodeError as ex:
print(f'ERROR: {path}: {ex}', file=sys.stderr)
python does not use marlin C language files
Sorry, I should have given more explanations: TL;DR: Execute this script in the Marlin project root directory. You will get an output of all source file locations (like grep) containings strings also defined in the English Marlin "translation".
Long read: I was about to make a small pull request fixing this issues and started digging around in the code and found some more places with untranslated strings. I wrote this script to find some more untranslated strings. But I also found some places where I noticed I have no idea how for example the ExtUI API works, since for example the anycubic_chiron module compares the messages with its own hard coded messages. Hence I stopped creating a PR.
Marlin doesn't translate serial strings because it'd be a nightmare for host software to deal with.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Did you test the latest
bugfix-2.0.x
code?Yes, and the problem still exists.
Bug Description
hard coded string in english line 297: "Stow Probe" for "deploy probe" and line 298: "Stow Probe"
my personal correction is replacing "Stow Probe" by var
ds_str
Bug Timeline
i don't know
Expected behavior
No response
Actual behavior
No response
Steps to Reproduce
No response
Version of Marlin Firmware
2.0.9.1
Printer model
custom delta
Electronics
mks sbase
Add-ons
No response
Your Slicer
Prusa Slicer
Host Software
OctoPrint
Additional information & file uploads
No response