AndrewEllis93 / Pressure_Linear_Advance_Tool

Pressure Advance / Linear Advance Calibration Tool
https://ellis3dp.com/Print-Tuning-Guide/articles/pressure_linear_advance/introduction.html
GNU General Public License v3.0
38 stars 19 forks source link

Spanish localization issue #37

Open Aibehn opened 7 months ago

Aibehn commented 7 months ago

When the gcode gets generated, it adds a line log when it was generated. As a timestap.

; Generated: Fri Feb 09 2024 12:46:46 GMT+0100 (hora estándar de Europa central)

In Spanish, it's generated like that, but it adds a comment about the time zone.

GMT+0100 (hora estándar de Europa central)

In Spanish, it translates standard as estándar. But klipper can't handle that character "á" as it crashes whit a "unhandled exception during run".

I searched on the logs and i found this: unicodeencodeerror: 'ascii' codec can't encode character u'\xe1' in position 56: ordinal not in range(128)

Section of that klippy.log

Unhandled exception during run
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/klippy.py", line 217, in run
    self.reactor.run()
  File "/home/pi/klipper/klippy/reactor.py", line 292, in run
    g_next.switch()
  File "/home/pi/klipper/klippy/reactor.py", line 340, in _dispatch_loop
    timeout = self._check_timers(eventtime, busy)
  File "/home/pi/klipper/klippy/reactor.py", line 158, in _check_timers
    t.waketime = waketime = t.callback(eventtime)
  File "/home/pi/klipper/klippy/extras/virtual_sdcard.py", line 261, in work_handler
    next_file_position = self.file_position + len(line.encode()) + 1
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 56: ordinal not in range(128)
Transition to shutdown state: Unhandled exception during run

Replacing that á whit a regular a solved the problem.

FlashGordon7 commented 6 months ago

The same thing happens in Danish, it is the character "æ" Generated: Tue Feb 20 2024 16:28:27 GMT+0100 (Centraleuropæisk normaltid)