Use a STR_ prefix for non-translated strings

This commit is contained in:
Scott Lahteine
2020-02-26 03:02:03 -06:00
parent 6b9a17be16
commit e78f607ef3
65 changed files with 438 additions and 431 deletions

View File

@ -248,7 +248,7 @@ void CardReader::printListing(SdFile parent, const char * const prepend/*=nullpt
SdFile child;
if (!child.open(&parent, dosFilename, O_READ)) {
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_SD_CANT_OPEN_SUBDIR, dosFilename);
SERIAL_ECHOLNPAIR(STR_SD_CANT_OPEN_SUBDIR, dosFilename);
}
printListing(child, path);
// close() is done automatically by destructor of SdFile
@ -318,7 +318,7 @@ void CardReader::ls() {
if (!dir.open(&diveDir, segment, O_READ)) {
SERIAL_EOL();
SERIAL_ECHO_START();
SERIAL_ECHOPAIR(MSG_SD_CANT_OPEN_SUBDIR, segment);
SERIAL_ECHOPAIR(STR_SD_CANT_OPEN_SUBDIR, segment);
break;
}
@ -362,14 +362,14 @@ void CardReader::mount() {
#if defined(LCD_SDSS) && (LCD_SDSS != SDSS)
&& !sd2card.init(SPI_SPEED, LCD_SDSS)
#endif
) SERIAL_ECHO_MSG(MSG_SD_INIT_FAIL);
) SERIAL_ECHO_MSG(STR_SD_INIT_FAIL);
else if (!volume.init(&sd2card))
SERIAL_ERROR_MSG(MSG_SD_VOL_INIT_FAIL);
SERIAL_ERROR_MSG(STR_SD_VOL_INIT_FAIL);
else if (!root.openRoot(&volume))
SERIAL_ERROR_MSG(MSG_SD_OPENROOT_FAIL);
SERIAL_ERROR_MSG(STR_SD_OPENROOT_FAIL);
else {
flag.mounted = true;
SERIAL_ECHO_MSG(MSG_SD_CARD_OK);
SERIAL_ECHO_MSG(STR_SD_CARD_OK);
#if ENABLED(EEPROM_SETTINGS) && NONE(FLASH_EEPROM_EMULATION, SPI_EEPROM, I2C_EEPROM)
settings.first_load();
#endif
@ -446,7 +446,7 @@ void CardReader::getAbsFilename(char *dst) {
}
void openFailed(const char * const fname) {
SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, fname, ".");
SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, fname, ".");
}
void announceOpen(const uint8_t doing, const char * const path) {
@ -511,8 +511,8 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*
if (file.open(curDir, fname, O_READ)) {
filesize = file.fileSize();
sdpos = 0;
SERIAL_ECHOLNPAIR(MSG_SD_FILE_OPENED, fname, MSG_SD_SIZE, filesize);
SERIAL_ECHOLNPGM(MSG_SD_FILE_SELECTED);
SERIAL_ECHOLNPAIR(STR_SD_FILE_OPENED, fname, STR_SD_SIZE, filesize);
SERIAL_ECHOLNPGM(STR_SD_FILE_SELECTED);
selectFileByName(fname);
ui.set_status(longFilename[0] ? longFilename : fname);
@ -521,6 +521,10 @@ void CardReader::openFileRead(char * const path, const uint8_t subcall_type/*=0*
openFailed(fname);
}
inline void echo_write_to_file(char * const fname) {
SERIAL_ECHOLNPAIR(STR_SD_WRITE_TO_FILE, fname);
}
//
// Open a file by DOS path for write
//
@ -542,7 +546,7 @@ void CardReader::openFileWrite(char * const path) {
#if ENABLED(EMERGENCY_PARSER)
emergency_parser.disable();
#endif
SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, fname);
echo_write_to_file(fname);
ui.set_status(fname);
}
else
@ -574,13 +578,13 @@ void CardReader::removeFile(const char * const name) {
void CardReader::report_status() {
if (isPrinting()) {
SERIAL_ECHOPGM(MSG_SD_PRINTING_BYTE);
SERIAL_ECHOPGM(STR_SD_PRINTING_BYTE);
SERIAL_ECHO(sdpos);
SERIAL_CHAR('/');
SERIAL_ECHOLN(filesize);
}
else
SERIAL_ECHOLNPGM(MSG_SD_NOT_PRINTING);
SERIAL_ECHOLNPGM(STR_SD_NOT_PRINTING);
}
void CardReader::write_command(char * const buf) {
@ -598,7 +602,7 @@ void CardReader::write_command(char * const buf) {
end[3] = '\0';
file.write(begin);
if (file.writeError) SERIAL_ERROR_MSG(MSG_SD_ERR_WRITE_TO_FILE);
if (file.writeError) SERIAL_ERROR_MSG(STR_SD_ERR_WRITE_TO_FILE);
}
//
@ -739,7 +743,7 @@ const char* CardReader::diveToFile(const bool update_cwd, SdFile*& curDir, const
// Open curDir
if (!sub->open(curDir, dosSubdirname, O_READ)) {
SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, dosSubdirname, ".");
SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, dosSubdirname, ".");
return nullptr;
}
@ -779,7 +783,7 @@ void CardReader::cd(const char * relpath) {
}
else {
SERIAL_ECHO_START();
SERIAL_ECHOLNPAIR(MSG_SD_CANT_ENTER_SUBDIR, relpath);
SERIAL_ECHOLNPAIR(STR_SD_CANT_ENTER_SUBDIR, relpath);
}
}
@ -1113,9 +1117,9 @@ void CardReader::fileHasFinished() {
if (!isMounted()) return;
if (recovery.file.isOpen()) return;
if (!recovery.file.open(&root, recovery.filename, read ? O_READ : O_CREAT | O_WRITE | O_TRUNC | O_SYNC))
SERIAL_ECHOLNPAIR(MSG_SD_OPEN_FILE_FAIL, recovery.filename, ".");
SERIAL_ECHOLNPAIR(STR_SD_OPEN_FILE_FAIL, recovery.filename, ".");
else if (!read)
SERIAL_ECHOLNPAIR(MSG_SD_WRITE_TO_FILE, recovery.filename);
echo_write_to_file(recovery.filename);
}
// Removing the job recovery file currently requires closing