Merge branch 'PFW-1189' into MK3_MK404
This commit is contained in:
commit
4bb13ce582
@ -642,7 +642,7 @@ void crashdet_detected(uint8_t mask)
|
||||
enquecommand_P(PSTR("CRASH_RECOVER"));
|
||||
}else{
|
||||
setTargetHotend(0, active_extruder);
|
||||
bool yesno = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Crash detected. Resume print?"), false);
|
||||
bool yesno = lcd_show_fullscreen_message_yes_no_and_wait_P(_i("Crash detected. Resume print?"), false);////MSG_CRASH_RESUME c=20 r=3
|
||||
lcd_update_enable(true);
|
||||
if (yesno)
|
||||
{
|
||||
@ -866,14 +866,14 @@ static void check_if_fw_is_on_right_printer(){
|
||||
if((PRINTER_TYPE == PRINTER_MK3) || (PRINTER_TYPE == PRINTER_MK3S)){
|
||||
#ifdef IR_SENSOR
|
||||
if (pat9125_probe()){
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("MK3S firmware detected on MK3 printer"));}////c=20 r=3
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("MK3S firmware detected on MK3 printer"));}////MSG_MK3S_FIRMWARE_ON_MK3 c=20 r=4
|
||||
#endif //IR_SENSOR
|
||||
|
||||
#ifdef PAT9125
|
||||
//will return 1 only if IR can detect filament in bondtech extruder so this may fail even when we have IR sensor
|
||||
const uint8_t ir_detected = !READ(IR_SENSOR_PIN);
|
||||
if (ir_detected){
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("MK3 firmware detected on MK3S printer"));}////c=20 r=3
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("MK3 firmware detected on MK3S printer"));}////MSG_MK3_FIRMWARE_ON_MK3S c=20 r=4
|
||||
#endif //PAT9125
|
||||
}
|
||||
#endif //FILAMENT_SENSOR
|
||||
@ -1540,7 +1540,7 @@ void setup()
|
||||
}
|
||||
|
||||
if (!previous_settings_retrieved) {
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=5
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Old settings found. Default PID, Esteps etc. will be set.")); //if EEPROM version or printer type was changed, inform user that default setting were loaded////MSG_DEFAULT_SETTINGS_LOADED c=20 r=6
|
||||
Config_StoreSettings();
|
||||
}
|
||||
if (eeprom_read_byte((uint8_t*)EEPROM_WIZARD_ACTIVE) >= 1) {
|
||||
@ -3694,7 +3694,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
|
||||
current_position[X_AXIS] -= 100;
|
||||
plan_buffer_line_curposXYZE(FILAMENTCHANGE_XYFEED);
|
||||
st_synchronize();
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=4
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Please open idler and remove filament manually."));////MSG_CHECK_IDLER c=20 r=5
|
||||
}
|
||||
}
|
||||
|
||||
@ -3967,7 +3967,6 @@ static void extended_capabilities_report()
|
||||
cap_line(PSTR("AUTOREPORT_POSITION"), ENABLED(AUTO_REPORT));
|
||||
// EXTENDED_M20 (support for L and T parameters)
|
||||
cap_line(PSTR("EXTENDED_M20"), 1);
|
||||
//@todo Update RepRap cap
|
||||
}
|
||||
#endif //EXTENDED_CAPABILITIES_REPORT
|
||||
|
||||
@ -4229,7 +4228,7 @@ void process_commands()
|
||||
if (!hasP && !hasS && *src != '\0') {
|
||||
lcd_setstatus(src);
|
||||
} else {
|
||||
LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT
|
||||
LCD_MESSAGERPGM(_i("Wait for user..."));////MSG_USERWAIT c=20
|
||||
}
|
||||
lcd_ignore_click(); //call lcd_ignore_click aslo for else ???
|
||||
st_synchronize();
|
||||
@ -5728,7 +5727,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||
*/
|
||||
|
||||
case 17:
|
||||
LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE
|
||||
LCD_MESSAGERPGM(_i("No move."));////MSG_NO_MOVE c=20
|
||||
enable_x();
|
||||
enable_y();
|
||||
enable_z();
|
||||
@ -6399,7 +6398,6 @@ Sigma_Exit:
|
||||
- `C` - Time to change/pause/user interaction in normal mode
|
||||
- `D` - Time to change/pause/user interaction in silent mode
|
||||
*/
|
||||
//!@todo update RepRap Gcode wiki
|
||||
case 73: //M73 show percent done, time remaining and time to change/pause
|
||||
{
|
||||
if(code_seen('P')) print_percent_done_normal = code_value();
|
||||
@ -6517,8 +6515,6 @@ Sigma_Exit:
|
||||
bit 6 = free
|
||||
bit 7 = free
|
||||
*/
|
||||
//!@todo update RepRap Gcode wiki
|
||||
//!@todo Should be temperature always? Octoprint doesn't switch to M105 if M155 timer is set
|
||||
case 155:
|
||||
{
|
||||
if (code_seen('S')){
|
||||
@ -7071,7 +7067,7 @@ Sigma_Exit:
|
||||
|
||||
#if (defined(FANCHECK) && (((defined(TACH_0) && (TACH_0 >-1)) || (defined(TACH_1) && (TACH_1 > -1)))))
|
||||
/*!
|
||||
### M123 - Tachometer value <a href="https://www.reprap.org/wiki/G-code#M123:_Tachometer_value_.28RepRap.29">M123: Tachometer value</a>
|
||||
### M123 - Tachometer value <a href="https://www.reprap.org/wiki/G-code#M123:_Tachometer_value_.28RepRap_.26_Prusa.29">M123: Tachometer value</a>
|
||||
This command is used to report fan speeds and fan pwm values.
|
||||
#### Usage
|
||||
|
||||
@ -7087,7 +7083,6 @@ Sigma_Exit:
|
||||
E0:3240 RPM PRN1:4560 RPM E0@:255 PRN1@:255
|
||||
|
||||
*/
|
||||
//!@todo Update RepRap Gcode wiki
|
||||
case 123:
|
||||
gcode_M123();
|
||||
break;
|
||||
@ -9683,7 +9678,7 @@ static void handleSafetyTimer()
|
||||
{
|
||||
setTargetBed(0);
|
||||
setAllTargetHotends(0);
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Heating disabled by safety timer."));////MSG_BED_HEATING_SAFETY_DISABLED
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Heating disabled by safety timer."));////MSG_BED_HEATING_SAFETY_DISABLED c=20 r=4
|
||||
}
|
||||
}
|
||||
#endif //SAFETYTIMER
|
||||
|
@ -8,30 +8,31 @@
|
||||
#include "Configuration_prusa.h"
|
||||
|
||||
//internationalized messages
|
||||
const char MSG_AUTO_HOME[] PROGMEM_I1 = ISTR("Auto home"); ////
|
||||
const char MSG_BABYSTEP_Z[] PROGMEM_I1 = ISTR("Live adjust Z"); //// c=18
|
||||
const char MSG_AUTO_HOME[] PROGMEM_I1 = ISTR("Auto home"); ////c=18
|
||||
const char MSG_BABYSTEP_Z[] PROGMEM_I1 = ISTR("Live adjust Z"); ////c=18
|
||||
const char MSG_BABYSTEP_Z_NOT_SET[] PROGMEM_I1 = ISTR("Distance between tip of the nozzle and the bed surface has not been set yet. Please follow the manual, chapter First steps, section First layer calibration."); ////c=20 r=12
|
||||
const char MSG_BED[] PROGMEM_I1 = ISTR("Bed"); ////
|
||||
const char MSG_BED_DONE[] PROGMEM_I1 = ISTR("Bed done"); ////
|
||||
const char MSG_BED_HEATING[] PROGMEM_I1 = ISTR("Bed Heating"); ////
|
||||
const char MSG_BED_LEVELING_FAILED_POINT_LOW[] PROGMEM_I1 = ISTR("Bed leveling failed. Sensor didnt trigger. Debris on nozzle? Waiting for reset."); ////c=20 r=5
|
||||
const char MSG_BED[] PROGMEM_I1 = ISTR("Bed"); ////c=13
|
||||
const char MSG_BED_DONE[] PROGMEM_I1 = ISTR("Bed done"); ////c=20
|
||||
const char MSG_BED_HEATING[] PROGMEM_I1 = ISTR("Bed Heating"); ////c=20
|
||||
const char MSG_BED_LEVELING_FAILED_POINT_LOW[] PROGMEM_I1 = ISTR("Bed leveling failed. Sensor didn't trigger. Debris on nozzle? Waiting for reset."); ////c=20 r=6
|
||||
const char MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED[] PROGMEM_I1 = ISTR("XYZ calibration failed. Please consult the manual."); ////c=20 r=8
|
||||
const char MSG_BELT_STATUS[] PROGMEM_I1 = ISTR("Belt status");////c=18
|
||||
const char MSG_CANCEL[] PROGMEM_I1 = ISTR(">Cancel");////c=9
|
||||
const char MSG_CALIBRATE_Z_AUTO[] PROGMEM_I1 = ISTR("Calibrating Z"); ////c=20 r=2
|
||||
const char MSG_CARD_MENU[] PROGMEM_I1 = ISTR("Print from SD"); ////
|
||||
const char MSG_CARD_MENU[] PROGMEM_I1 = ISTR("Print from SD"); ////c=18
|
||||
const char MSG_CHECKING_X[] PROGMEM_I1 = ISTR("Checking X axis"); ////c=20
|
||||
const char MSG_CHECKING_Y[] PROGMEM_I1 = ISTR("Checking Y axis"); ////c=20
|
||||
const char MSG_COMMUNITY_MADE[] PROGMEM_I1 = ISTR("Community made"); ////c=18
|
||||
const char MSG_CONFIRM_NOZZLE_CLEAN[] PROGMEM_I1 = ISTR("Please clean the nozzle for calibration. Click when done."); ////c=20 r=8
|
||||
const char MSG_COOLDOWN[] PROGMEM_I1 = ISTR("Cooldown"); ////
|
||||
const char MSG_COOLDOWN[] PROGMEM_I1 = ISTR("Cooldown"); ////c=18
|
||||
const char MSG_CRASH[] PROGMEM_I1 = ISTR("Crash"); ////c=7
|
||||
const char MSG_CRASH_DETECTED[] PROGMEM_I1 = ISTR("Crash detected."); ////c=20 r=1
|
||||
const char MSG_CRASH_DETECTED[] PROGMEM_I1 = ISTR("Crash detected."); ////c=20
|
||||
const char MSG_CRASHDETECT[] PROGMEM_I1 = ISTR("Crash det."); ////c=13
|
||||
const char MSG_ERROR[] PROGMEM_I1 = ISTR("ERROR:"); ////
|
||||
const char MSG_ERROR[] PROGMEM_I1 = ISTR("ERROR:"); ////c=10
|
||||
const char MSG_EXTRUDER[] PROGMEM_I1 = ISTR("Extruder"); ////c=17
|
||||
const char MSG_FANS_CHECK[] PROGMEM_I1 = ISTR("Fans check"); ////c=13
|
||||
const char MSG_FIL_RUNOUTS[] PROGMEM_I1 = ISTR("Fil. runouts"); ////c=15
|
||||
const char MSG_FILAMENT[] PROGMEM_I1 = ISTR("Filament"); ////c=17 r=1
|
||||
const char MSG_FILAMENT[] PROGMEM_I1 = ISTR("Filament"); ////c=17
|
||||
const char MSG_FAN_SPEED[] PROGMEM_I1 = ISTR("Fan speed"); ////c=14
|
||||
const char MSG_FILAMENT_CLEAN[] PROGMEM_I1 = ISTR("Filament extruding & with correct color?"); ////c=20 r=2
|
||||
const char MSG_FILAMENT_LOADED[] PROGMEM_I1 = ISTR("Is filament loaded?"); ////c=20 r=2
|
||||
@ -39,19 +40,19 @@ const char MSG_FILAMENT_LOADING_T0[] PROGMEM_I1 = ISTR("Insert filament into ext
|
||||
const char MSG_FILAMENT_LOADING_T1[] PROGMEM_I1 = ISTR("Insert filament into extruder 2. Click when done."); ////c=20 r=4
|
||||
const char MSG_FILAMENT_LOADING_T2[] PROGMEM_I1 = ISTR("Insert filament into extruder 3. Click when done."); ////c=20 r=4
|
||||
const char MSG_FILAMENT_LOADING_T3[] PROGMEM_I1 = ISTR("Insert filament into extruder 4. Click when done."); ////c=20 r=4
|
||||
const char MSG_FILAMENTCHANGE[] PROGMEM_I1 = ISTR("Change filament"); ////
|
||||
const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE1[] PROGMEM_I1 = ISTR("Searching bed calibration point"); ////c=60
|
||||
const char MSG_FILAMENTCHANGE[] PROGMEM_I1 = ISTR("Change filament"); ////c=18
|
||||
const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE1[] PROGMEM_I1 = ISTR("Searching bed calibration point"); ////c=20 r=2
|
||||
const char MSG_FIND_BED_OFFSET_AND_SKEW_LINE2[] PROGMEM_I1 = ISTR(" of 4"); ////c=14
|
||||
const char MSG_FINISHING_MOVEMENTS[] PROGMEM_I1 = ISTR("Finishing movements"); ////c=20
|
||||
const char MSG_FOLLOW_CALIBRATION_FLOW[] PROGMEM_I1 = ISTR("Printer has not been calibrated yet. Please follow the manual, chapter First steps, section Calibration flow."); ////c=20 r=8
|
||||
const char MSG_FOLLOW_Z_CALIBRATION_FLOW[] PROGMEM_I1 = ISTR("There is still a need to make Z calibration. Please follow the manual, chapter First steps, section Calibration flow."); ////c=20 r=9
|
||||
const char MSG_FSENSOR_AUTOLOAD[] PROGMEM_I1 = ISTR("F. autoload"); ////c=13
|
||||
const char MSG_FSENSOR[] PROGMEM_I1 = ISTR("Fil. sensor"); ////
|
||||
const char MSG_HEATING[] PROGMEM_I1 = ISTR("Heating"); ////
|
||||
const char MSG_FSENSOR[] PROGMEM_I1 = ISTR("Fil. sensor"); ////c=12
|
||||
const char MSG_HEATING[] PROGMEM_I1 = ISTR("Heating"); ////c=20
|
||||
const char MSG_HEATING_COMPLETE[] PROGMEM_I1 = ISTR("Heating done."); ////c=20
|
||||
const char MSG_HOMEYZ[] PROGMEM_I1 = ISTR("Calibrate Z"); ////
|
||||
const char MSG_CHOOSE_EXTRUDER[] PROGMEM_I1 = ISTR("Choose extruder:"); ////c=20 r=1
|
||||
const char MSG_CHOOSE_FILAMENT[] PROGMEM_I1 = ISTR("Choose filament:"); ////c=20 r=1
|
||||
const char MSG_HOMEYZ[] PROGMEM_I1 = ISTR("Calibrate Z"); ////c=18
|
||||
const char MSG_CHOOSE_EXTRUDER[] PROGMEM_I1 = ISTR("Choose extruder:"); ////c=20
|
||||
const char MSG_CHOOSE_FILAMENT[] PROGMEM_I1 = ISTR("Choose filament:"); ////c=20
|
||||
const char MSG_LAST_PRINT[] PROGMEM_I1 = ISTR("Last print"); ////c=18
|
||||
const char MSG_LAST_PRINT_FAILURES[] PROGMEM_I1 = ISTR("Last print failures"); ////c=20
|
||||
const char MSG_LOAD_FILAMENT[] PROGMEM_I1 = ISTR("Load filament"); //// Number 1 to 5 is added behind text e.g. "Load filament 1" c=16
|
||||
@ -59,20 +60,21 @@ const char MSG_LOADING_FILAMENT[] PROGMEM_I1 = ISTR("Loading filament"); ////c=2
|
||||
const char MSG_EJECT_FILAMENT[] PROGMEM_I1 = ISTR("Eject filament"); //// Number 1 to 5 is added behind text e.g. "Eject filament 1" c=16
|
||||
const char MSG_CUT_FILAMENT[] PROGMEM_I1 = ISTR("Cut filament"); //// Number 1 to 5 is added behind text e.g. "Cut filament 1" c=16
|
||||
const char MSG_M117_V2_CALIBRATION[] PROGMEM_I1 = ISTR("M117 First layer cal."); ////c=25
|
||||
const char MSG_MAIN[] PROGMEM_I1 = ISTR("Main"); ////
|
||||
const char MSG_BACK[] PROGMEM_I1 = ISTR("Back"); ////
|
||||
const char MSG_MAIN[] PROGMEM_I1 = ISTR("Main"); ////c=18
|
||||
const char MSG_BACK[] PROGMEM_I1 = ISTR("Back"); ////c=18
|
||||
const char MSG_SHEET[] PROGMEM_I1 = ISTR("Sheet"); ////c=10
|
||||
const char MSG_STEEL_SHEETS[] PROGMEM_I1 = ISTR("Steel sheets"); ////c=18
|
||||
const char MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1[] PROGMEM_I1 = ISTR("Measuring reference height of calibration point"); ////c=60
|
||||
const char MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1[] PROGMEM_I1 = ISTR("Measuring reference height of calibration point"); ////c=20 r=3
|
||||
const char MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2[] PROGMEM_I1 = ISTR(" of 9"); ////c=14
|
||||
const char MSG_MENU_CALIBRATION[] PROGMEM_I1 = ISTR("Calibration"); ////
|
||||
const char MSG_MENU_CALIBRATION[] PROGMEM_I1 = ISTR("Calibration"); ////c=18
|
||||
const char MSG_MMU_FAILS[] PROGMEM_I1 = ISTR("MMU fails"); ////c=15
|
||||
const char MSG_MMU_LOAD_FAILS[] PROGMEM_I1 = ISTR("MMU load fails"); ////c=15
|
||||
const char MSG_NO[] PROGMEM_I1 = ISTR("No"); ////
|
||||
const char MSG_NOZZLE[] PROGMEM_I1 = ISTR("Nozzle"); ////
|
||||
const char MSG_NO[] PROGMEM_I1 = ISTR("No"); ////c=4
|
||||
const char MSG_NOZZLE[] PROGMEM_I1 = ISTR("Nozzle"); ////c=12
|
||||
const char MSG_PAPER[] PROGMEM_I1 = ISTR("Place a sheet of paper under the nozzle during the calibration of first 4 points. If the nozzle catches the paper, power off the printer immediately."); ////c=20 r=10
|
||||
const char MSG_PAUSE_PRINT[] PROGMEM_I1 = ISTR("Pause print");////c=18
|
||||
const char MSG_PLACE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please place steel sheet on heatbed."); ////c=20 r=4
|
||||
const char MSG_PINDA[] PROGMEM_I1 = ISTR("PINDA");////c=5
|
||||
const char MSG_PLACE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please place steel sheet on heatbed."); ////c=20 r=5
|
||||
const char MSG_PLEASE_WAIT[] PROGMEM_I1 = ISTR("Please wait"); ////c=20
|
||||
const char MSG_POWER_FAILURES[] PROGMEM_I1 = ISTR("Power failures"); ////c=15
|
||||
const char MSG_PREHEAT_NOZZLE[] PROGMEM_I1 = ISTR("Preheat the nozzle!"); ////c=20
|
||||
@ -80,11 +82,11 @@ const char MSG_PRESS_TO_UNLOAD[] PROGMEM_I1 = ISTR("Please press the knob to unl
|
||||
const char MSG_PRINT_ABORTED[] PROGMEM_I1 = ISTR("Print aborted"); ////c=20
|
||||
const char MSG_PULL_OUT_FILAMENT[] PROGMEM_I1 = ISTR("Please pull out filament immediately"); ////c=20 r=4
|
||||
const char MSG_RECOVER_PRINT[] PROGMEM_I1 = ISTR("Blackout occurred. Recover print?"); ////c=20 r=2
|
||||
const char MSG_REFRESH[] PROGMEM_I1 = ISTR("\x04" "Refresh"); ////
|
||||
const char MSG_REFRESH[] PROGMEM_I1 = ISTR("\x04Refresh"); ////c=18
|
||||
const char MSG_REMOVE_STEEL_SHEET[] PROGMEM_I1 = ISTR("Please remove steel sheet from heatbed."); ////c=20 r=4
|
||||
const char MSG_RESET[] PROGMEM_I1 = ISTR("Reset"); ////c=14
|
||||
const char MSG_RESUME_PRINT[] PROGMEM_I1 = ISTR("Resume print"); ////c=18
|
||||
const char MSG_RESUMING_PRINT[] PROGMEM_I1 = ISTR("Resuming print"); ////
|
||||
const char MSG_RESUMING_PRINT[] PROGMEM_I1 = ISTR("Resuming print"); ////c=20
|
||||
const char MSG_SELFTEST_COOLING_FAN[] PROGMEM_I1 = ISTR("Front print fan?"); ////c=20
|
||||
const char MSG_SELFTEST_EXTRUDER_FAN[] PROGMEM_I1 = ISTR("Left hotend fan?"); ////c=20
|
||||
const char MSG_SELFTEST_FAILED[] PROGMEM_I1 = ISTR("Selftest failed "); ////c=20
|
||||
@ -93,65 +95,65 @@ const char MSG_SELFTEST_FAN_NO[] PROGMEM_I1 = ISTR("Not spinning"); ////c=19
|
||||
const char MSG_SELFTEST_FAN_YES[] PROGMEM_I1 = ISTR("Spinning"); ////c=19
|
||||
const char MSG_SELFTEST_CHECK_BED[] PROGMEM_I1 = ISTR("Checking bed "); ////c=20
|
||||
const char MSG_SELFTEST_CHECK_FSENSOR[] PROGMEM_I1 = ISTR("Checking sensors "); ////c=20
|
||||
const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////
|
||||
const char MSG_SELFTEST_MOTOR[] PROGMEM_I1 = ISTR("Motor"); ////c=18
|
||||
const char MSG_SELFTEST_FILAMENT_SENSOR[] PROGMEM_I1 = ISTR("Filament sensor"); ////c=17
|
||||
const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////
|
||||
const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////
|
||||
const char MSG_SELFTEST_WIRINGERROR[] PROGMEM_I1 = ISTR("Wiring error"); ////c=18
|
||||
const char MSG_SETTINGS[] PROGMEM_I1 = ISTR("Settings"); ////c=18
|
||||
const char MSG_TOTAL[] PROGMEM_I1 = ISTR("Total"); ////c=6
|
||||
const char MSG_TOTAL_FAILURES[] PROGMEM_I1 = ISTR("Total failures"); ////c=20
|
||||
const char MSG_HW_SETUP[] PROGMEM_I1 = ISTR("HW Setup"); ////c=18
|
||||
const char MSG_MODE[] PROGMEM_I1 = ISTR("Mode"); ////
|
||||
const char MSG_HIGH_POWER[] PROGMEM_I1 = ISTR("High power"); ////
|
||||
const char MSG_AUTO_POWER[] PROGMEM_I1 = ISTR("Auto power"); ////
|
||||
const char MSG_SILENT[] PROGMEM_I1 = ISTR("Silent"); ////
|
||||
const char MSG_NORMAL[] PROGMEM_I1 = ISTR("Normal"); ////
|
||||
const char MSG_STEALTH[] PROGMEM_I1 = ISTR("Stealth"); ////
|
||||
const char MSG_MODE[] PROGMEM_I1 = ISTR("Mode"); ////c=6
|
||||
const char MSG_HIGH_POWER[] PROGMEM_I1 = ISTR("High power"); ////c=10
|
||||
const char MSG_AUTO_POWER[] PROGMEM_I1 = ISTR("Auto power"); ////c=10
|
||||
const char MSG_SILENT[] PROGMEM_I1 = ISTR("Silent"); ////c=7
|
||||
const char MSG_NORMAL[] PROGMEM_I1 = ISTR("Normal"); ////c=7
|
||||
const char MSG_STEALTH[] PROGMEM_I1 = ISTR("Stealth"); ////c=7
|
||||
const char MSG_STEEL_SHEET_CHECK[] PROGMEM_I1 = ISTR("Is steel sheet on heatbed?"); ////c=20 r=2
|
||||
const char MSG_STOP_PRINT[] PROGMEM_I1 = ISTR("Stop print"); ////
|
||||
const char MSG_STOPPED[] PROGMEM_I1 = ISTR("STOPPED. "); ////
|
||||
const char MSG_STOP_PRINT[] PROGMEM_I1 = ISTR("Stop print"); ////c=18
|
||||
const char MSG_STOPPED[] PROGMEM_I1 = ISTR("STOPPED. "); ////c=20
|
||||
const char MSG_TEMP_CALIBRATION[] PROGMEM_I1 = ISTR("Temp. cal."); ////c=14
|
||||
const char MSG_TEMP_CALIBRATION_DONE[] PROGMEM_I1 = ISTR("Temperature calibration is finished and active. Temp. calibration can be disabled in menu Settings->Temp. cal."); ////c=20 r=12
|
||||
const char MSG_UNLOAD_FILAMENT[] PROGMEM_I1 = ISTR("Unload filament"); ////c=17
|
||||
const char MSG_UNLOADING_FILAMENT[] PROGMEM_I1 = ISTR("Unloading filament"); ////c=20 r=1
|
||||
const char MSG_WATCH[] PROGMEM_I1 = ISTR("Info screen"); ////
|
||||
const char MSG_UNLOAD_FILAMENT[] PROGMEM_I1 = ISTR("Unload filament"); ////Number 1 to 5 is added behind text e.g. "Unload filament" c=16
|
||||
const char MSG_UNLOADING_FILAMENT[] PROGMEM_I1 = ISTR("Unloading filament"); ////c=20
|
||||
const char MSG_WATCH[] PROGMEM_I1 = ISTR("Info screen"); ////c=18
|
||||
const char MSG_WIZARD_CALIBRATION_FAILED[] PROGMEM_I1 = ISTR("Please check our handbook and fix the problem. Then resume the Wizard by rebooting the printer."); ////c=20 r=8
|
||||
const char MSG_WIZARD_DONE[] PROGMEM_I1 = ISTR("All is done. Happy printing!"); ////c=20 r=8
|
||||
const char MSG_WIZARD_HEATING[] PROGMEM_I1 = ISTR("Preheating nozzle. Please wait."); ////c=20 r=3
|
||||
const char MSG_WIZARD_QUIT[] PROGMEM_I1 = ISTR("You can always resume the Wizard from Calibration -> Wizard."); ////c=20 r=8
|
||||
const char MSG_WIZARD_WELCOME[] PROGMEM_I1 = ISTR("Hi, I am your Original Prusa i3 printer. Would you like me to guide you through the setup process?"); //// c=20 r=7
|
||||
const char MSG_WIZARD_WELCOME_SHIPPING[] PROGMEM_I1 = ISTR("Hi, I am your Original Prusa i3 printer. I will guide you through a short setup process, in which the Z-axis will be calibrated. Then, you will be ready to print."); ////c=20 r=16
|
||||
const char MSG_YES[] PROGMEM_I1 = ISTR("Yes"); ////
|
||||
const char MSG_YES[] PROGMEM_I1 = ISTR("Yes"); ////c=3
|
||||
const char MSG_V2_CALIBRATION[] PROGMEM_I1 = ISTR("First layer cal."); ////c=18
|
||||
const char WELCOME_MSG[] PROGMEM_I1 = ISTR(CUSTOM_MENDEL_NAME " OK."); ////c=20
|
||||
const char MSG_OFF[] PROGMEM_I1 = ISTR("Off"); ////
|
||||
const char MSG_ON[] PROGMEM_I1 = ISTR("On"); ////
|
||||
const char MSG_NA[] PROGMEM_I1 = ISTR("N/A"); ////
|
||||
const char MSG_AUTO_DEPLETE[] PROGMEM_I1 = ISTR("SpoolJoin"); ////
|
||||
const char MSG_OFF[] PROGMEM_I1 = ISTR("Off"); ////c=3
|
||||
const char MSG_ON[] PROGMEM_I1 = ISTR("On"); ////c=3
|
||||
const char MSG_NA[] PROGMEM_I1 = ISTR("N/A"); ////c=3
|
||||
const char MSG_AUTO_DEPLETE[] PROGMEM_I1 = ISTR("SpoolJoin"); ////c=13
|
||||
const char MSG_CUTTER[] PROGMEM_I1 = ISTR("Cutter"); ////c=9
|
||||
const char MSG_NONE[] PROGMEM_I1 = ISTR("None"); ////
|
||||
const char MSG_WARN[] PROGMEM_I1 = ISTR("Warn"); ////
|
||||
const char MSG_STRICT[] PROGMEM_I1 = ISTR("Strict"); ////
|
||||
const char MSG_MODEL[] PROGMEM_I1 = ISTR("Model"); ////
|
||||
const char MSG_FIRMWARE[] PROGMEM_I1 = ISTR("Firmware"); ////
|
||||
const char MSG_GCODE[] PROGMEM_I1 = ISTR("Gcode"); ////
|
||||
const char MSG_NONE[] PROGMEM_I1 = ISTR("None"); ////c=8
|
||||
const char MSG_WARN[] PROGMEM_I1 = ISTR("Warn"); ////c=8
|
||||
const char MSG_STRICT[] PROGMEM_I1 = ISTR("Strict"); ////c=8
|
||||
const char MSG_MODEL[] PROGMEM_I1 = ISTR("Model"); ////c=8
|
||||
const char MSG_FIRMWARE[] PROGMEM_I1 = ISTR("Firmware"); ////c=8
|
||||
const char MSG_GCODE[] PROGMEM_I1 = ISTR("Gcode"); ////c=8
|
||||
const char MSG_GCODE_DIFF_PRINTER_CONTINUE[] PROGMEM_I1 = ISTR("G-code sliced for a different printer type. Continue?"); ////c=20 r=5
|
||||
const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again. Print cancelled."); ////c=20 r=7
|
||||
const char MSG_NOZZLE_DIAMETER[] PROGMEM_I1 = ISTR("Nozzle d."); ////
|
||||
const char MSG_MMU_MODE[] PROGMEM_I1 = ISTR("MMU Mode"); ////
|
||||
const char MSG_SD_CARD[] PROGMEM_I1 = ISTR("SD card"); ////
|
||||
const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[] PROGMEM_I1 = ISTR("FlashAir"); ////
|
||||
const char MSG_SORT[] PROGMEM_I1 = ISTR("Sort"); ////
|
||||
const char MSG_SORT_TIME[] PROGMEM_I1 = ISTR("Time"); ////
|
||||
const char MSG_SORT_ALPHA[] PROGMEM_I1 = ISTR("Alphabet"); ////
|
||||
const char MSG_RPI_PORT[] PROGMEM_I1 = ISTR("RPi port"); ////
|
||||
const char MSG_SOUND[] PROGMEM_I1 = ISTR("Sound"); ////
|
||||
const char MSG_SOUND_LOUD[] PROGMEM_I1 = ISTR("Loud"); ////
|
||||
const char MSG_SOUND_ONCE[] PROGMEM_I1 = ISTR("Once"); ////
|
||||
const char MSG_SOUND_BLIND[] PROGMEM_I1 = ISTR("Assist"); ////
|
||||
const char MSG_MESH[] PROGMEM_I1 = ISTR("Mesh"); ////
|
||||
const char MSG_GCODE_DIFF_PRINTER_CANCELLED[] PROGMEM_I1 =ISTR("G-code sliced for a different printer type. Please re-slice the model again. Print cancelled."); ////c=20 r=8
|
||||
const char MSG_NOZZLE_DIAMETER[] PROGMEM_I1 = ISTR("Nozzle d."); ////c=10
|
||||
const char MSG_MMU_MODE[] PROGMEM_I1 = ISTR("MMU Mode"); ////c=8
|
||||
const char MSG_SD_CARD[] PROGMEM_I1 = ISTR("SD card"); ////c=8
|
||||
const char MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY[] PROGMEM_I1 = ISTR("FlashAir"); ////c=8
|
||||
const char MSG_SORT[] PROGMEM_I1 = ISTR("Sort"); ////c=7
|
||||
const char MSG_SORT_TIME[] PROGMEM_I1 = ISTR("Time"); ////c=8
|
||||
const char MSG_SORT_ALPHA[] PROGMEM_I1 = ISTR("Alphabet"); ////c=8
|
||||
const char MSG_RPI_PORT[] PROGMEM_I1 = ISTR("RPi port"); ////c=13
|
||||
const char MSG_SOUND[] PROGMEM_I1 = ISTR("Sound"); ////c=9
|
||||
const char MSG_SOUND_LOUD[] PROGMEM_I1 = ISTR("Loud"); ////c=7
|
||||
const char MSG_SOUND_ONCE[] PROGMEM_I1 = ISTR("Once"); ////c=7
|
||||
const char MSG_SOUND_BLIND[] PROGMEM_I1 = ISTR("Assist"); ////c=7
|
||||
const char MSG_MESH[] PROGMEM_I1 = ISTR("Mesh"); ////c=12
|
||||
const char MSG_MESH_BED_LEVELING[] PROGMEM_I1 = ISTR("Mesh Bed Leveling"); ////c=18
|
||||
const char MSG_Z_PROBE_NR[] PROGMEM_I1 = ISTR("Z-probe nr."); ////
|
||||
const char MSG_MAGNETS_COMP[] PROGMEM_I1 = ISTR("Magnets comp."); ////
|
||||
const char MSG_Z_PROBE_NR[] PROGMEM_I1 = ISTR("Z-probe nr."); ////c=14
|
||||
const char MSG_MAGNETS_COMP[] PROGMEM_I1 = ISTR("Magnets comp."); ////c=13
|
||||
const char MSG_FS_ACTION[] PROGMEM_I1 = ISTR("FS Action"); ////c=10
|
||||
const char MSG_FS_CONTINUE[] PROGMEM_I1 = ISTR("Cont."); ////c=5
|
||||
const char MSG_FS_PAUSE[] PROGMEM_I1 = ISTR("Pause"); ////c=5
|
||||
|
@ -18,6 +18,7 @@ extern const char MSG_BED_HEATING[];
|
||||
extern const char MSG_BED_LEVELING_FAILED_POINT_LOW[];
|
||||
extern const char MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED[];
|
||||
extern const char MSG_BELT_STATUS[];
|
||||
extern const char MSG_CANCEL[];
|
||||
extern const char MSG_CALIBRATE_Z_AUTO[];
|
||||
extern const char MSG_CARD_MENU[];
|
||||
extern const char MSG_CHECKING_X[];
|
||||
@ -71,6 +72,7 @@ extern const char MSG_NO[];
|
||||
extern const char MSG_NOZZLE[];
|
||||
extern const char MSG_PAPER[];
|
||||
extern const char MSG_PAUSE_PRINT[];
|
||||
extern const char MSG_PINDA[];
|
||||
extern const char MSG_PLACE_STEEL_SHEET[];
|
||||
extern const char MSG_PLEASE_WAIT[];
|
||||
extern const char MSG_POWER_FAILURES[];
|
||||
|
@ -718,12 +718,12 @@ void manage_response(bool move_axes, bool turn_off_nozzle, uint8_t move)
|
||||
|
||||
//first three lines are used for printing multiscreen message; last line contains measured and target nozzle temperature
|
||||
if (screen == 0) { //screen 0
|
||||
lcd_display_message_fullscreen_P(_i("MMU needs user attention."));
|
||||
lcd_display_message_fullscreen_P(_i("MMU needs user attention."));////MSG_MMU_USER_ATTENTION c=20 r=3
|
||||
screen++;
|
||||
}
|
||||
else { //screen 1
|
||||
if((degTargetHotend(active_extruder) == 0) && turn_off_nozzle) lcd_display_message_fullscreen_P(_i("Press the knob to resume nozzle temperature."));
|
||||
else lcd_display_message_fullscreen_P(_i("Fix the issue and then press button on MMU unit."));
|
||||
if((degTargetHotend(active_extruder) == 0) && turn_off_nozzle) lcd_display_message_fullscreen_P(_i("Press the knob to resume nozzle temperature."));////MSG_RESUME_NOZZLE_TEMP c=20 r=4
|
||||
else lcd_display_message_fullscreen_P(_i("Fix the issue and then press button on MMU unit."));////MSG_MMU_FIX_ISSUE c=20 r=4
|
||||
screen=0;
|
||||
}
|
||||
|
||||
@ -1383,7 +1383,7 @@ void mmu_cut_filament(uint8_t filament_nr)
|
||||
{
|
||||
LcdUpdateDisabler disableLcdUpdate;
|
||||
lcd_clear();
|
||||
lcd_puts_at_P(0, 1, _i("Cutting filament")); //// c=18
|
||||
lcd_puts_at_P(0, 1, _i("Cutting filament")); ////MSG_MMU_CUTTING_FIL c=18
|
||||
lcd_print(' ');
|
||||
lcd_print(filament_nr + 1);
|
||||
mmu_filament_ramming();
|
||||
@ -1583,7 +1583,7 @@ void mmu_continue_loading(bool blocking)
|
||||
manage_response(false, true, MMU_UNLOAD_MOVE);
|
||||
|
||||
setAllTargetHotends(0);
|
||||
lcd_setstatuspgm(_i("MMU load failed "));////c=20 r=1
|
||||
lcd_setstatuspgm(_i("MMU load failed "));////MSG_MMU_LOAD_FAILED c=20
|
||||
|
||||
if (blocking)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -393,13 +393,13 @@ switch(oCheckMode)
|
||||
{
|
||||
case ClCheckMode::_Warn:
|
||||
// lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("Printer nozzle diameter differs from the G-code. Continue?"));////MSG_NOZZLE_DIFFERS_CONTINUE c=20 r=5
|
||||
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
|
||||
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
|
||||
lcd_update_enable(true); // display / status-line recovery
|
||||
break;
|
||||
case ClCheckMode::_Strict:
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."));
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("Printer nozzle diameter differs from the G-code. Please check the value in settings. Print cancelled."));////MSG_NOZZLE_DIFFERS_CANCELLED c=20 r=9
|
||||
lcd_print_stop();
|
||||
break;
|
||||
case ClCheckMode::_None:
|
||||
@ -479,13 +479,13 @@ switch(oCheckVersion)
|
||||
{
|
||||
case ClCheckVersion::_Warn:
|
||||
// lcd_show_fullscreen_message_and_wait_P(_i("Printer FW version differs from the G-code. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("G-code sliced for a newer firmware. Continue?"));////MSG_GCODE_NEWER_FIRMWARE_CONTINUE c=20 r=5
|
||||
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
|
||||
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
|
||||
lcd_update_enable(true); // display / status-line recovery
|
||||
break;
|
||||
case ClCheckVersion::_Strict:
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."));
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a newer firmware. Please update the firmware. Print cancelled."));////MSG_GCODE_NEWER_FIRMWARE_CANCELLED c=20 r=8
|
||||
lcd_print_stop();
|
||||
break;
|
||||
case ClCheckVersion::_None:
|
||||
@ -512,13 +512,13 @@ switch(oCheckGcode)
|
||||
{
|
||||
case ClCheckGcode::_Warn:
|
||||
// lcd_show_fullscreen_message_and_wait_P(_i("Printer G-code level differs from the G-code. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?"));
|
||||
lcd_display_message_fullscreen_P(_i("G-code sliced for a different level. Continue?"));////MSG_GCODE_DIFF_CONTINUE c=20 r=4
|
||||
lcd_wait_for_click_delay(MSG_PRINT_CHECKING_FAILED_TIMEOUT);
|
||||
//???custom_message_type=CUSTOM_MSG_TYPE_STATUS; // display / status-line recovery
|
||||
lcd_update_enable(true); // display / status-line recovery
|
||||
break;
|
||||
case ClCheckGcode::_Strict:
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a different level. Please re-slice the model again. Print cancelled."));
|
||||
lcd_show_fullscreen_message_and_wait_P(_i("G-code sliced for a different level. Please re-slice the model again. Print cancelled."));////MSG_GCODE_DIFF_CANCELLED c=20 r=7
|
||||
lcd_print_stop();
|
||||
break;
|
||||
case ClCheckGcode::_None:
|
||||
|
@ -17,7 +17,9 @@ export OBJCOPY=$ARDUINO/hardware/tools/avr/bin/avr-objcopy
|
||||
export OBJDUMP=$ARDUINO/hardware/tools/avr/bin/avr-objdump
|
||||
#
|
||||
# Output folder:
|
||||
export OUTDIR="../../Prusa-Firmware-build"
|
||||
if [ -z "$OUTDIR" ]; then
|
||||
export OUTDIR="../../Prusa-Firmware-build"
|
||||
fi
|
||||
#
|
||||
# Objects folder:
|
||||
export OBJDIR="$OUTDIR/sketch"
|
||||
|
@ -88,7 +88,7 @@ generate_binary()
|
||||
rm -f lang_$1.dat
|
||||
LNG=$1
|
||||
#check lang dictionary
|
||||
./lang-check.py $1 --no-warning
|
||||
./lang-check.py $1 #--no-warning
|
||||
#create lang_xx.tmp - different processing for 'en' language
|
||||
if [ "$1" = "en" ]; then
|
||||
#remove comments and empty lines
|
||||
|
@ -1,8 +1,57 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# Version 1.0.1
|
||||
#
|
||||
#############################################################################
|
||||
# Change log:
|
||||
# 7 May 2019, Ondrej Tuma, Initial
|
||||
# 9 June 2020, 3d-gussner, Added version and Change log
|
||||
# 9 June 2020, 3d-gussner, Wrap text to 20 char and rows
|
||||
# 9 June 2020, 3d-gussner, colored output
|
||||
# 2 Apr. 2021, 3d-gussner, Fix and improve text warp
|
||||
# 22 Apr. 2021, DRracer, add English source to output
|
||||
#############################################################################
|
||||
#
|
||||
"""Check lang files."""
|
||||
from argparse import ArgumentParser
|
||||
from traceback import print_exc
|
||||
from sys import stderr
|
||||
from sys import stdout, stderr
|
||||
import textwrap
|
||||
|
||||
def color_maybe(color_attr, text):
|
||||
if stdout.isatty():
|
||||
return '\033[0;' + str(color_attr) + 'm' + text + '\033[0m'
|
||||
else:
|
||||
return text
|
||||
|
||||
red = lambda text: color_maybe(31, text)
|
||||
green = lambda text: color_maybe(32, text)
|
||||
yellow = lambda text: color_maybe(33, text)
|
||||
|
||||
|
||||
def print_wrapped(wrapped_text, rows, cols):
|
||||
if type(wrapped_text) == str:
|
||||
wrapped_text = [wrapped_text]
|
||||
for r, line in enumerate(wrapped_text):
|
||||
r_ = str(r + 1).rjust(3)
|
||||
if r >= rows:
|
||||
r_ = color_maybe(31, r_)
|
||||
print((' {} |{:' + str(cols) + 's}|').format(r_, line))
|
||||
|
||||
def print_truncated(text, cols):
|
||||
if len(text) <= cols:
|
||||
prefix = text.ljust(cols)
|
||||
suffix = ''
|
||||
else:
|
||||
prefix = text[0:cols]
|
||||
suffix = color_maybe(31, text[cols:])
|
||||
print(' |' + prefix + '|' + suffix)
|
||||
|
||||
|
||||
def unescape(text):
|
||||
if '\\' not in text:
|
||||
return text
|
||||
return text.encode('ascii').decode('unicode_escape')
|
||||
|
||||
|
||||
def parse_txt(lang, no_warning):
|
||||
@ -12,48 +61,94 @@ def parse_txt(lang, no_warning):
|
||||
else:
|
||||
file_path = "lang_en_%s.txt" % lang
|
||||
|
||||
print(green("Start %s lang-check" % lang))
|
||||
|
||||
lines = 1
|
||||
with open(file_path) as src:
|
||||
while True:
|
||||
comment = src.readline().split(' ')
|
||||
src.readline() # source
|
||||
translation = src.readline()[:-1]
|
||||
#print (comment) #Debug
|
||||
|
||||
#Check if columns and rows are defined
|
||||
cols = None
|
||||
rows = None
|
||||
for item in comment[1:]:
|
||||
key, val = item.split('=')
|
||||
if key == 'c':
|
||||
cols = int(val)
|
||||
#print ("c=",cols) #Debug
|
||||
elif key == 'r':
|
||||
rows = int(val)
|
||||
#print ("r=",rows) #Debug
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Unknown display definition %s on line %d" %
|
||||
(' '.join(comment), lines))
|
||||
if cols is None and rows is None:
|
||||
if not no_warning:
|
||||
print("[W]: No display definition on line %d" % lines)
|
||||
print(yellow("[W]: No display definition on line %d" % lines))
|
||||
cols = len(translation) # propably fullscreen
|
||||
if rows is None:
|
||||
rows = 1
|
||||
elif rows > 1 and cols != 20:
|
||||
print(yellow("[W]: Multiple rows with odd number of columns on line %d" % lines))
|
||||
|
||||
if len(translation)-2 > cols*rows:
|
||||
stderr.write(
|
||||
"[E]: Text %s is longer then definiton on line %d\n" %
|
||||
(translation, lines))
|
||||
stderr.flush()
|
||||
#Wrap text to 20 chars and rows
|
||||
source = src.readline()[:-1].strip('"')
|
||||
#print (source) #Debug
|
||||
translation = src.readline()[:-1].strip('"')
|
||||
if translation == '\\x00':
|
||||
# crude hack to handle intentionally-empty translations
|
||||
translation = ''
|
||||
|
||||
# handle backslash sequences
|
||||
source = unescape(source)
|
||||
translation = unescape(translation)
|
||||
|
||||
#print (translation) #Debug
|
||||
wrapped_source = list(textwrap.TextWrapper(width=cols).wrap(source))
|
||||
rows_count_source = len(wrapped_source)
|
||||
wrapped_translation = list(textwrap.TextWrapper(width=cols).wrap(translation))
|
||||
rows_count_translation = len(wrapped_translation)
|
||||
#End wrap text
|
||||
|
||||
# Check for potential errors in the definition
|
||||
if rows == 1 and (len(source) > cols or rows_count_source > rows):
|
||||
print(yellow('[W]: Source text longer than %d cols as defined on line %d:' % (cols, lines)))
|
||||
print_truncated(source, cols)
|
||||
print()
|
||||
elif rows_count_source > rows:
|
||||
print(yellow('[W]: Wrapped source text longer than %d rows as defined on line %d:' % (rows, lines)))
|
||||
print_wrapped(wrapped_source, rows, cols)
|
||||
print()
|
||||
|
||||
# Check for translation lenght
|
||||
if (rows_count_translation > rows) or (rows == 1 and len(translation) > cols):
|
||||
print(red('[E]: Text is longer then definition on line %d: rows diff=%d cols=%d rows=%d'
|
||||
% (lines, rows_count_translation-rows, cols, rows)))
|
||||
if rows == 1:
|
||||
print(yellow(' source text:'))
|
||||
print_truncated(source, cols)
|
||||
print(yellow(' translated text:'))
|
||||
print_truncated(translation, cols)
|
||||
else:
|
||||
print(yellow(' source text:'))
|
||||
print_wrapped(wrapped_source, rows, cols)
|
||||
print(yellow(' translated text:'))
|
||||
print_wrapped(wrapped_translation, rows, cols)
|
||||
print()
|
||||
|
||||
if len(src.readline()) != 1: # empty line
|
||||
break
|
||||
lines += 4
|
||||
print(green("End %s lang-check" % lang))
|
||||
|
||||
|
||||
def main():
|
||||
"""Main function."""
|
||||
parser = ArgumentParser(
|
||||
description=__doc__,
|
||||
usage="$(prog)s lang")
|
||||
usage="%(prog)s lang")
|
||||
parser.add_argument(
|
||||
"lang", nargs='?', default="en", type=str,
|
||||
help="Check lang file (en|cs|de|es|fr|nl|it|pl)")
|
||||
|
445
lang/lang_en.txt
445
lang/lang_en.txt
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user