FIX: Add the prefix 'a' or 'an' based on the pronunciation of the first letter of the machine name.

Change-Id: I83c587fda985528cd9ec60c54bf67cd5ab1685a7
Jira: STUDIO-13668
(cherry picked from commit 3a042857c1d38ed16076b30f80bd34b10b0dc3be)
This commit is contained in:
weizhen.xie 2025-08-01 16:42:16 +08:00 committed by Noisyfox
parent 54d9abadcb
commit eeb8b2111c

View file

@ -15916,12 +15916,17 @@ wxString Plater::get_selected_printer_name_in_combox() {
void Plater::pop_warning_and_go_to_device_page(wxString printer_name, PrinterWarningType type, const wxString &title)
{
printer_name.Replace("Bambu Lab", "", false);
char first_char = std::toupper(printer_name[1]);
const std::unordered_set<char> an_letters = {'A', 'E', 'F', 'H', 'I', 'L', 'M', 'N', 'O', 'R', 'S', 'X'};
printer_name = (an_letters.count(first_char) > 0 ? "an " : "a ") + printer_name;
wxString content;
if (type == PrinterWarningType::NOT_CONNECTED) {
content = wxString::Format(_L("Printer not connected. Please go to the device page to connect an %s printer before syncing."), printer_name);
content = wxString::Format(_L("Printer not connected. Please go to the device page to connect %s printer before syncing."), printer_name);
} else if (type == PrinterWarningType::INCONSISTENT) {
content = wxString::Format(_L("The currently connected printer on the device page is not an %s. Please switch to an %s before syncing."), printer_name, printer_name);
content = wxString::Format(_L("The currently connected printer on the device page is not %s. Please switch to %s before syncing."), printer_name, printer_name);
} else if (type == PrinterWarningType::UNINSTALL_FILAMENT) {
content = _L("There are no filaments on the printer. Please load the filaments on the printer first.");
} else if (type == PrinterWarningType::EMPTY_FILAMENT) {