diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/pv/data/decoderstack.cpp index 5643fc5f..2807b7e7 100644 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/pv/data/decoderstack.cpp @@ -36,6 +36,8 @@ #include "../dsvdef.h" #include "../log.h" +#include "../ui/langresource.h" + using namespace pv::data::decode; using namespace std; using namespace boost; @@ -426,8 +428,8 @@ void DecoderStack::do_decode_work() // Check that all decoders have the required channels for(auto &dec : _stack) if (!dec->have_required_probes()) { - _error_message = tr("One or more required channels " - "have not been specified"); + _error_message = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR), + "One or more required channels \nhave not been specified"); return; } @@ -528,7 +530,8 @@ void DecoderStack::decode_data(const uint64_t decode_start, const uint64_t decod chunk.push_back(_snapshot->get_samples(i, chunk_end, sig_index)); chunk_const.push_back(_snapshot->get_sample(i, sig_index)); } else { - _error_message = tr("At least one of selected channels are not enabled."); + _error_message = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_DATA_ERROR), + "At least one of selected channels are not enabled."); return; } } @@ -617,7 +620,8 @@ void DecoderStack::execute_decode_stack() if (!di) { - _error_message = tr("Failed to create decoder instance"); + _error_message =L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DECODERSTACK_DECODE_STACK_ERROR), + "Failed to create decoder instance"); srd_session_destroy(session); return; } diff --git a/DSView/pv/data/mathstack.cpp b/DSView/pv/data/mathstack.cpp index 410c8b2e..e87401ec 100644 --- a/DSView/pv/data/mathstack.cpp +++ b/DSView/pv/data/mathstack.cpp @@ -239,7 +239,8 @@ view::dslDial * MathStack::get_vDial() QString MathStack::get_unit(int level) { if (level >= vDialUnitCount) - return tr(" "); + //tr + return " "; QString unit; switch(_type) { diff --git a/DSView/pv/dialogs/about.cpp b/DSView/pv/dialogs/about.cpp index 4a8be675..0919f5f1 100644 --- a/DSView/pv/dialogs/about.cpp +++ b/DSView/pv/dialogs/about.cpp @@ -34,6 +34,7 @@ #include "../config/appconfig.h" #include "../dsvdef.h" #include "../utility/encoding.h" +#include "../ui/langresource.h" namespace pv { namespace dialogs { @@ -112,7 +113,7 @@ About::About(QWidget *parent) : xlayout->addWidget(about); layout()->addLayout(xlayout); - setTitle(tr("About")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ABOUT), "About")); } About::~About() diff --git a/DSView/pv/dialogs/applicationpardlg.cpp b/DSView/pv/dialogs/applicationpardlg.cpp index 536c04d0..9ef1fc1a 100644 --- a/DSView/pv/dialogs/applicationpardlg.cpp +++ b/DSView/pv/dialogs/applicationpardlg.cpp @@ -26,6 +26,8 @@ #include #include "../config/appconfig.h" +#include "../ui/langresource.h" + namespace pv { namespace dialogs @@ -43,7 +45,7 @@ ApplicationParamDlg::~ApplicationParamDlg() bool ApplicationParamDlg::ShowDlg(QWidget *parent) { DSDialog dlg(parent, true, true); - dlg.setTitle(tr("Display options")); + dlg.setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DISPLAY_OPTIONS), "Display options")); dlg.setMinimumSize(300, 200); QFormLayout &lay = *(new QFormLayout()); lay.setContentsMargins(0,20,0,30); @@ -53,7 +55,7 @@ bool ApplicationParamDlg::ShowDlg(QWidget *parent) QCheckBox *ck_quickScroll = new QCheckBox(); ck_quickScroll->setChecked(app._appOptions.quickScroll); - lay.addRow(tr("Quick scroll"), ck_quickScroll); + lay.addRow(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_QUICK_SCROLL), "Quick scroll"), ck_quickScroll); dlg.layout()->addLayout(&lay); dlg.exec(); diff --git a/DSView/pv/dialogs/calibration.cpp b/DSView/pv/dialogs/calibration.cpp index be5282f3..2bec701e 100644 --- a/DSView/pv/dialogs/calibration.cpp +++ b/DSView/pv/dialogs/calibration.cpp @@ -34,6 +34,7 @@ #include "../appcontrol.h" #include "../sigsession.h" +#include "../ui/langresource.h" using namespace std; @@ -115,12 +116,12 @@ void Calibration::changeEvent(QEvent *event) void Calibration::retranslateUi() { - _save_btn->setText(tr("Save")); - _abort_btn->setText(tr("Abort")); - _reset_btn->setText(tr("Reset")); - _exit_btn->setText(tr("Exit")); + _save_btn->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVE), "Save")); + _abort_btn->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ABOUT), "About")); + _reset_btn->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RESET), "Reset")); + _exit_btn->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EXIT), "Exit")); - setTitle(tr("Manual Calibration")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MANUAL_CALIBRATION), "Manual Calibration")); } void Calibration::update_device_info() @@ -171,7 +172,7 @@ void Calibration::update_device_info() gain_slider->setRange(-vgain_range/2, vgain_range/2); gain_slider->setValue(vgain - vgain_default); gain_slider->setObjectName(VGAIN+probe->index); - QString gain_string = tr("Channel") + QString::number(probe->index) + VGAIN; + QString gain_string = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel") + QString::number(probe->index) + VGAIN; QLabel *gain_label = new QLabel(gain_string, this); _flayout->addRow(gain_label, gain_slider); _slider_list.push_back(gain_slider); @@ -193,7 +194,7 @@ void Calibration::update_device_info() off_slider->setRange(0, voff_range); off_slider->setValue(voff); off_slider->setObjectName(VOFF+probe->index); - QString off_string = tr("Channel") + QString::number(probe->index) + VOFF; + QString off_string = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel") + QString::number(probe->index) + VOFF; QLabel *off_label = new QLabel(off_string, this); _flayout->addRow(off_label, off_slider); _slider_list.push_back(off_slider); @@ -216,7 +217,7 @@ void Calibration::update_device_info() comp_slider->setRange(-127, 127); comp_slider->setValue(comb_comp); comp_slider->setObjectName(VCOMB+probe->index); - QString comp_string = tr("Channel") + QString::number(probe->index) + VCOMB; + QString comp_string = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel") + QString::number(probe->index) + VCOMB; QLabel *comp_label = new QLabel(comp_string, this); _flayout->addRow(comp_label, comp_slider); _slider_list.push_back(comp_slider); @@ -285,8 +286,10 @@ void Calibration::on_save() //while( QTime::currentTime() < dieTime ); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Save calibration results... It can take a while."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVE_CALIBRATION_RESULTS), + "Save calibration results... It can take a while."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"), + 0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -312,8 +315,9 @@ void Calibration::on_abort() //while( QTime::currentTime() < dieTime ); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Reload last calibration results... It can take a while."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RELOAD_CALIBRATION_RESULTS), + "Reload last calibration results... It can take a while."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -381,10 +385,10 @@ void Calibration::on_reset() { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Attention")); - msg.mBox()->setInformativeText(tr("All calibration settings will become the defualt values!")); - msg.mBox()->addButton(tr("Ok"), QMessageBox::AcceptRole); - msg.mBox()->addButton(tr("Cancel"), QMessageBox::RejectRole); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ATTENTION), "Attention")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SET_DEF_CAL_SETTING), "All calibration settings will become the defualt values!")); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CANCEL), "Cancel"), QMessageBox::RejectRole); msg.mBox()->setIcon(QMessageBox::Warning); if (msg.exec()) { _device_agent->set_config(NULL, NULL, SR_CONF_ZERO_DEFAULT, diff --git a/DSView/pv/dialogs/decoderoptionsdlg.cpp b/DSView/pv/dialogs/decoderoptionsdlg.cpp index 9f5571e4..4fed2d54 100644 --- a/DSView/pv/dialogs/decoderoptionsdlg.cpp +++ b/DSView/pv/dialogs/decoderoptionsdlg.cpp @@ -46,6 +46,8 @@ #include "../view/decodetrace.h" #include "../ui/msgbox.h" +#include "../ui/langresource.h" + namespace pv { namespace dialogs { @@ -81,7 +83,7 @@ void DecoderOptionsDlg::load_options(view::DecodeTrace *trace, bool isNew) form->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); dlg->layout()->addLayout(form); - dlg->setTitle(tr("Decoder Options")); + dlg->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DECODER_OPTIONS), "Decoder Options")); //scroll pannel QWidget *scroll_pannel = new QWidget(); @@ -103,7 +105,7 @@ void DecoderOptionsDlg::load_options(view::DecodeTrace *trace, bool isNew) load_decoder_forms(container_panel); if (_trace->decoder()->stack().size() > 0){ - // form->addRow(new QLabel(tr("* Required channels"), dlg)); + } //Add region combobox @@ -123,7 +125,9 @@ void DecoderOptionsDlg::load_options(view::DecodeTrace *trace, bool isNew) { int num = 1; for (auto c : view->get_cursorList()){ - QString curCursor = tr("Cursor ") + QString::number(num); + //tr + QString curCursor = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR), "Cursor") + + QString::number(num); _start_comboBox->addItem(curCursor, QVariant((quint64)c->get_key())); _end_comboBox->addItem(curCursor, QVariant((quint64)c->get_key())); @@ -146,10 +150,11 @@ void DecoderOptionsDlg::load_options(view::DecodeTrace *trace, bool isNew) update_decode_range(); // set default sample range + //tr form->addRow(_start_comboBox, new QLabel( - tr("The cursor for decode start time"))); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR_FOR_DECODE_START), "The cursor for decode start time"))); form->addRow(_end_comboBox, new QLabel( - tr("The cursor for decode end time"))); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR_FOR_DECODE_END), "The cursor for decode end time"))); //space QWidget *space = new QWidget(); @@ -348,7 +353,8 @@ void DecoderOptionsDlg::create_decoder_form( (struct srd_channel *)l->data; DsComboBox *const combo = create_probe_selector(parent, dec, pdch); - decoder_form->addRow(tr("%1 (%2) *") + //tr + decoder_form->addRow(QString("%1 (%2) *") .arg(QString::fromUtf8(pdch->name)) .arg(QString::fromUtf8(pdch->desc)), combo); @@ -364,7 +370,8 @@ void DecoderOptionsDlg::create_decoder_form( (struct srd_channel *)l->data; DsComboBox *const combo = create_probe_selector(parent, dec, pdch); - decoder_form->addRow(tr("%1 (%2)") + //tr + decoder_form->addRow(QString("%1 (%2)") .arg(QString::fromUtf8(pdch->name)) .arg(QString::fromUtf8(pdch->desc)), combo); @@ -430,7 +437,8 @@ void DecoderOptionsDlg::commit_decoder_probes(data::decode::Decoder *dec) void DecoderOptionsDlg::on_accept() { if (_cursor1 > 0 && _cursor1 == _cursor2){ - MsgBox::Show(tr("error"), tr("Invalid cursor index for sample range!")); + MsgBox::Show(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ERROR), "error"), + L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INVAILD_CURSOR), "Invalid cursor index for sample range!")); return; } diff --git a/DSView/pv/dialogs/deviceoptions.cpp b/DSView/pv/dialogs/deviceoptions.cpp index e02be556..8e39bef6 100644 --- a/DSView/pv/dialogs/deviceoptions.cpp +++ b/DSView/pv/dialogs/deviceoptions.cpp @@ -37,6 +37,7 @@ #include "../config/appconfig.h" #include "../appcontrol.h" #include "../sigsession.h" +#include "../ui/langresource.h" using namespace boost; using namespace std; @@ -94,7 +95,7 @@ DeviceOptions::DeviceOptions(QWidget *parent) : SigSession *session = AppControl::Instance()->GetSession(); _device_agent = session->get_device(); - this->setTitle(tr("Device Options")); + this->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DEVICE_OPTIONS), "Device Options")); this->SetTitleSpace(0); this->layout()->setSpacing(0); this->layout()->setDirection(QBoxLayout::TopToBottom); @@ -121,7 +122,7 @@ DeviceOptions::DeviceOptions(QWidget *parent) : //_container_panel->setStyleSheet("background-color:red"); // mode group box - QGroupBox *props_box = new QGroupBox(tr("Mode"), this); + QGroupBox *props_box = new QGroupBox(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MODE), "Mode"), this); QLayout *props_lay = get_property_form(props_box); props_box->setLayout(props_lay); _container_lay->addWidget(props_box); @@ -199,9 +200,9 @@ void DeviceOptions::accept() QDialog::accept(); } else { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Attention")); - msg.mBox()->setInformativeText(tr("All channel disabled! Please enable at least one channel.")); - msg.mBox()->addButton(tr("Ok"), QMessageBox::AcceptRole); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ATTENTION), "Attention")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ALL_CHANNEL_DISABLE), "All channel disabled! Please enable at least one channel.")); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); } @@ -226,7 +227,7 @@ QLayout * DeviceOptions::get_property_form(QWidget * parent) assert(p); const QString label = p->labeled_widget() ? QString() : p->label(); layout->addWidget(new QLabel(label, parent), i, 0); - if (label == tr("Operation Mode")) + if (label == L_S(STR_PAGE_DLG, S_ID(IDS_DLG_OPERATION_MODE), "Operation Mode")) layout->addWidget(p->get_widget(parent, true), i, 1); else layout->addWidget(p->get_widget(parent), i, 1); @@ -339,8 +340,8 @@ void DeviceOptions::logic_probes(QVBoxLayout &layout) _sub_lays.push_back(line_lay); line_lay->setSpacing(10); - QPushButton *enable_all_probes = new QPushButton(tr("Enable All")); - QPushButton *disable_all_probes = new QPushButton(tr("Disable All")); + QPushButton *enable_all_probes = new QPushButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE_ALL), "Enable All")); + QPushButton *disable_all_probes = new QPushButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DISABLE_ALL), "Disable All")); enable_all_probes->setMaximumHeight(30); disable_all_probes->setMaximumHeight(30); @@ -421,10 +422,11 @@ void DeviceOptions::zero_adj() QDialog::accept(); dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Information")); - msg.mBox()->setInformativeText(tr("Auto Calibration program will be started. Don't connect any probes. It can take a while!")); - msg.mBox()->addButton(tr("Ok"), QMessageBox::AcceptRole); - msg.mBox()->addButton(tr("Cancel"), QMessageBox::RejectRole); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INFORMATION), "Information")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_A_CAL_START), + "Auto Calibration program will be started. Don't connect any probes. It can take a while!")); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CANCEL), "Cancel") ,QMessageBox::RejectRole); msg.mBox()->setIcon(QMessageBox::Information); if (msg.exec()) { @@ -536,9 +538,11 @@ void DeviceOptions::channel_enable() g_variant_unref(gvar); if (cur_ch_num > vld_ch_num) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Information")); - msg.mBox()->setInformativeText(tr("Current mode only suppport max ") + QString::number(vld_ch_num) + tr(" channels!")); - msg.mBox()->addButton(tr("Ok"), QMessageBox::AcceptRole); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INFORMATION), "Information")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MAX_CHANNEL), "Current mode only suppport max ") + + QString::number(vld_ch_num) + + L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANNEL), " channels!")); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole); msg.mBox()->setIcon(QMessageBox::Information); msg.exec(); @@ -588,7 +592,7 @@ void DeviceOptions::analog_probes(QGridLayout &layout) probe_checkBox->setCheckState(probe->enabled ? Qt::Checked : Qt::Unchecked); _probes_checkBox_list.push_back(probe_checkBox); - QLabel *en_label = new QLabel(tr("Enable: "), this); + QLabel *en_label = new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE), "Enable: "), this); en_label->setProperty("Enable", true); probe_layout->addWidget(en_label, 0, 0, 1, 1); probe_layout->addWidget(probe_checkBox, 0, 1, 1, 3); @@ -650,7 +654,8 @@ QString DeviceOptions::dynamic_widget(QLayout *lay) QVBoxLayout *grid = dynamic_cast(lay); assert(grid); logic_probes(*grid); - return tr("Channels"); + //tr + return L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel"); } else if (mode == DSO) { GVariant* gvar = _device_agent->get_config(NULL, NULL, SR_CONF_HAVE_ZERO); @@ -662,18 +667,19 @@ QString DeviceOptions::dynamic_widget(QLayout *lay) assert(grid); if (have_zero) { - auto config_button = new QPushButton(tr("Auto Calibration"), this); + auto config_button = new QPushButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO_CALIBRATION), "Auto Calibration"), this); grid->addWidget(config_button, 0, 0, 1, 1); connect(config_button, SIGNAL(clicked()), this, SLOT(zero_adj())); - auto cali_button = new QPushButton(tr("Manual Calibration"), this); + auto cali_button = new QPushButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MANUAL_CALIBRATION), "Manual Calibration"), this); grid->addWidget(cali_button, 1, 0, 1, 1); connect(cali_button, SIGNAL(clicked()), this, SLOT(on_calibration())); _groupHeight2 = 100; _dynamic_panel->setFixedHeight(_groupHeight2); - return tr("Calibration"); + //tr + return L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CALIBRATION), "Calibration"); } } } @@ -681,7 +687,8 @@ QString DeviceOptions::dynamic_widget(QLayout *lay) QGridLayout *grid = dynamic_cast(lay); assert(grid); analog_probes(*grid); - return tr("Channels"); + //tr + return L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel"); } return NULL; } diff --git a/DSView/pv/dialogs/dsmessagebox.cpp b/DSView/pv/dialogs/dsmessagebox.cpp index 482e0ec3..07f54b02 100644 --- a/DSView/pv/dialogs/dsmessagebox.cpp +++ b/DSView/pv/dialogs/dsmessagebox.cpp @@ -30,6 +30,8 @@ #include #include "../dsvdef.h" +#include "../ui/langresource.h" + namespace pv { namespace dialogs { @@ -71,7 +73,7 @@ DSMessageBox::DSMessageBox(QWidget *parent,const QString title) : _titlebar->setTitle(title); } else{ - _titlebar->setTitle(tr("Message")); + _titlebar->setTitle(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MESSAGE), "Message")); } _main_layout->addWidget(_titlebar); diff --git a/DSView/pv/dialogs/dsomeasure.cpp b/DSView/pv/dialogs/dsomeasure.cpp index bf9f2a0a..245fe758 100644 --- a/DSView/pv/dialogs/dsomeasure.cpp +++ b/DSView/pv/dialogs/dsomeasure.cpp @@ -31,6 +31,8 @@ #include "../dsvdef.h" +#include "../ui/langresource.h" + using namespace std; using namespace pv::view; @@ -72,7 +74,7 @@ DsoMeasure::DsoMeasure(SigSession *session, View &parent, _layout.addWidget(&_button_box, Qt::AlignHCenter | Qt::AlignBottom); layout()->addLayout(&_layout); - setTitle(tr("Measurements")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MEASUREMENTS), "Measurements")); connect(_button_box.button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject())); connect(_button_box.button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(reset())); @@ -140,8 +142,9 @@ QString DsoMeasure::get_ms_text(int ms_type) { assert(ms_type >= DSO_MS_BEGIN); assert(ms_type < DSO_MS_END); + //tr const QString label_name[DSO_MS_END-DSO_MS_BEGIN] = {tr("NULL"), - tr("Freq"), tr("Period"), tr("+Duty"), tr("-Duty"), tr("+Count"), + tr("Freq"), tr("Period"), tr("Duty"), tr("-Duty"), tr("+Count"), tr("Rise"), tr("Fall"), tr("+Width"), tr("-Width"), tr("BrstW"), tr("Ampl"), tr("High"), tr("Low"), tr("RMS"), tr("Mean"), tr("PK-PK"), tr("Max"), tr("Min"), tr("+Over"), tr("-Over")}; diff --git a/DSView/pv/dialogs/fftoptions.cpp b/DSView/pv/dialogs/fftoptions.cpp index d1db5c47..fd6b7ea0 100644 --- a/DSView/pv/dialogs/fftoptions.cpp +++ b/DSView/pv/dialogs/fftoptions.cpp @@ -30,6 +30,8 @@ #include "../dsvdef.h" #include "../log.h" +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -188,23 +190,24 @@ FftOptions::FftOptions(QWidget *parent, SigSession *session) : QPixmap pixmap(hint_pic); _hint_label->setPixmap(pixmap); + //* _glayout = new QGridLayout(); //QGridLayout _glayout->setVerticalSpacing(5); - _glayout->addWidget(new QLabel(tr("FFT Enable: "), this), 0, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FFT_ENABLE), "FFT Enable: "), this), 0, 0); _glayout->addWidget(_en_checkbox, 0, 1); - _glayout->addWidget(new QLabel(tr("FFT Length: "), this), 1, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FFT_LENGTH), "FFT Length: "), this), 1, 0); _glayout->addWidget(_len_combobox, 1, 1); - _glayout->addWidget(new QLabel(tr("Sample Interval: "), this), 2, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAMPLE_INTERVAL), "Sample Interval: "), this), 2, 0); _glayout->addWidget(_interval_combobox, 2, 1); - _glayout->addWidget(new QLabel(tr("FFT Source: "), this), 3, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FFT_SOURCE), "FFT Source: "), this), 3, 0); _glayout->addWidget(_ch_combobox, 3, 1); - _glayout->addWidget(new QLabel(tr("FFT Window: "), this), 4, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FFT_WINDOW), "FFT Window: "), this), 4, 0); _glayout->addWidget(_window_combobox, 4, 1); - _glayout->addWidget(new QLabel(tr("DC Ignored: "), this), 5, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DC_IGNORED), "DC Ignored: "), this), 5, 0); _glayout->addWidget(_dc_checkbox, 5, 1); - _glayout->addWidget(new QLabel(tr("Y-axis Mode: "), this), 6, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_Y-AXIS_MODE), "Y-axis Mode: "), this), 6, 0); _glayout->addWidget(_view_combobox, 6, 1); - _glayout->addWidget(new QLabel(tr("DBV Range: "), this), 7, 0); + _glayout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DBV_RANGE), "DBV Range: "), this), 7, 0); _glayout->addWidget(_dbv_combobox, 7, 1); _glayout->addWidget(_hint_label, 0, 2, 8, 1); @@ -214,7 +217,7 @@ FftOptions::FftOptions(QWidget *parent, SigSession *session) : _layout->addWidget(&_button_box); layout()->addLayout(_layout); - setTitle(tr("FFT Options")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FFT_OPTIONS), "FFT Options")); connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); diff --git a/DSView/pv/dialogs/interval.cpp b/DSView/pv/dialogs/interval.cpp index cb45e5da..f9bdec2d 100644 --- a/DSView/pv/dialogs/interval.cpp +++ b/DSView/pv/dialogs/interval.cpp @@ -23,6 +23,8 @@ #include +#include "../ui/langresource.h" + namespace pv { namespace dialogs { @@ -38,7 +40,7 @@ Interval::Interval(QWidget *parent) : _bDone = false; setMinimumWidth(300); - _interval_label = new QLabel(tr("Interval(s): "), this); + _interval_label = new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_INTERVAL_S), "Interval(s): "), this); _interval_spinBox = new QDoubleSpinBox(this); _interval_spinBox->setRange(0.1, 10); _interval_spinBox->setDecimals(1); @@ -53,7 +55,7 @@ Interval::Interval(QWidget *parent) : glayout->addWidget(&_button_box, 2, 2); layout()->addLayout(glayout); - setTitle(tr("Repetitive Interval")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_REPETITIVE_INTERVAL), "Repetitive Interval")); connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(_interval_slider, SIGNAL(valueChanged(int)), this, SLOT(on_slider_changed(int))); diff --git a/DSView/pv/dialogs/lissajousoptions.cpp b/DSView/pv/dialogs/lissajousoptions.cpp index aebe2a01..eade991a 100644 --- a/DSView/pv/dialogs/lissajousoptions.cpp +++ b/DSView/pv/dialogs/lissajousoptions.cpp @@ -31,6 +31,8 @@ #include #include +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -150,10 +152,10 @@ void LissajousOptions::changeEvent(QEvent *event) void LissajousOptions::retranslateUi() { - _enable->setText(tr("Enable")); - _x_group->setTitle(tr("X-axis")); - _y_group->setTitle(tr("Y-axis")); - setTitle(tr("Lissajous Options")); + _enable->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE), "Enable")); + _x_group->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_X_AXIS), "X-axis")); + _y_group->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_Y_AXIS), "Y-axis")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_LISSAJOUS_OPTIONS), "Lissajous Options")); } void LissajousOptions::accept() diff --git a/DSView/pv/dialogs/mathoptions.cpp b/DSView/pv/dialogs/mathoptions.cpp index e2d93602..2afdac5f 100644 --- a/DSView/pv/dialogs/mathoptions.cpp +++ b/DSView/pv/dialogs/mathoptions.cpp @@ -30,6 +30,8 @@ #include #include #include + +#include "../ui/langresource.h" using namespace boost; @@ -54,16 +56,16 @@ MathOptions::MathOptions(SigSession *session, QWidget *parent) : _math_group = new QGroupBox(this); QHBoxLayout *type_layout = new QHBoxLayout(); - QRadioButton *add_radio = new QRadioButton(tr("Add"), _math_group); + QRadioButton *add_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD), "Add"), _math_group); add_radio->setProperty("type", data::MathStack::MATH_ADD); type_layout->addWidget(add_radio); - QRadioButton *sub_radio = new QRadioButton(tr("Substract"), _math_group); + QRadioButton *sub_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SUBSTRACT), "Substract"), _math_group); sub_radio->setProperty("type", data::MathStack::MATH_SUB); type_layout->addWidget(sub_radio); - QRadioButton *mul_radio = new QRadioButton(tr("Multiply"), _math_group); + QRadioButton *mul_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MULTIPLY), "Multiply"), _math_group); mul_radio->setProperty("type", data::MathStack::MATH_MUL); type_layout->addWidget(mul_radio); - QRadioButton *div_radio = new QRadioButton(tr("Divide"), _math_group); + QRadioButton *div_radio = new QRadioButton(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DIVIDE), "Divide"), _math_group); div_radio->setProperty("type", data::MathStack::MATH_DIV); type_layout->addWidget(div_radio); _math_radio.append(add_radio); @@ -165,11 +167,11 @@ void MathOptions::changeEvent(QEvent *event) void MathOptions::retranslateUi() { - _enable->setText(tr("Enable")); - _math_group->setTitle(tr("Math Type")); - _src1_group->setTitle(tr("1st Source")); - _src2_group->setTitle(tr("2nd Source")); - setTitle(tr("Math Options")); + _enable->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE), "Enable")); + _math_group->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MATH_TYPE), "Math Type")); + _src1_group->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_1ST_SOURCE), "1st Source")); + _src2_group->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_2ST_SOURCE), "2st Source")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MATH_OPTIONS), "Math Options")); } void MathOptions::accept() diff --git a/DSView/pv/dialogs/protocolexp.cpp b/DSView/pv/dialogs/protocolexp.cpp index 30c712b4..596d380c 100644 --- a/DSView/pv/dialogs/protocolexp.cpp +++ b/DSView/pv/dialogs/protocolexp.cpp @@ -41,6 +41,8 @@ #include "../utility/encoding.h" #include "../utility/path.h" +#include "../ui/langresource.h" + using namespace pv::data::decode; namespace pv { @@ -54,15 +56,16 @@ ProtocolExp::ProtocolExp(QWidget *parent, SigSession *session) : _export_cancel(false) { _format_combobox = new DsComboBox(this); - _format_combobox->addItem(tr("Comma-Separated Values (*.csv)")); - _format_combobox->addItem(tr("Text files (*.txt)")); + //tr + _format_combobox->addItem("Comma-Separated Values (*.csv)"); + _format_combobox->addItem("Text files (*.txt)"); _flayout = new QFormLayout(); _flayout->setVerticalSpacing(5); _flayout->setFormAlignment(Qt::AlignLeft); _flayout->setLabelAlignment(Qt::AlignLeft); _flayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - _flayout->addRow(new QLabel(tr("Export Format: "), this), _format_combobox); + _flayout->addRow(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EXPORT_FORMAT), "Export Format: "), this), _format_combobox); pv::data::DecoderModel* decoder_model = _session->get_decoder_model(); @@ -93,7 +96,7 @@ ProtocolExp::ProtocolExp(QWidget *parent, SigSession *session) : _layout->addWidget(&_button_box); layout()->addLayout(_layout); - setTitle(tr("Protocol Export")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_EXPORT), "Protocol Export")); connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(&_button_box, SIGNAL(rejected()), this, SLOT(reject())); @@ -130,7 +133,7 @@ void ProtocolExp::accept() QString file_name = QFileDialog::getSaveFileName( this, - tr("Export Data"), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EXPORT_DATA), "Export Data"), default_name, filter, &default_filter); @@ -142,7 +145,8 @@ void ProtocolExp::accept() QStringList list = default_filter.split('.').last().split(')'); QString ext = list.first(); if (f.suffix().compare(ext)) - file_name += tr(".") + ext; + //tr + file_name += "." + ext; QString fname = path::GetDirectoryName(file_name); if (fname != app._userHistory.openDir) @@ -158,8 +162,9 @@ void ProtocolExp::accept() }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Export Protocol List Result... It can take a while."), - tr("Cancel"), 0, 100, this, flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EXPORT_PROTOCOL_LIST_RESULT), + "Export Protocol List Result... It can take a while."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"), 0, 100, this, flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); diff --git a/DSView/pv/dialogs/protocollist.cpp b/DSView/pv/dialogs/protocollist.cpp index 63803b51..2883f0f6 100644 --- a/DSView/pv/dialogs/protocollist.cpp +++ b/DSView/pv/dialogs/protocollist.cpp @@ -31,6 +31,8 @@ #include "../view/decodetrace.h" #include "../data/decodermodel.h" +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -46,8 +48,8 @@ ProtocolList::ProtocolList(QWidget *parent, SigSession *session) : pv::data::DecoderModel* decoder_model = _session->get_decoder_model(); _map_zoom_combobox = new DsComboBox(this); - _map_zoom_combobox->addItem(tr("Fit to Window")); - _map_zoom_combobox->addItem(tr("Fixed")); + _map_zoom_combobox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FIT_TO_WINDOW), "Fit to Window")); + _map_zoom_combobox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FIXED), "Fixed")); int cur_map_zoom = _session->get_map_zoom(); if (cur_map_zoom >= _map_zoom_combobox->count()) @@ -76,8 +78,8 @@ ProtocolList::ProtocolList(QWidget *parent, SigSession *session) : _flayout->setFormAlignment(Qt::AlignLeft); _flayout->setLabelAlignment(Qt::AlignLeft); _flayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); - _flayout->addRow(new QLabel(tr("Map Zoom: "), this), _map_zoom_combobox); - _flayout->addRow(new QLabel(tr("Decoded Protocols: "), this), _protocol_combobox); + _flayout->addRow(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MAP_ZOOM), "Map Zoom: "), this), _map_zoom_combobox); + _flayout->addRow(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DECODED_PROTOCOLS), "Decoded Protocols: "), this), _protocol_combobox); _layout = new QVBoxLayout(); _layout->addLayout(_flayout); @@ -85,7 +87,7 @@ ProtocolList::ProtocolList(QWidget *parent, SigSession *session) : setMinimumWidth(300); layout()->addLayout(_layout); - setTitle(tr("Protocol List Viewer")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_LIST_VIEWER), "Protocol List Viewer")); connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(_protocol_combobox, SIGNAL(currentIndexChanged(int)), this, SLOT(set_protocol(int))); diff --git a/DSView/pv/dialogs/regionoptions.cpp b/DSView/pv/dialogs/regionoptions.cpp index 3b4dd983..92ad3fe7 100644 --- a/DSView/pv/dialogs/regionoptions.cpp +++ b/DSView/pv/dialogs/regionoptions.cpp @@ -25,6 +25,8 @@ #include "../view/cursor.h" #include "../view/view.h" +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -52,7 +54,7 @@ RegionOptions::RegionOptions(view::View *view, SigSession *session, QWidget *par int index = 1; for(std::list::iterator i = _view->get_cursorList().begin(); i != _view->get_cursorList().end(); i++) { - QString curCursor = tr("Cursor ")+QString::number(index); + QString curCursor = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR), "Cursor")+QString::number(index); _start_comboBox->addItem(curCursor); _end_comboBox->addItem(curCursor); index++; @@ -69,7 +71,7 @@ RegionOptions::RegionOptions(view::View *view, SigSession *session, QWidget *par vlayout->addWidget(&_button_box); layout()->addLayout(vlayout); - setTitle(tr("Region")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_REGION), "Region")); connect(&_button_box, SIGNAL(accepted()), this, SLOT(set_region())); connect(_session->device_event_object(), SIGNAL(device_updated()), this, SLOT(reject())); diff --git a/DSView/pv/dialogs/search.cpp b/DSView/pv/dialogs/search.cpp index 6a2ee47a..b1d670ab 100644 --- a/DSView/pv/dialogs/search.cpp +++ b/DSView/pv/dialogs/search.cpp @@ -24,6 +24,8 @@ #include #include + +#include "../ui/langresource.h" namespace pv { @@ -76,12 +78,14 @@ Search::Search(QWidget *parent, SigSession *session, std::map } search_layout->addWidget(new QLabel(" "), index,0); - search_layout->addWidget(new QLabel(tr("X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")), 0, 3, index, 1); + //tr + search_layout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_LABEL), + "X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")), 0, 3, index, 1); search_layout->addWidget(&search_buttonBox, index+1, 3); search_layout->setColumnStretch(3, 100); layout()->addLayout(search_layout); - setTitle(tr("Search Options")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_OPTIONS), "Search Options")); connect(&search_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(&search_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); diff --git a/DSView/pv/dialogs/storeprogress.cpp b/DSView/pv/dialogs/storeprogress.cpp index 7cec1cbc..b16cb050 100644 --- a/DSView/pv/dialogs/storeprogress.cpp +++ b/DSView/pv/dialogs/storeprogress.cpp @@ -33,6 +33,8 @@ #include "../interface/icallbacks.h" #include "../log.h" +#include "../ui/langresource.h" + namespace pv { namespace dialogs { @@ -68,7 +70,7 @@ StoreProgress::StoreProgress(SigSession *session, QWidget *parent) : _fileLab->setMaximumHeight(50); _openButton = new QPushButton(this); - _openButton->setText(tr("change")); + _openButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANGE), "change")); _space = new QWidget(this); _space->setMinimumHeight(80); @@ -133,7 +135,7 @@ void StoreProgress::reject() void StoreProgress::accept() { if (_store_session.GetFileName() == ""){ - MsgBox::Show(NULL, tr("You need to select a file name.")); + MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEL_FILENAME), "You need to select a file name.")); return; } @@ -200,7 +202,7 @@ void StoreProgress::timeout() void StoreProgress::save_run(ISessionDataGetter *getter) { _isExport = false; - setTitle(tr("Saving...")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVING), "Saving...")); QString file = _store_session.MakeSaveFile(false); _fileLab->setText(file); _store_session._sessionDataGetter = getter; @@ -216,11 +218,11 @@ void StoreProgress::export_run() bool isOrg = AppConfig::Instance()._appOptions.originalData; _ckOrigin = new QRadioButton(); - _ckOrigin->setText(tr("Original data")); + _ckOrigin->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ORIGINAL_DATA), "Original data")); _ckOrigin->setChecked(isOrg); _ckCompress = new QRadioButton(); - _ckCompress->setText(tr("Compressed data")); + _ckCompress->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_COMPRESSED_DATA), "Compressed data")); _ckCompress->setChecked(!isOrg); lay->addWidget(_ckOrigin); @@ -232,7 +234,7 @@ void StoreProgress::export_run() } _isExport = true; - setTitle(tr("Exporting...")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EXPORTING), "Exporting...")); QString file = _store_session.MakeExportFile(false); _fileLab->setText(file); diff --git a/DSView/pv/dialogs/waitingdialog.cpp b/DSView/pv/dialogs/waitingdialog.cpp index 9cfda143..067aa039 100644 --- a/DSView/pv/dialogs/waitingdialog.cpp +++ b/DSView/pv/dialogs/waitingdialog.cpp @@ -33,6 +33,8 @@ #include "../view/dsosignal.h" #include "../config/appconfig.h" +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -59,7 +61,7 @@ WaitingDialog::WaitingDialog(QWidget *parent, SigSession *session, int key) : font.setBold(true); QLabel *warning_tips = new QLabel(this); - warning_tips->setText(tr("Don't connect any probes!")); + warning_tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DONT_CONNECT_PROBES), "Don't connect any probes!")); warning_tips->setFont(font); warning_tips->setAlignment(Qt::AlignCenter); @@ -70,7 +72,7 @@ WaitingDialog::WaitingDialog(QWidget *parent, SigSession *session, int key) : label->setAlignment(Qt::AlignCenter); tips = new QLabel(this); - tips->setText(tr("Waiting")); + tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING), "Waiting")); tips->setFont(font); tips->setAlignment(Qt::AlignCenter); @@ -88,7 +90,7 @@ WaitingDialog::WaitingDialog(QWidget *parent, SigSession *session, int key) : mlayout->addWidget(&_button_box); layout()->addLayout(mlayout); - setTitle(tr("Auto Calibration")); + setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO_CALIBRATION), "Auto Calibration")); } void WaitingDialog::accept() @@ -104,8 +106,8 @@ void WaitingDialog::accept() g_variant_new_boolean(true)); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Save calibration Result... It can take a while."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVE_CALIBRATION_RESULTS), "Save calibration results... It can take a while."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -133,8 +135,8 @@ void WaitingDialog::reject() g_variant_new_boolean(true)); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Load current setting... It can take a while."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_LOAD_CURRENT_SETTING), "Load current setting... It can take a while."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -168,7 +170,7 @@ void WaitingDialog::changeText() index++; if(index == WPOINTS_NUM + 1) { - tips->setText(tr("Waiting")); + tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING), "Waiting")); index = 0; GVariant* gvar; bool comb_comp_en = false; @@ -207,7 +209,7 @@ void WaitingDialog::changeText() movie->jumpToFrame(0); timer->stop(); tips->setAlignment(Qt::AlignHCenter); - tips->setText(tr("Finished!")); + tips->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FINISHED), "Finished!")); _button_box.addButton(QDialogButtonBox::Save); } } diff --git a/DSView/pv/dock/dsotriggerdock.cpp b/DSView/pv/dock/dsotriggerdock.cpp index 828c8d9f..4f8506a5 100644 --- a/DSView/pv/dock/dsotriggerdock.cpp +++ b/DSView/pv/dock/dsotriggerdock.cpp @@ -36,6 +36,8 @@ #include #include +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -61,9 +63,10 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession *session) : _holdoff_label = new QLabel(_widget); _holdoff_comboBox = new DsComboBox(_widget); - _holdoff_comboBox->addItem(tr("uS"), QVariant::fromValue(1000)); - _holdoff_comboBox->addItem(tr("mS"), QVariant::fromValue(1000000)); - _holdoff_comboBox->addItem(tr("S"), QVariant::fromValue(1000000000)); + //tr + _holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_US), "uS"), QVariant::fromValue(1000)); + _holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MS), "mS"), QVariant::fromValue(1000000)); + _holdoff_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_S), "S"), QVariant::fromValue(1000000000)); _holdoff_comboBox->setCurrentIndex(0); _holdoff_spinBox = new QSpinBox(_widget); _holdoff_spinBox->setRange(0, 999); @@ -126,7 +129,8 @@ DsoTriggerDock::DsoTriggerDock(QWidget *parent, SigSession *session) : gLayout->setVerticalSpacing(5); gLayout->addWidget(_position_label, 0, 0); gLayout->addWidget(_position_spinBox, 0, 1); - gLayout->addWidget(new QLabel(tr("%"), _widget), 0, 2); + //tr + gLayout->addWidget(new QLabel("%", _widget), 0, 2); gLayout->addWidget(_position_slider, 1, 0, 1, 4); gLayout->addWidget(new QLabel(_widget), 2, 0); @@ -181,19 +185,19 @@ void DsoTriggerDock::changeEvent(QEvent *event) void DsoTriggerDock::retranslateUi() { - _position_label->setText(tr("Trigger Position: ")); - _holdoff_label->setText(tr("Hold Off Time: ")); - _margin_label->setText(tr("Noise Sensitivity: ")); - _tSource_label->setText(tr("Trigger Sources: ")); - _tType_label->setText(tr("Trigger Types: ")); - _rising_radioButton->setText(tr("Rising Edge")); - _falling_radioButton->setText(tr("Falling Edge")); + _position_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_POSITION), "Trigger Position: ")); + _holdoff_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_HOLD_OFF_TIME), "Hold Off Time: ")); + _margin_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_NOISE_SENSITIVITY), "Noise Sensitivity: ")); + _tSource_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_SOURCES), "Trigger Sources: ")); + _tType_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_TYPES), "Trigger Types: ")); + _rising_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RISING_EDGE), "Rising Edge")); + _falling_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FALLING_EDGE), "Falling Edge")); - _auto_radioButton->setText(tr("Auto")); - _ch0_radioButton->setText(tr("Channel 0")); - _ch1_radioButton->setText(tr("Channel 1")); - _ch0a1_radioButton->setText(tr("Channel 0 && 1")); - _ch0o1_radioButton->setText(tr("Channel 0 | 1")); + _auto_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO), "Auto")); + _ch0_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL_0), "Channel 0")); + _ch1_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL_1), "Channel 1")); + _ch0a1_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL_0_AND_1), "Channel 0 && 1")); + _ch0o1_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL_0_OR_1), "Channel 0 | 1")); } void DsoTriggerDock::reStyle() @@ -225,8 +229,9 @@ void DsoTriggerDock::pos_changed(int pos) g_variant_new_byte((uint8_t)pos)); if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change horiz trigger position failed!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_HOR_TRI_POS_FAIL), + "Change horiz trigger position failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -251,8 +256,9 @@ void DsoTriggerDock::hold_changed(int hold) if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change trigger hold off time failed!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TRI_HOLDOFF_TIME_FAIL), + "Change trigger hold off time failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -267,8 +273,9 @@ void DsoTriggerDock::margin_changed(int margin) g_variant_new_byte(margin)); if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change trigger value sensitivity failed!")); + msg.mBox()->setText((L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue"))); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SENSITIVITY_FAIL), + "Change trigger value sensitivity failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -285,8 +292,9 @@ void DsoTriggerDock::source_changed() g_variant_new_byte(id)); if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change trigger source failed!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_SOURCE_FAIL), + "Change trigger source failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -303,8 +311,9 @@ void DsoTriggerDock::channel_changed(int ch) g_variant_new_byte(_channel_comboBox->currentData().toInt())); if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change trigger channel failed!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_CHANNEL_FAIL), + "Change trigger channel failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -321,8 +330,9 @@ void DsoTriggerDock::type_changed() g_variant_new_byte(id)); if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger Setting Issue")); - msg.mBox()->setInformativeText(tr("Change trigger type failed!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRI_SET_ISSUE), "Trigger Setting Issue")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CHANGE_TYPE_FAIL), + "Change trigger type failed!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); diff --git a/DSView/pv/dock/keywordlineedit.cpp b/DSView/pv/dock/keywordlineedit.cpp index 58a92ce7..1028c455 100644 --- a/DSView/pv/dock/keywordlineedit.cpp +++ b/DSView/pv/dock/keywordlineedit.cpp @@ -22,6 +22,8 @@ #include "keywordlineedit.h" #include "../config/appconfig.h" +#include "../ui/langresource.h" + KeywordLineEdit::KeywordLineEdit(QWidget *parent, IKeywordActive *active) :QLineEdit(parent) { @@ -44,11 +46,12 @@ KeywordLineEdit::KeywordLineEdit(QWidget *parent, IKeywordActive *active) return; } - this->setText(tr("Protocol search...")); + //tr + this->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_KEYWORD_LINEEID), "Protocol search...")); } void KeywordLineEdit::SetInputText(QString text) { _bText = true; this->setText(text); - } \ No newline at end of file + } diff --git a/DSView/pv/dock/measuredock.cpp b/DSView/pv/dock/measuredock.cpp index b71ea020..d2eb03a1 100644 --- a/DSView/pv/dock/measuredock.cpp +++ b/DSView/pv/dock/measuredock.cpp @@ -39,6 +39,8 @@ #include #include "../config/appconfig.h" +#include "../ui/langresource.h" + using namespace boost; namespace pv { @@ -92,7 +94,7 @@ MeasureDock::MeasureDock(QWidget *parent, View &view, SigSession *session) : _dist_layout->setVerticalSpacing(5); _dist_layout->addWidget(_dist_add_btn, 0, 0); _dist_layout->addWidget(new QLabel(_widget), 0, 1, 1, 3); - _dist_layout->addWidget(new QLabel(tr("Time/Samples"), _widget), 0, 4); + _dist_layout->addWidget(new QLabel(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TIME_SAMPLES), "Time/Samples"), _widget), 0, 4); _dist_layout->addWidget(new QLabel(_widget), 0, 5, 1, 2); _dist_layout->setColumnStretch(1, 50); _dist_layout->setColumnStretch(6, 100); @@ -160,20 +162,20 @@ void MeasureDock::changeEvent(QEvent *event) void MeasureDock::retranslateUi() { - _mouse_groupBox->setTitle(tr("Mouse measurement")); - _fen_checkBox->setText(tr("Enable floating measurement")); - _dist_groupBox->setTitle(tr("Cursor Distance")); - _edge_groupBox->setTitle(tr("Edges")); - _cursor_groupBox->setTitle(tr("Cursors")); + _mouse_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MOUSE_MEASUREMENT), "Mouse measurement")); + _fen_checkBox->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ENABLE_FLOATING_MEASUREMENT), "Enable floating measurement")); + _dist_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR_DISTANCE), "Cursor Distance")); + _edge_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_EDGES), "Edges")); + _cursor_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSORS), "Cursors")); - _channel_label->setText(tr("Channel")); - _edge_label->setText(tr("Rising/Falling/Edges")); - _time_label->setText(tr("Time/Samples")); + _channel_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHANNEL), "Channel")); + _edge_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RIS_OR_FAL_EDGE), "Rising/Falling/Edges")); + _time_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TIME_SAMPLES), "Time/Samples")); - _w_label->setText(tr("W: ")); - _p_label->setText(tr("P: ")); - _f_label->setText(tr("F: ")); - _d_label->setText(tr("D: ")); + _w_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_W), "W: ")); + _p_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_P), "P: ")); + _f_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_F), "F: ")); + _d_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_D), "D: ")); } void MeasureDock::reStyle() @@ -336,12 +338,15 @@ void MeasureDock::add_dist_measure() QToolButton *del_btn = new QToolButton(row_widget); del_btn->setIcon(QIcon(iconPath+"/del.svg")); del_btn->setCheckable(true); - QPushButton *s_btn = new QPushButton(tr(" "), row_widget); + //tr + QPushButton *s_btn = new QPushButton(" ", row_widget); s_btn->setObjectName("dist"); - QPushButton *e_btn = new QPushButton(tr(" "), row_widget); + //tr + QPushButton *e_btn = new QPushButton(" ", row_widget); e_btn->setObjectName("dist"); QLabel *r_label = new QLabel(row_widget); - QLabel *g_label = new QLabel(tr("-"), row_widget); + //tr + QLabel *g_label = new QLabel("-", row_widget); g_label->setContentsMargins(0,0,0,0); _dist_del_btn_vec.push_back(del_btn); _dist_s_btn_vec.push_back(s_btn); @@ -402,14 +407,18 @@ void MeasureDock::add_edge_measure() QToolButton *del_btn = new QToolButton(row_widget); del_btn->setIcon(QIcon(iconPath+"/del.svg")); del_btn->setCheckable(true); - QPushButton *s_btn = new QPushButton(tr(" "), row_widget); + //tr + QPushButton *s_btn = new QPushButton(" ", row_widget); s_btn->setObjectName("edge"); - QPushButton *e_btn = new QPushButton(tr(" "), row_widget); + //tr + QPushButton *e_btn = new QPushButton(" ", row_widget); e_btn->setObjectName("edge"); QLabel *r_label = new QLabel(row_widget); - QLabel *g_label = new QLabel(tr("-"), row_widget); + //tr + QLabel *g_label = new QLabel("-", row_widget); g_label->setContentsMargins(0,0,0,0); - QLabel *a_label = new QLabel(tr("@"), row_widget); + //tr + QLabel *a_label = new QLabel("@", row_widget); a_label->setContentsMargins(0,0,0,0); DsComboBox *ch_cmb = create_probe_selector(row_widget); _edge_del_btn_vec.push_back(del_btn); @@ -463,9 +472,10 @@ void MeasureDock::show_all_coursor() { if (_view.get_cursorList().empty()) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Information")); - msg.mBox()->setInformativeText(tr("Please insert cursor before using cursor measure.")); - msg.mBox()->addButton(tr("Ok"), QMessageBox::AcceptRole); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_INFORMATION), "Information")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PLEASE_INSERT_CURSOR), + "Please insert cursor before using cursor measure.")); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OK), "Ok"), QMessageBox::AcceptRole); msg.mBox()->setIcon(QMessageBox::Information); msg.exec(); diff --git a/DSView/pv/dock/protocoldock.cpp b/DSView/pv/dock/protocoldock.cpp index aba1588a..a3ad7ada 100644 --- a/DSView/pv/dock/protocoldock.cpp +++ b/DSView/pv/dock/protocoldock.cpp @@ -53,6 +53,8 @@ #include "../data/decode/decoder.h" #include "../log.h" +#include "../ui/langresource.h" + using namespace std; namespace pv { @@ -99,9 +101,9 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio sort(_decoderInfoList.begin(), _decoderInfoList.end(), ProtocolDock::protocol_sort_callback); if (repeatNammes != ""){ - QString err = tr("Any protocol have repeated id or name: "); + QString err = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PROTOCOL_REPEAT), "Any protocol have repeated id or name:"); err += repeatNammes; - MsgBox::Show(tr("error"), err.toUtf8().data()); + MsgBox::Show(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ERROR), "error"), err.toUtf8().data()); } //-----------------------------top panel @@ -235,9 +237,9 @@ ProtocolDock::~ProtocolDock() void ProtocolDock::retranslateUi() { - _ann_search_edit->setPlaceholderText(tr("search")); - _matchs_title_label->setText(tr("Matching Items:")); - _bot_title_label->setText(tr("Protocol List Viewer")); + _ann_search_edit->setPlaceholderText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH), "search")); + _matchs_title_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MATCHING_ITEMS), "Matching Items:")); + _bot_title_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_LIST_VIEWER), "Protocol List Viewer")); _pro_keyword_edit->ResetText(); } @@ -297,11 +299,11 @@ int ProtocolDock::get_protocol_index_by_id(QString id) void ProtocolDock::on_add_protocol() { if (_decoderInfoList.size() == 0){ - MsgBox::Show(NULL, tr("Protocol list is empty!")); + MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_PROTOCOL), "Protocol list is empty!")); return; } if (_selected_protocol_id == ""){ - MsgBox::Show(NULL, tr("Please select a protocol!")); + MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SEL_PROTOCOL), "Please select a protocol!")); return; } @@ -345,7 +347,8 @@ void ProtocolDock::on_add_protocol() } if (pro_id == ""){ - MsgBox::Show(tr("error"), tr("find the base protocol error!")); + MsgBox::Show(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_ERROR), "error"), + L_S(STR_PAGE_MSG, S_ID(IDS_MSG_FIND_BASE_PROTOCOL_ERROR), "find the base protocol error!")); for(auto sub: sub_decoders){ delete sub; @@ -414,11 +417,11 @@ bool ProtocolDock::add_protocol_by_id(QString id, bool silent, std::listget_progress(); if (d->decoder()->out_of_memory()) - err = tr("(Out of Memory)"); + err = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_OUT_OF_MEMORY), "Out of Memory"); if (index < _protocol_lay_items.size()) { @@ -809,8 +812,8 @@ void ProtocolDock::search_update() search_done(); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Searching..."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCHING), "Searching..."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -841,7 +844,7 @@ void ProtocolDock::OnProtocolSetting(void *handle){ } void ProtocolDock::OnProtocolDelete(void *handle){ - if (!MsgBox::Confirm(tr("Are you sure to remove this protocol analyzer?"), this)){ + if (!MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PROTOCOL_COMFRIEM_DEL), "Are you sure to remove this protocol analyzer?"), this)){ return; } diff --git a/DSView/pv/dock/searchdock.cpp b/DSView/pv/dock/searchdock.cpp index 738c9f03..fcc90a15 100644 --- a/DSView/pv/dock/searchdock.cpp +++ b/DSView/pv/dock/searchdock.cpp @@ -40,6 +40,8 @@ #include #include "../config/appconfig.h" +#include "../ui/langresource.h" + namespace pv { namespace dock { @@ -99,7 +101,7 @@ void SearchDock::changeEvent(QEvent *event) void SearchDock::retranslateUi() { - _search_value->setPlaceholderText(tr("search")); + _search_value->setPlaceholderText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH), "search")); } void SearchDock::reStyle() @@ -130,8 +132,8 @@ void SearchDock::on_previous() if (!logic_snapshot || logic_snapshot->empty()) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("No Sample data!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -143,8 +145,8 @@ void SearchDock::on_previous() last_hit = _view.get_search_hit(); if (last_pos == 0) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("Search cursor at the start position!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_START), "Search cursor at the start position!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -156,8 +158,8 @@ void SearchDock::on_previous() ret = logic_snapshot->pattern_search(0, end, last_pos, _pattern, false); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Search Previous..."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_PREVIOUS), "Search Previous..."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -170,8 +172,8 @@ void SearchDock::on_previous() if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("Pattern not found!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -192,8 +194,8 @@ void SearchDock::on_next() if (!logic_snapshot || logic_snapshot->empty()) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("No Sample data!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NO_SAMPLE_DATA), "No Sample data!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -204,8 +206,8 @@ void SearchDock::on_next() last_pos = _view.get_search_pos() + _view.get_search_hit(); if (last_pos >= end) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("Search cursor at the end position!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH_AT_END), "Search cursor at the end position!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -216,8 +218,8 @@ void SearchDock::on_next() ret = logic_snapshot->pattern_search(0, end, last_pos, _pattern, true); }); Qt::WindowFlags flags = Qt::CustomizeWindowHint; - QProgressDialog dlg(tr("Search Next..."), - tr("Cancel"),0,0,this,flags); + QProgressDialog dlg(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_NEXT), "Search Next..."), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CANCEL), "Cancel"),0,0,this,flags); dlg.setWindowModality(Qt::WindowModal); dlg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint); @@ -230,8 +232,8 @@ void SearchDock::on_next() if (!ret) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Search")); - msg.mBox()->setInformativeText(tr("Pattern not found!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEARCH), "Search")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PATTERN_NOT_FOUND), "Pattern not found!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); diff --git a/DSView/pv/dock/triggerdock.cpp b/DSView/pv/dock/triggerdock.cpp index b6b9a345..fc5e1e10 100644 --- a/DSView/pv/dock/triggerdock.cpp +++ b/DSView/pv/dock/triggerdock.cpp @@ -37,6 +37,7 @@ #include "../config/appconfig.h" #include "../deviceagent.h" #include "../view/logicsignal.h" +#include "../ui/langresource.h" namespace pv { namespace dock { @@ -96,7 +97,8 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession *session) : gLayout->addWidget(_adv_radioButton, 1, 0); gLayout->addWidget(_position_label, 2, 0); gLayout->addWidget(_position_spinBox, 2, 1); - gLayout->addWidget(new QLabel(tr("%"), _widget), 2, 2); + //tr + gLayout->addWidget(new QLabel("%", _widget), 2, 2); gLayout->addWidget(_position_slider, 3, 0, 1, 3); gLayout->addWidget(_stages_label, 4, 0); gLayout->addWidget(stages_comboBox, 4, 1); @@ -130,36 +132,38 @@ void TriggerDock::changeEvent(QEvent *event) void TriggerDock::retranslateUi() { - _simple_radioButton->setText(tr("Simple Trigger")); - _adv_radioButton->setText(tr("Advanced Trigger")); - _position_label->setText(tr("Trigger Position: ")); - _stages_label->setText(tr("Total Trigger Stages: ")); - _serial_start_label->setText(tr("Start Flag: ")); - _serial_stop_label->setText(tr("Stop Flag: ")); - _serial_edge_label->setText(tr("Clock Flag: ")); - _serial_data_label->setText(tr("Data Channel: ")); - _serial_value_label->setText(tr("Data Value: ")); - _serial_groupBox->setTitle(tr("Serial Trigger")); + _simple_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SIMPLE_TRIGGER), "Simple Trigger")); + _adv_radioButton->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADVANCED_TRIGGER), "Advanced Trigger")); + _position_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_POSITION), "Trigger Position: ")); + _stages_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TOTAL_TRIGGER_STAGES), "Total Trigger Stages: ")); + _serial_start_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_START_FLAG), "Start Flag: ")); + _serial_stop_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_STOP_FLAG), "Stop Flag: ")); + _serial_edge_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CLOCK_FLAG), "Clock Flag: ")); + _serial_data_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_CHANNEL), "Data Channel: ")); + _serial_value_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_VALUE), "Data Value: ")); + _serial_groupBox->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_TRIGGER), "Serial Trigger")); - _adv_tabWidget->setTabText(0, tr("Stage Trigger")); - _adv_tabWidget->setTabText(1, tr("Serial Trigger")); - _serial_note_label->setText(tr("X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")); - _data_bits_label->setText(tr("Data Bits")); + _adv_tabWidget->setTabText(0, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_STAGE_TRIGGER), "Stage Trigger")); + _adv_tabWidget->setTabText(1, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_TRIGGER), "Serial Trigger")); + _serial_note_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_NOTE_LABEL), + "X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")); + _data_bits_label->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_BITS), "Data Bits")); for (int i = 0; i < _inv_exp_label_list.length(); i++) - _inv_exp_label_list.at(i)->setText(tr("Inv")); + _inv_exp_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_INV), "Inv")); for (int i = 0; i < _count_exp_label_list.length(); i++) - _count_exp_label_list.at(i)->setText(tr("Counter")); + _count_exp_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_COUNTER), "Counter")); for (int i = 0; i < _contiguous_label_list.length(); i++) - _contiguous_label_list.at(i)->setText(tr("Contiguous")); + _contiguous_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CONTIGUOUS), "Contiguous")); for (int i = 0; i < _stage_groupBox_list.length(); i++) - _stage_groupBox_list.at(i)->setTitle(tr("Stage")+QString::number(i)); + _stage_groupBox_list.at(i)->setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_STAGE), "Stage")+QString::number(i)); for (int i = 0; i < _stage_note_label_list.length(); i++) - _stage_note_label_list.at(i)->setText(tr("X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")); + _stage_note_label_list.at(i)->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_NOTE_LABEL), + "X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge")); } void TriggerDock::reStyle() @@ -193,8 +197,9 @@ void TriggerDock::adv_trigger() } if (stream) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger")); - msg.mBox()->setInformativeText(tr("Stream Mode Don't Support Advanced Trigger!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STREAM_NO_AD_TRIGGER), + "Stream Mode Don't Support Advanced Trigger!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -205,8 +210,9 @@ void TriggerDock::adv_trigger() } else if (_session->get_device()->is_file() == false){ dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger")); - msg.mBox()->setInformativeText(tr("Advanced Trigger need DSLogic Hardware Support!")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_AD_TRIGGER_NEED_HARDWARE), + "Advanced Trigger need DSLogic Hardware Support!")); msg.mBox()->setStandardButtons(QMessageBox::Ok); msg.mBox()->setIcon(QMessageBox::Warning); msg.exec(); @@ -576,8 +582,8 @@ void TriggerDock::setup_adv_tab() QValidator *value_validator = new QRegularExpressionValidator(value_rx, _stage_tabWidget); for (int i = 0; i < TriggerStages; i++) { DsComboBox *_logic_comboBox = new DsComboBox(_stage_tabWidget); - _logic_comboBox->addItem(tr("Or")); - _logic_comboBox->addItem(tr("And")); + _logic_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_OR), "Or")); + _logic_comboBox->addItem(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AND), "And")); _logic_comboBox->setCurrentIndex(1); _logic_comboBox_list.push_back(_logic_comboBox); @@ -593,8 +599,9 @@ void TriggerDock::setup_adv_tab() _count_spinBox->setButtonSymbols(QAbstractSpinBox::NoButtons); _count_spinBox_list.push_back(_count_spinBox); DsComboBox *_inv0_comboBox = new DsComboBox(_stage_tabWidget); - _inv0_comboBox->addItem(tr("==")); - _inv0_comboBox->addItem(tr("!=")); + //tr + _inv0_comboBox->addItem("=="); + _inv0_comboBox->addItem("!="); _inv0_comboBox_list.push_back(_inv0_comboBox); QLineEdit *_value1_lineEdit = new QLineEdit("X X X X X X X X X X X X X X X X", _stage_tabWidget); @@ -605,8 +612,9 @@ void TriggerDock::setup_adv_tab() _value1_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); _value1_lineEdit_list.push_back(_value1_lineEdit); DsComboBox *_inv1_comboBox = new DsComboBox(_stage_tabWidget); - _inv1_comboBox->addItem(tr("==")); - _inv1_comboBox->addItem(tr("!=")); + //tr + _inv1_comboBox->addItem("=="); + _inv1_comboBox->addItem("!="); _inv1_comboBox_list.push_back(_inv1_comboBox); connect(_value0_lineEdit, SIGNAL(editingFinished()), this, SLOT(value_changed())); @@ -870,8 +878,8 @@ void TriggerDock::setup_adv_tab() connect(_serial_edge_lineEdit, SIGNAL(editingFinished()), this, SLOT(value_changed())); connect(_serial_value_lineEdit, SIGNAL(editingFinished()), this, SLOT(value_changed())); - _adv_tabWidget->addTab((QWidget *)_stage_tabWidget, tr("Stage Trigger")); - _adv_tabWidget->addTab((QWidget *)_serial_groupBox, tr("Serial Trigger")); + _adv_tabWidget->addTab((QWidget *)_stage_tabWidget, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_STAGE_TRIGGER), "Stage Trigger")); + _adv_tabWidget->addTab((QWidget *)_serial_groupBox, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SERIAL_TRIGGER), "Serial Trigger")); } void TriggerDock::lineEdit_highlight(QLineEdit *dst) { @@ -918,14 +926,14 @@ void TriggerDock::try_commit_trigger() if (app._appOptions.warnofMultiTrig && num > 1) { dialogs::DSMessageBox msg(this); - msg.mBox()->setText(tr("Trigger")); - msg.mBox()->setInformativeText(tr("Trigger setted on multiple channels! " - "Capture will Only triggered when all setted channels fullfill at one sample")); + msg.mBox()->setText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_TRIGGER), "Trigger")); + msg.mBox()->setInformativeText(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SET_TRI_MULTI_CHANNEL), + "Trigger setted on multiple channels!\nCapture will Only triggered when all setted channels fullfill at one sample")); msg.mBox()->setIcon(QMessageBox::Information); - QPushButton *noMoreButton = msg.mBox()->addButton(tr("Not Show Again"), QMessageBox::ActionRole); - QPushButton *cancelButton = msg.mBox()->addButton(tr("Clear Trig"), QMessageBox::ActionRole); - msg.mBox()->addButton(tr("Continue"), QMessageBox::ActionRole); + QPushButton *noMoreButton = msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NOT_SHOW_AGAIN), "Not Show Again"), QMessageBox::ActionRole); + QPushButton *cancelButton = msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CLEAR_TRIG), "Clear Trig"), QMessageBox::ActionRole); + msg.mBox()->addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CONTINUE), "Continue"), QMessageBox::ActionRole); msg.exec(); diff --git a/DSView/pv/mainframe.cpp b/DSView/pv/mainframe.cpp index 19b2651e..f3420b73 100644 --- a/DSView/pv/mainframe.cpp +++ b/DSView/pv/mainframe.cpp @@ -49,6 +49,8 @@ #include "ui/msgbox.h" #include "appcontrol.h" +#include "ui/langresource.h" + #include namespace pv { @@ -505,7 +507,7 @@ void MainFrame::show_doc() if (app._userHistory.showDocuments) { dialogs::DSDialog dlg(this, true); - dlg.setTitle(tr("Document")); + dlg.setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DOCUMENT), "Document")); QString path = GetAppDataDir() + "/showDoc" + QString::number(lan)+ ".png"; if (!QFile::exists(path)){ @@ -519,9 +521,9 @@ void MainFrame::show_doc() msg.setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); msg.setContentsMargins(0, 0, 0, 0); - QPushButton *noMoreButton = msg.addButton(tr("Not Show Again"), QMessageBox::ActionRole); - msg.addButton(tr("Ignore"), QMessageBox::ActionRole); - QPushButton *openButton = msg.addButton(tr("Open"), QMessageBox::ActionRole); + QPushButton *noMoreButton = msg.addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NOT_SHOW_AGAIN), "Not Show Again"), QMessageBox::ActionRole); + msg.addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_IGNORE), "Ignore"), QMessageBox::ActionRole); + QPushButton *openButton = msg.addButton(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OPEN), "Open"), QMessageBox::ActionRole); QVBoxLayout layout; layout.addWidget(&tipsLabel); diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index 34f75e6d..4a5f0184 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -144,7 +144,7 @@ namespace pv _logo_bar->setObjectName("logo_bar"); // trigger dock - _trigger_dock = new QDockWidget(tr("Trigger Setting..."), this); + _trigger_dock = new QDockWidget(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_DOCK_TITLE), "Trigger Setting..."), this); _trigger_dock->setObjectName("trigger_dock"); _trigger_dock->setFeatures(QDockWidget::DockWidgetMovable); _trigger_dock->setAllowedAreas(Qt::RightDockWidgetArea); @@ -152,7 +152,7 @@ namespace pv _trigger_widget = new dock::TriggerDock(_trigger_dock, _session); _trigger_dock->setWidget(_trigger_widget); - _dso_trigger_dock = new QDockWidget(tr("Trigger Setting..."), this); + _dso_trigger_dock = new QDockWidget(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_DOCK_TITLE), "Trigger Setting..."), this); _dso_trigger_dock->setObjectName("dso_trigger_dock"); _dso_trigger_dock->setFeatures(QDockWidget::DockWidgetMovable); _dso_trigger_dock->setAllowedAreas(Qt::RightDockWidgetArea); @@ -171,7 +171,7 @@ namespace pv addToolBar(_logo_bar); // Setup the dockWidget - _protocol_dock = new QDockWidget(tr("Protocol"), this); + _protocol_dock = new QDockWidget(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_DOCK_TITLE), "Protocol"), this); _protocol_dock->setObjectName("protocol_dock"); _protocol_dock->setFeatures(QDockWidget::DockWidgetMovable); _protocol_dock->setAllowedAreas(Qt::RightDockWidgetArea); @@ -180,7 +180,7 @@ namespace pv _protocol_dock->setWidget(_protocol_widget); // measure dock - _measure_dock = new QDockWidget(tr("Measurement"), this); + _measure_dock = new QDockWidget(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MEASURE_DOCK_TITLE), "Measurement"), this); _measure_dock->setObjectName("measure_dock"); _measure_dock->setFeatures(QDockWidget::DockWidgetMovable); _measure_dock->setAllowedAreas(Qt::RightDockWidgetArea); @@ -188,7 +188,7 @@ namespace pv _measure_widget = new dock::MeasureDock(_measure_dock, *_view, _session); _measure_dock->setWidget(_measure_widget); // search dock - _search_dock = new QDockWidget(tr("Search..."), this); + _search_dock = new QDockWidget(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_DOCK_TITLE), "Search..."), this); _search_dock->setObjectName("search_dock"); _search_dock->setFeatures(QDockWidget::NoDockWidgetFeatures); _search_dock->setTitleBarWidget(new QWidget(_search_dock)); @@ -291,7 +291,7 @@ namespace pv else { dsv_err("file is not exists:%s", ldFileName.toUtf8().data()); - MsgBox::Show(tr("Open file error!"), ldFileName, NULL); + MsgBox::Show(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_OPEN_FILE_ERROR), "Open file error!"), ldFileName, NULL); } } else @@ -300,13 +300,14 @@ namespace pv } } + //* void MainWindow::retranslateUi() { - _trigger_dock->setWindowTitle(tr("Trigger Setting...")); - _dso_trigger_dock->setWindowTitle(tr("Trigger Setting...")); - _protocol_dock->setWindowTitle(tr("Protocol")); - _measure_dock->setWindowTitle(tr("Measurement")); - _search_dock->setWindowTitle(tr("Search...")); + _trigger_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_DOCK_TITLE), "Trigger Setting...")); + _dso_trigger_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_DOCK_TITLE), "Trigger Setting...")); + _protocol_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_DOCK_TITLE), "Protocol")); + _measure_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MEASURE_DOCK_TITLE), "Measurement")); + _search_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_DOCK_TITLE), "Search...")); } void MainWindow::on_load_file(QString file_name) @@ -321,7 +322,7 @@ namespace pv } catch (QString e) { - show_error(tr("Failed to load ") + file_name); + show_error(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_FAIL_TO_LOAD), "Failed to load ") + file_name); _session->set_default_device(); } } @@ -347,19 +348,21 @@ namespace pv { case SigSession::Hw_err: _session->stop_capture(); - title = tr("Hardware Operation Failed"); - details = tr("Please replug device to refresh hardware configuration!"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_HARDWARE_ERROR), "Hardware Operation Failed"); + details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_HARDWARE_ERROR_DET), + "Please replug device to refresh hardware configuration!"); break; case SigSession::Malloc_err: _session->stop_capture(); - title = tr("Malloc Error"); - details = tr("Memory is not enough for this sample!\nPlease reduce the sample depth!"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MALLOC_ERROR), "Malloc Error"); + details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_MALLOC_ERROR_DET), + "Memory is not enough for this sample!\nPlease reduce the sample depth!"); break; case SigSession::Test_data_err: _session->stop_capture(); update_toolbar_view_status(); - title = tr("Data Error"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_DATA_ERROR), "Data Error"); error_pattern = _session->get_error_pattern(); for (int i = 0; i < 16; i++) @@ -371,22 +374,26 @@ namespace pv ch_status += (i > 9 ? " " : ""); error_pattern >>= 1; } - details = tr("the received data are not consist with pre-defined test data!") + "\n" + - tr("0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15") + "\n" + ch_status; + + details = QString(L_S(STR_PAGE_MSG, S_ID(IDS_DATA_ERROR_DET1),"the received data are not consist with pre-defined test data!")) + "\n" + + QString("0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15") + "\n" + + ch_status; break; case SigSession::Pkt_data_err: - title = tr("Packet Error"); - details = tr("the content of received packet are not expected!"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PACKET_ERROR), "Packet Error"); + details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_PACKET_ERROR_DET), + "the content of received packet are not expected!"); _session->refresh(0); break; case SigSession::Data_overflow: _session->stop_capture(); - title = tr("Data Overflow"); - details = tr("USB bandwidth can not support current sample rate! \nPlease reduce the sample rate!"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_OVERFLOW), "Data Overflow"); + details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_OVERFLOW_DET), + "USB bandwidth can not support current sample rate! \nPlease reduce the sample rate!"); break; default: - title = tr("Undefined Error"); - details = tr("Not expected error!"); + title = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_UNDEFINED_ERROR), "Undefined Error"); + details = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_UNDEFINED_ERROR_DET), "Not expected error!"); break; } @@ -515,9 +522,8 @@ namespace pv QString format = "png"; QString fileName = QFileDialog::getSaveFileName( this, - tr("Save As"), + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAVE_AS), "Save As"), default_name, - // tr("%1 Files (*.%2);;All Files (*)") "png file(*.png);;jpeg file(*.jpeg)", &format); @@ -529,7 +535,8 @@ namespace pv QFileInfo f(fileName); if (f.suffix().compare(suffix)) { - fileName += tr(".") + suffix; + //tr + fileName += "." + suffix; } pixmap.save(fileName, suffix.toLatin1()); @@ -633,7 +640,7 @@ namespace pv // check device and mode if (driverName != sessionDevice || mode != sessionMode) { - MsgBox::Show(NULL, tr("Session File is not compatible with current device or mode!"), this); + MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_NOT_COMPATIBLE), "Session File is not compatible with current device or mode!"), this); return false; } } @@ -1001,7 +1008,7 @@ namespace pv } catch (...) { - MsgBox::Show(NULL, tr("restore window status error!")); + MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_RE_WIN_ST_ER), "restore window status error!")); } } @@ -1352,8 +1359,8 @@ namespace pv g_variant_unref(gvar); if (usb30_support && usb_speed == LIBUSB_SPEED_HIGH) - show_error(tr("Plug it into a USB 2.0 port will seriously affect its performance." - "Please replug it into a USB 3.0 port.")); + show_error(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_USB_SPEED_ERROR), + "Plug it into a USB 2.0 port will seriously affect its performance.\nPlease replug it into a USB 3.0 port.")); } } } @@ -1386,7 +1393,7 @@ namespace pv { if (_session->have_hardware_data()) { - return MsgBox::Confirm(tr("Save captured data?")); + return MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_CAPDATE), "Save captured data?")); } return false; } @@ -1405,9 +1412,8 @@ namespace pv g_variant_unref(gvar); if (version == 1) { - show_error(tr("Current loading file has an old format. " - "This will lead to a slow loading speed. " - "Please resave it after loaded.")); + show_error(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR), + "Current loading file has an old format. \nThis will lead to a slow loading speed. \nPlease resave it after loaded.")); } } } diff --git a/DSView/pv/prop/binding/deviceoptions.cpp b/DSView/pv/prop/binding/deviceoptions.cpp index 9f322b0f..fa4e4df4 100644 --- a/DSView/pv/prop/binding/deviceoptions.cpp +++ b/DSView/pv/prop/binding/deviceoptions.cpp @@ -34,6 +34,7 @@ #include "../../appcontrol.h" #include "../../sigsession.h" #include "../../deviceagent.h" +#include "../../ui/langresource.h" using namespace std; @@ -242,7 +243,8 @@ void DeviceOptions::bind_samplerate(const QString &name, const QString label, assert(num_elements == 3); _properties.push_back( - new Double(name, label, 0, QObject::tr("Hz"), + //tr + new Double(name, label, 0, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_HZ), "Hz"), make_pair((double)elements[0], (double)elements[1]), (double)elements[2], bind(samplerate_double_getter), diff --git a/DSView/pv/storesession.cpp b/DSView/pv/storesession.cpp index cec12c5a..a8a930c0 100644 --- a/DSView/pv/storesession.cpp +++ b/DSView/pv/storesession.cpp @@ -60,6 +60,8 @@ #include "utility/encoding.h" #include "utility/path.h" #include "log.h" + +#include "ui/langresource.h" namespace pv { @@ -135,17 +137,17 @@ bool StoreSession::save_start() } if (type_set.size() > 1) { - _error = tr("DSView does not currently support" - "file saving for multiple data types."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR1), + "DSView does not currently support\nfile saving for multiple data types."); return false; } else if (type_set.size() == 0) { - _error = tr("No data to save."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR2), "No data to save."); return false; } if (_file_name == ""){ - _error = tr("No file name."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR3), "No file name."); return false; } @@ -153,7 +155,7 @@ bool StoreSession::save_start() assert(snapshot); // Check we have data if (snapshot->empty()) { - _error = tr("No data to save."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR2), "No data to save."); return false; } @@ -166,17 +168,17 @@ bool StoreSession::save_start() _sessionDataGetter->genSessionData(session_data); if (meta_data.empty()) { - _error = tr("Generate temp file data failed."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR4), "Generate temp file data failed."); QFile::remove(_file_name); return false; } if (decoder_data.empty()){ - _error = tr("Generate decoder file data failed."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR5), "Generate decoder file data failed."); QFile::remove(_file_name); return false; } if (session_data.empty()){ - _error = tr("Generate session file data failed."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR6), "Generate session file data failed."); QFile::remove(_file_name); return false; } @@ -201,7 +203,7 @@ bool StoreSession::save_start() } } else{ - _error = tr("Generate zip file failed."); + _error = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_STORESESS_SAVESTART_ERROR7), "Generate zip file failed."); } QFile::remove(_file_name); @@ -244,7 +246,8 @@ void StoreSession::save_proc(data::Snapshot *snapshot) buf = (uint8_t *)malloc(size); if (buf == NULL) { _has_error = true; - _error = tr("Failed to create zip file. Malloc error."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_SAVEPROC_ERROR1), + "Failed to create zip file. Malloc error."); } else { memset(buf, sample ? 0xff : 0x0, size); } @@ -256,7 +259,8 @@ void StoreSession::save_proc(data::Snapshot *snapshot) if (ret != SR_OK) { if (!_has_error) { _has_error = true; - _error = tr("Failed to create zip file. Please check write permission of this path."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_SAVEPROC_ERROR2), + "Failed to create zip file. Please check write permission of this path."); } progress_updated(); if (_has_error) @@ -292,7 +296,8 @@ void StoreSession::save_proc(data::Snapshot *snapshot) uint8_t *tmp = (uint8_t *)malloc(size); if (tmp == NULL) { _has_error = true; - _error = tr("Failed to create zip file. Malloc error."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_SAVEPROC_ERROR1), + "Failed to create zip file. Malloc error."); } else { memcpy(tmp, buf, buf_end-buf); memcpy(tmp+(buf_end-buf), buf_start, buf+size-buf_end); @@ -314,7 +319,8 @@ void StoreSession::save_proc(data::Snapshot *snapshot) if (ret != SR_OK) { if (!_has_error) { _has_error = true; - _error = tr("Failed to create zip file. Please check write permission of this path."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_SAVEPROC_ERROR2), + "Failed to create zip file. Please check write permission of this path."); } progress_updated(); if (_has_error) @@ -586,11 +592,11 @@ bool StoreSession::export_start() } if (type_set.size() > 1) { - _error = tr("DSView does not currently support" - "file export for multiple data types."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTSTART_ERROR1), + "DSView does not currently support\nfile export for multiple data types."); return false; } else if (type_set.size() == 0) { - _error = tr("No data to save."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTSTART_ERROR2), "No data to save."); return false; } @@ -598,12 +604,12 @@ bool StoreSession::export_start() assert(snapshot); // Check we have data if (snapshot->empty()) { - _error = tr("No data to save."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTSTART_ERROR2), "No data to save."); return false; } if (_file_name == ""){ - _error = tr("No set file name."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTSTART_ERROR3), "No set file name."); return false; } @@ -622,7 +628,7 @@ bool StoreSession::export_start() if (_outModule == NULL) { - _error = tr("Invalid export format."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTSTART_ERROR4), "Invalid export format."); } else { @@ -656,7 +662,7 @@ void StoreSession::export_proc(data::Snapshot *snapshot) channel_type = SR_CHANNEL_ANALOG; } else { _has_error = true; - _error = tr("data type don't support."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTPROC_ERROR1), "data type don't support."); return; } @@ -774,7 +780,7 @@ void StoreSession::export_proc(data::Snapshot *snapshot) uint8_t *xbuf = (uint8_t *)malloc(size * unitsize); if (xbuf == NULL) { _has_error = true; - _error = tr("xbuffer malloc failed."); + _error = L_S(STR_PAGE_DLG, S_ID(IDS_MSG_STORESESS_EXPORTPROC_ERROR2), "xbuffer malloc failed."); return; } memset(xbuf, 0, size * unitsize); @@ -1225,9 +1231,10 @@ QString StoreSession::MakeSaveFile(bool bDlg) { default_name = QFileDialog::getSaveFileName( NULL, - tr("Save File"), + L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SAVE_FILE),"Save File"), default_name, - tr("DSView Data (*.dsl)")); + //tr + "DSView Data (*.dsl)"); if (default_name.isEmpty()) { @@ -1246,7 +1253,8 @@ QString StoreSession::MakeSaveFile(bool bDlg) QFileInfo f(default_name); if (f.suffix().compare("dsl")) { - default_name.append(tr(".dsl")); + //Tr + default_name.append(".dsl"); } _file_name = default_name; return default_name; @@ -1294,7 +1302,7 @@ QString StoreSession::MakeExportFile(bool bDlg) { default_name = QFileDialog::getSaveFileName( NULL, - tr("Export Data"), + L_S(STR_PAGE_MSG, S_ID(IDS_MSG_EXPORT_DATA),"Export Data"), default_name, filter, &selfilter); @@ -1331,7 +1339,8 @@ QString StoreSession::MakeExportFile(bool bDlg) QFileInfo f(default_name); if(f.suffix().compare(_suffix)){ - default_name += tr(".") + _suffix; + //tr + default_name += "." + _suffix; } _file_name = default_name; diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/pv/view/decodetrace.cpp index e0f44e4f..db78c1c0 100644 --- a/DSView/pv/view/decodetrace.cpp +++ b/DSView/pv/view/decodetrace.cpp @@ -53,6 +53,8 @@ #include "../appcontrol.h" #include "../dialogs/decoderoptionsdlg.h" +#include "../ui/langresource.h" + using namespace boost; using namespace std; @@ -314,7 +316,7 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QColo } } } else { - draw_unshown_row(p, y, annotation_height, left, right, tr("Unshown"), fore, back); + draw_unshown_row(p, y, annotation_height, left, right, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_UNSHOWN), "Unshown"), fore, back); y += annotation_height; _cur_row_headings.push_back(dec->decoder()->name); } @@ -404,7 +406,7 @@ void DecodeTrace::draw_nodetail(QPainter &p, (void)back; const QRectF nodetail_rect(left, y - h/2 + 0.5, right - left, h); - QString info = tr("Zoom in for details"); + QString info = L_S(STR_PAGE_DLG, S_ID(ZOOM_IN_FOR_DETAILS), "Zoom in for details"); int info_left = nodetail_rect.center().x() - p.boundingRect(QRectF(), 0, info).width(); int info_right = nodetail_rect.center().x() + p.boundingRect(QRectF(), 0, info).width(); int height = p.boundingRect(QRectF(), 0, info).height(); @@ -524,9 +526,9 @@ void DecodeTrace::draw_error(QPainter &p, const QString &message, font.setPointSize(DefaultFontSize); p.setFont(font); if (bounding_rect.width() < text_rect.width()) - p.drawText(text_rect, Qt::AlignCenter, tr("Error: ")+message); + p.drawText(text_rect, Qt::AlignCenter, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DECODETRACE_ERROR1), "Error:")+message); else - p.drawText(text_rect, Qt::AlignCenter, tr("Error: ...")); + p.drawText(text_rect, Qt::AlignCenter, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DECODETRACE_ERROR2), "Error: ...")); } void DecodeTrace::draw_unshown_row(QPainter &p, int y, int h, int left, diff --git a/DSView/pv/view/devmode.cpp b/DSView/pv/view/devmode.cpp index b007573e..10d9461f 100644 --- a/DSView/pv/view/devmode.cpp +++ b/DSView/pv/view/devmode.cpp @@ -35,6 +35,8 @@ #include "../ui/msgbox.h" #include "../log.h" +#include "../ui/langresource.h" + static const struct dev_mode_name dev_mode_name_list[] = { @@ -226,7 +228,7 @@ void DevMode::on_close() assert(false); } - if (_bFile && MsgBox::Confirm(tr("Are you sure to close the device?"))){ + if (_bFile && MsgBox::Confirm(L_S(STR_PAGE_MSG, S_ID(IDS_MSG_CLOSE_DEVICE), "Are you sure to close the device?"))){ _session->close_file(_device_agent->handle()); } } diff --git a/DSView/pv/view/dsldial.cpp b/DSView/pv/view/dsldial.cpp index 86fa462e..971a2029 100644 --- a/DSView/pv/view/dsldial.cpp +++ b/DSView/pv/view/dsldial.cpp @@ -86,7 +86,8 @@ void dslDial::paint(QPainter &p, QRectF dialRect, QColor dialColor, const QPoint displayValue = displayValue / _step; displayIndex++; } - pText = QString::number(displayValue) + _unit[displayIndex] + tr("/div"); + //tr + pText = QString::number(displayValue) + _unit[displayIndex] + "/div"; // QFontMetrics fm(p.font()); // const QRectF valueRect = QRectF(dialRect.left(), dialRect.top()-fm.height()-10, dialRect.width(), fm.height()); // p.drawText(valueRect, Qt::AlignCenter, pText); diff --git a/DSView/pv/view/header.cpp b/DSView/pv/view/header.cpp index e1107d52..228f0b5f 100644 --- a/DSView/pv/view/header.cpp +++ b/DSView/pv/view/header.cpp @@ -41,6 +41,7 @@ #include "decodetrace.h" #include "../sigsession.h" #include "../dsvdef.h" +#include "../ui/langresource.h" using namespace std; @@ -51,8 +52,8 @@ namespace view { Header::Header(View &parent) : QWidget(&parent), _view(parent), - _action_add_group(new QAction(tr("Add Group"), this)), - _action_del_group(new QAction(tr("Del Group"), this)) + _action_add_group(new QAction(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD_GROUP), "Add Group"), this)), + _action_del_group(new QAction(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DEL_GROUP), "Del Group"), this)) { _moveFlag = false; _colorFlag = false; @@ -348,7 +349,7 @@ void Header::changeName(QMouseEvent *event) void Header::changeColor(QMouseEvent *event) { if ((event->button() == Qt::LeftButton)) { - const QColor new_color = QColorDialog::getColor(_context_trace->get_colour(), this, tr("Set Channel Colour")); + const QColor new_color = QColorDialog::getColor(_context_trace->get_colour(), this, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SET_CHANNEL_COLOUR), "Set Channel Colour")); if (new_color.isValid()) _context_trace->set_colour(new_color); } diff --git a/DSView/pv/view/lissajoustrace.cpp b/DSView/pv/view/lissajoustrace.cpp index 8197f2a5..3e56392a 100644 --- a/DSView/pv/view/lissajoustrace.cpp +++ b/DSView/pv/view/lissajoustrace.cpp @@ -29,6 +29,8 @@ #include "../data/dso.h" #include "../data/dsosnapshot.h" #include "../sigsession.h" + +#include "../ui/langresource.h" using namespace std; @@ -128,7 +130,7 @@ void LissajousTrace::paint_back(QPainter &p, int left, int right, QColor fore, Q fore.setAlpha(view::View::ForeAlpha); p.setPen(fore); p.drawText(_border.marginsRemoved(QMargins(10, 10, 10, 10)), - tr("Lissajous Figure"), Qt::AlignTop | Qt::AlignLeft); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_LISSAJOUS_FIGURE), "Lissajous Figure"), Qt::AlignTop | Qt::AlignLeft); _view->set_back(true); } @@ -164,7 +166,7 @@ void LissajousTrace::paint_mid(QPainter &p, int left, int right, QColor fore, QC if (_xIndex >= channel_num || _yIndex >= channel_num) { p.setPen(view::View::Red); p.drawText(_border.marginsRemoved(QMargins(10, 30, 10, 30)), - tr("Data source error.")); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DATA_SOURCE_ERROR), "Data source error.")); } else { const uint8_t *const samples = snapshot->get_samples(0, sample_count-1, 0); diff --git a/DSView/pv/view/view.cpp b/DSView/pv/view/view.cpp index 21901197..2c4c0604 100644 --- a/DSView/pv/view/view.cpp +++ b/DSView/pv/view/view.cpp @@ -162,9 +162,10 @@ View::View(SigSession *session, pv::toolbars::SamplingBar *sampling_bar, QWidget _header->installEventFilter(this); _devmode->installEventFilter(this); - _viewcenter->setObjectName(tr("ViewArea_center")); - _ruler->setObjectName(tr("ViewArea_ruler")); - _header->setObjectName(tr("ViewArea_header")); + //tr + _viewcenter->setObjectName("ViewArea_center"); + _ruler->setObjectName("ViewArea_ruler"); + _header->setObjectName("ViewArea_header"); QColor fore(QWidget::palette().color(QWidget::foregroundRole())); fore.setAlpha(View::BackAlpha); diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp index 8a126b5f..49c3a824 100644 --- a/DSView/pv/view/viewport.cpp +++ b/DSView/pv/view/viewport.cpp @@ -45,6 +45,8 @@ #include "../appcontrol.h" #include "../log.h" +#include "../ui/langresource.h" + using namespace std; namespace pv { @@ -96,8 +98,8 @@ Viewport::Viewport(View &parent, View_type type) : _drag_timer.setSingleShot(true); _cmenu = new QMenu(this); - QAction *yAction = _cmenu->addAction(tr("Add Y-cursor")); - QAction *xAction = _cmenu->addAction(tr("Add X-cursor")); + QAction *yAction = _cmenu->addAction(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD_Y_CURSOR), "Add Y-cursor")); + QAction *xAction = _cmenu->addAction(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD_X_CURSOR), "Add X-cursor")); setContextMenuPolicy(Qt::CustomContextMenu); @@ -334,16 +336,16 @@ void Viewport::paintSignals(QPainter &p, QColor fore, QColor back) type = g_variant_get_byte(gvar); g_variant_unref(gvar); if (type == DSO_TRIGGER_AUTO && roll) { - type_str = tr("Auto(Roll)"); + type_str = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO_ROLL), "Auto(Roll)"); } else if (type == DSO_TRIGGER_AUTO && !_view.session().trigd()) { - type_str = tr("Auto"); + type_str = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_AUTO), "Auto"); } else if (_waiting_trig > 0) { - type_str = tr("Waiting Trig"); + type_str = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING_TRIG), "Waiting Trig"); for (int i = 1; i < _waiting_trig; i++) if (i % (WaitLoopTime / SigSession::FeedInterval) == 0) type_str += "."; } else { - type_str = tr("Trig'd"); + type_str = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIG_D), "Trig'd"); } } p.setPen(fore); @@ -454,12 +456,14 @@ void Viewport::paintProgress(QPainter &p, QColor fore, QColor back) if (triggered) { p.drawText(status_rect, Qt::AlignCenter | Qt::AlignVCenter, - tr("Triggered! ") + QString::number(captured_progress) + tr("% Captured")); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGERED), "Triggered! ") + QString::number(captured_progress) + + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CAPTURED), "% Captured")); _view.set_trig_time(); } else { p.drawText(status_rect, Qt::AlignCenter | Qt::AlignVCenter, - tr("Waiting for Trigger! ") + QString::number(captured_progress) + tr("% Captured")); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING_FOR_TRIGGER), "Waiting for Trigger! ") + QString::number(captured_progress) + + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CAPTURED), "% Captured")); } prgRate(captured_progress); } @@ -1266,9 +1270,9 @@ void Viewport::measure() _cur_aftX = _view.hover_point().x(); _cur_midY = logicSig->get_y() - logicSig->get_totalHeight()/2 - 5; - _em_rising = tr("Rising: ") + QString::number(_edge_rising); - _em_falling = tr("Falling: ") + QString::number(_edge_falling); - _em_edges = tr("Edges: ") + QString::number(_edge_rising + _edge_falling); + _em_rising = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_RISING), "Rising: ") + QString::number(_edge_rising); + _em_falling = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FALLING), "Falling: ") + QString::number(_edge_falling); + _em_edges = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_Edges_1), "Edges: ") + QString::number(_edge_rising + _edge_falling); break; } @@ -1374,13 +1378,13 @@ void Viewport::paintMeasure(QPainter &p, QColor fore, QColor back) p.setPen(active_color); p.drawText(measure1_rect, Qt::AlignRight | Qt::AlignVCenter, - tr("Width: ") + _mm_width); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WIDTH), "Width: ") + _mm_width); p.drawText(measure2_rect, Qt::AlignRight | Qt::AlignVCenter, - tr("Period: ") + _mm_period); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PERIOD), "Period: ") + _mm_period); p.drawText(measure3_rect, Qt::AlignRight | Qt::AlignVCenter, - tr("Frequency: ") + _mm_freq); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_FREQUENCY), "Frequency: ") + _mm_freq); p.drawText(measure4_rect, Qt::AlignRight | Qt::AlignVCenter, - tr("Duty Cycle: ") + _mm_duty); + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DUTY_CYCLE), "Duty Cycle: ") + _mm_duty); } } diff --git a/DSView/pv/view/viewstatus.cpp b/DSView/pv/view/viewstatus.cpp index 64762466..d6295c40 100644 --- a/DSView/pv/view/viewstatus.cpp +++ b/DSView/pv/view/viewstatus.cpp @@ -35,6 +35,8 @@ #include "../view/trace.h" #include "../dialogs/dsomeasure.h" +#include "../ui/langresource.h" + using namespace std; @@ -122,7 +124,7 @@ void ViewStatus::paintEvent(QPaintEvent *) p.drawText(QRect(rect.left()+10+rect.height(), rect.top(), width, rect.height()), Qt::AlignLeft | Qt::AlignVCenter, title); } else { - p.drawText(rect, Qt::AlignCenter | Qt::AlignVCenter, tr("Measure") + QString::number(i)); + p.drawText(rect, Qt::AlignCenter | Qt::AlignVCenter, L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MEASURE), "Measure") + QString::number(i)); } } } @@ -171,20 +173,22 @@ void ViewStatus::repeat_unshow() void ViewStatus::set_trig_time(QDateTime time) { - _trig_time = tr("Trigger Time: ") + time.toString("yyyy-MM-dd hh:mm:ss"); + _trig_time = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGER_TIME), "Trigger Time: ") + time.toString("yyyy-MM-dd hh:mm:ss"); } void ViewStatus::set_rle_depth(uint64_t depth) { - _rle_depth = QString::number(depth) + tr(" Samples Captured!"); + _rle_depth = QString::number(depth) + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SAMPLES_CAPTURED), "Samples Captured!"); } void ViewStatus::set_capture_status(bool triggered, int progess) { if (triggered) { - _capture_status = tr("Triggered! ") + QString::number(progess) + tr("% Captured"); + _capture_status = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_TRIGGERED), "Triggered! ") + QString::number(progess) + + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CAPTURED), "% Captured"); } else { - _capture_status = tr("Waiting for Trigger! ") + QString::number(progess) + tr("% Captured"); + _capture_status = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_WAITING_FOR_TRIGGER), "Waiting for Trigger! ") + QString::number(progess) + + L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CAPTURED), "% Captured"); } } diff --git a/lang/cn/dlg.json b/lang/cn/dlg.json index cd2dac4e..03cb03e8 100644 --- a/lang/cn/dlg.json +++ b/lang/cn/dlg.json @@ -22,5 +22,625 @@ { "id": "IDS_DLG_SAVE_SEESION", "text": "保存会话" + }, + { + "id": "IDS_DLG_DOCUMENT", + "text": "文件" + }, + { + "id": "IDS_DLG_TRIGGER_DOCK_TITLE", + "text": "触发设置" + }, + { + "id": "IDS_DLG_PROTOCOL_DOCK_TITLE", + "text": "协议" + }, + { + "id": "IDS_DLG_MEASURE_DOCK_TITLE", + "text": "测量" + }, + { + "id": "IDS_DLG_SEARCH_DOCK_TITLE", + "text": "查找" + }, + { + "id": "IDS_DLG_SAVE_AS", + "text": "另存为" + }, + { + "id": "IDS_DLG_CHECK_USB_SPEED_ERROR", + "text": " 将其插入USB 2.0端口将严重影响其性能.\n 请将其重新插入USB 3.0端口." + }, + { + "id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR", + "text": " 当前加载文件具有旧格式 . \n这将导致加载速度变慢. \n请在加载后重新保存." + }, + { + "id": "IDS_DLG_ABOUT", + "text": "关于" + }, + { + "id": "IDS_DLG_DISPLAY_OPTIONS", + "text": "显示选项" + }, + { + "id": "IDS_DLG_QUICK_SCROLL", + "text": "快速滚动" + }, + { + "id": "IDS_DLG_SAVE", + "text": "保存" + }, + { + "id": "IDS_DLG_RESET", + "text": "重置" + }, + { + "id": "IDS_DLG_EXIT", + "text": "推出" + }, + { + "id": "IDS_DLG_MANUAL_CALIBRATION", + "text": "手动校准" + }, + { + "id": "IDS_DLG_CHANNEL", + "text": "通道" + }, + { + "id": "IDS_DLG_SAVE_CALIBRATION_RESULTS", + "text": " 保存校准结果...可能需要一段时间." + }, + { + "id": "IDS_DLG_CANCEL", + "text": "取消" + }, + { + "id": "IDS_DLG_RELOAD_CALIBRATION_RESULTS", + "text": " 重新加载上次校准...可能需要一段时间." + }, + { + "id": "IDS_DLG_DECODER_OPTIONS", + "text": "解码选项" + }, + { + "id": "IDS_DLG_CURSOR", + "text": "光标 " + }, + { + "id": "IDS_DLG_CURSOR_FOR_DECODE_START", + "text": "位于解码起始时间的光标" + }, + { + "id": "IDS_DLG_CURSOR_FOR_DECODE_END", + "text": "位于解码结束时间的光标" + }, + { + "id": "IDS_DLG_DEVICE_OPTIONS", + "text": "设备选项" + }, + { + "id": "IDS_DLG_MODE", + "text": "模式" + }, + { + "id": "IDS_DLG_OPERATION_MODE", + "text": "工作模式" + }, + { + "id": "IDS_DLG_ENABLE_ALL", + "text": "全部启用" + }, + { + "id": "IDS_DLG_DISABLE_ALL", + "text": "全部禁用" + }, + { + "id": "IDS_DLG_ENABLE", + "text": "启用: " + }, + { + "id": "IDS_DLG_AUTO_CALIBRATION", + "text": "自动校准" + }, + { + "id": "IDS_DLG_CALIBRATION", + "text": "校准" + }, + { + "id": "IDS_DLG_MEASUREMENTS", + "text": "测量" + }, + { + "id": "IDS_DLG_FFT_ENABLE", + "text": "FFT使能: " + }, + { + "id": "IDS_DLG_FFT_LENGTH", + "text": "FFT长度: " + }, + { + "id": "IDS_DLG_SAMPLE_INTERVAL", + "text": "抽样间隔: " + }, + { + "id": "IDS_DLG_FFT_SOURCE", + "text": "FFT通道: " + }, + { + "id": "IDS_DLG_FFT_WINDOW", + "text": "FFT加窗: " + }, + { + "id": "IDS_DLG_DC_IGNORED", + "text": "忽视直流: " + }, + { + "id": "IDS_DLG_Y-AXIS_MODE", + "text": "Y轴模式: " + }, + { + "id": "IDS_DLG_DBV_RANGE", + "text": "DBV范围: " + }, + { + "id": "IDS_DLG_FFT_OPTIONS", + "text": "FFT选项" + }, + { + "id": "IDS_DLG_INTERVAL_S", + "text": "间隔(s): " + }, + { + "id": "IDS_DLG_REPETITIVE_INTERVAL", + "text": "重复间隔" + }, + { + "id": "IDS_DLG_X_AXIS", + "text": "X轴" + }, + { + "id": "IDS_DLG_Y_AXIS", + "text": "Y轴" + }, + { + "id": "IDS_DLG_LISSAJOUS_OPTIONS", + "text": "李萨如图选项" + }, + { + "id": "IDS_DLG_ADD", + "text": "加" + }, + { + "id": "IDS_DLG_SUBSTRACT", + "text": "减" + }, + { + "id": "IDS_DLG_MULTIPLY", + "text": "乘" + }, + { + "id": "IDS_DLG_DIVIDE", + "text": "除" + }, + { + "id": "IDS_DLG_MATH_TYPE", + "text": "运算类型" + }, + { + "id": "IDS_DLG_1ST_SOURCE", + "text": "第一操作数" + }, + { + "id": "IDS_DLG_2ST_SOURCE", + "text": "第二操作数" + }, + { + "id": "IDS_DLG_MATH_OPTIONS", + "text": "数学运算选项" + }, + { + "id": "IDS_DLG_EXPORT_FORMAT", + "text": "导出格式: " + }, + { + "id": "IDS_DLG_PROTOCOL_EXPORT", + "text": "协议导出" + }, + { + "id": "IDS_DLG_EXPORT_DATA", + "text": "导出数据: " + }, + { + "id": "IDS_DLG_EXPORT_PROTOCOL_LIST_RESULT", + "text": " 导出协议列表结果...可能需要一段时间 ." + }, + { + "id": "IDS_DLG_FIT_TO_WINDOW", + "text": "适应窗口大小" + }, + { + "id": "IDS_DLG_FIXED", + "text": "固定" + }, + { + "id": "IDS_DLG_MAP_ZOOM", + "text": "地图缩放 : " + }, + { + "id": "IDS_DLG_DECODED_PROTOCOLS", + "text": "解码协议: " + }, + { + "id": "IDS_DLG_PROTOCOL_LIST_VIEWER", + "text": "协议列表查看" + }, + { + "id": "IDS_DLG_REGION", + "text": "区域" + }, + { + "id": "IDS_DLG_SEARCH_LABEL", + "text": "X: 不关心\n0: 低电平\n1: 高电平\nR: 上升沿\nF: 下降沿\nC: 上升/下降沿" + }, + { + "id": "IDS_DLG_SEARCH_OPTIONS", + "text": "搜索选项" + }, + { + "id": "IDS_DLG_CHANGE", + "text": "变化" + }, + { + "id": "IDS_DLG_SAVING", + "text": "保存中..." + }, + { + "id": "IDS_DLG_ORIGINAL_DATA", + "text": "原始数据" + }, + { + "id": "IDS_DLG_COMPRESSED_DATA", + "text": "压缩数据" + }, + { + "id": "IDS_DLG_EXPORTING", + "text": "导出中..." + }, + { + "id": "IDS_DLG_DONT_CONNECT_PROBES", + "text": "不要连接任何探头!" + }, + { + "id": "IDS_DLG_LOAD_CURRENT_SETTING", + "text": "加载当前设置... 可能需要一段时间." + }, + { + "id": "IDS_DLG_WAITING", + "text": "等待" + }, + { + "id": "IDS_DLG_FINISHED", + "text": "完成!" + }, + { + "id": "IDS_DLG_US", + "text": "uS" + }, + { + "id": "IDS_DLG_MS", + "text": "mS" + }, + { + "id": "IDS_DLG_S", + "text": "S" + }, + { + "id": "IDS_DLG_TRIGGER_POSITION", + "text": "触发位置: " + }, + { + "id": "IDS_DLG_HOLD_OFF_TIME", + "text": "闭锁时间: " + }, + { + "id": "IDS_DLG_NOISE_SENSITIVITY", + "text": "噪声灵敏度: " + }, + { + "id": "IDS_DLG_TRIGGER_SOURCES", + "text": "触发源: " + }, + { + "id": "IDS_DLG_TRIGGER_TYPES", + "text": "触发类型: " + }, + { + "id": "IDS_DLG_RISING_EDGE", + "text": "上升沿" + }, + { + "id": "IDS_DLG_FALLING_EDGE", + "text": "下降沿" + }, + { + "id": "IDS_DLG_AUTO", + "text": "自动" + }, + { + "id": "IDS_DLG_CHANNEL_0", + "text": "通道 0" + }, + { + "id": "IDS_DLG_CHANNEL_1", + "text": "通道 1" + }, + { + "id": "IDS_DLG_CHANNEL_0_AND_1", + "text": "通道 0 && 1" + }, + { + "id": "IDS_DLG_CHANNEL_0_OR_1", + "text": "通道 0 | 1" + }, + { + "id": "IDS_DLG_KEYWORD_LINEEID", + "text": "协议搜索" + }, + { + "id": "IDS_DLG_TIME_SAMPLES", + "text": "时间/样本" + }, + { + "id": "IDS_DLG_MOUSE_MEASUREMENT", + "text": "鼠标测量" + }, + { + "id": "IDS_DLG_ENABLE_FLOATING_MEASUREMENT", + "text": "启用浮动测量" + }, + { + "id": "IDS_DLG_CURSOR_DISTANCE", + "text": "光标距离" + }, + { + "id": "IDS_DLG_EDGES", + "text": "边沿" + }, + { + "id": "IDS_DLG_CURSORS", + "text": "光标" + }, + { + "id": "IDS_DLG_RIS_OR_FAL_EDGE", + "text": "上升沿/下降沿/边沿" + }, + { + "id": "IDS_DLG_W", + "text": "W: " + }, + { + "id": "IDS_DLG_P", + "text": "P: " + }, + { + "id": "IDS_DLG_F", + "text": "F: " + }, + { + "id": "IDS_DLG_D", + "text": "D: " + }, + { + "id": "IDS_DLG_SEARCH", + "text": "查找" + }, + { + "id": "IDS_DLG_MATCHING_ITEMS", + "text": "匹配项:" + }, + { + "id": "IDS_DLG_OUT_OF_MEMORY", + "text": "内存不足" + }, + { + "id": "IDS_DLG_SEARCHING", + "text": "查找中" + }, + { + "id": "IDS_DLG_SEARCH_PREVIOUS", + "text": "搜索上一个" + }, + { + "id": "IDS_DLG_SEARCH_NEXT", + "text": "搜索下一个" + }, + { + "id": "IDS_DLG_SIMPLE_TRIGGER", + "text": "简单触发模式" + }, + { + "id": "IDS_DLG_ADVANCED_TRIGGER", + "text": "高级触发模式" + }, + { + "id": "IDS_DLG_TRIGGER_POSITION", + "text": "触发位置: " + }, + { + "id": "IDS_DLG_TOTAL_TRIGGER_STAGES", + "text": "总触发等级: " + }, + { + "id": "IDS_DLG_START_FLAG", + "text": "开始标志: " + }, + { + "id": "IDS_DLG_STOP_FLAG", + "text": "停止标志: " + }, + { + "id": "IDS_DLG_CLOCK_FLAG", + "text": "时钟标志: " + }, + { + "id": "IDS_DLG_DATA_CHANNEL", + "text": "数据通道: " + }, + { + "id": "IDS_DLG_DATA_VALUE", + "text": "数据值: " + }, + { + "id": "IDS_DLG_SERIAL_TRIGGER", + "text": "串行触发" + }, + { + "id": "IDS_DLG_STAGE_TRIGGER", + "text": "多级触发" + }, + { + "id": "IDS_DLG_SERIAL_NOTE_LABEL", + "text": "X: 不关心\n0: 低电平\n1: 高电平\nR: 上升沿\nF: 下降沿\nC: 上升/下降沿" + }, + { + "id": "IDS_DLG_DATA_BITS", + "text": "数据位" + }, + { + "id": "IDS_DLG_INV", + "text": "Inv" + }, + { + "id": "IDS_DLG_COUNTER", + "text": "计数" + }, + { + "id": "IDS_DLG_CONTIGUOUS", + "text": "连续" + }, + { + "id": "IDS_DLG_STAGE", + "text": "等级" + }, + { + "id": "IDS_DLG_OR", + "text": "Or" + }, + { + "id": "IDS_DLG_AND", + "text": "And" + }, + { + "id": "IDS_DLG_HZ", + "text": "Hz" + }, + { + "id": "IDS_DLG_UNSHOWN", + "text": "未显示" + }, + { + "id": "ZOOM_IN_FOR_DETAILS", + "text": "放大查看详细信息" + }, + { + "id": "IDS_DLG_DECODETRACE_ERROR1", + "text": "错误: " + }, + { + "id": "IDS_DLG_DECODETRACE_ERROR2", + "text": "错误: ..." + }, + { + "id": "IDS_DLG_ADD_GROUP", + "text": "添加组" + }, + { + "id": "IDS_DLG_DEL_GROUP", + "text": "删除组" + }, + { + "id": "IDS_DLG_SET_CHANNEL_COLOUR", + "text": "设置通道颜色" + }, + { + "id": "IDS_DLG_LISSAJOUS_FIGURE", + "text": "李萨如图" + }, + { + "id": "IDS_DLG_DATA_SOURCE_ERROR", + "text": "数据源错误." + }, + { + "id": "IDS_DLG_ADD_X_CURSOR", + "text": "添加X光标" + }, + { + "id": "IDS_DLG_ADD_Y_CURSOR", + "text": "添加Y轴光标" + }, + { + "id": "IDS_DLG_AUTO_ROLL", + "text": "自动(Roll)" + }, + { + "id": "IDS_DLG_WAITING_TRIG", + "text": "等待触发" + }, + { + "id": "IDS_DLG_TRIG_D", + "text": "Trig'd" + }, + { + "id": "IDS_DLG_TRIGGERED", + "text": "触发! " + }, + { + "id": "IDS_DLG_CAPTURED", + "text": "% 捕获" + }, + { + "id": "IDS_DLG_WAITING_FOR_TRIGGER", + "text": "等待触发! " + }, + { + "id": "IDS_DLG_RISING", + "text": "上升沿: " + }, + { + "id": "IDS_DLG_FALLING", + "text": "下降沿: " + }, + { + "id": "IDS_DLG_Edges_1", + "text": "边沿: " + }, + { + "id": "IDS_DLG_WIDTH", + "text": "宽度: " + }, + { + "id": "IDS_DLG_PERIOD", + "text": "周期: " + }, + { + "id": "IDS_DLG_FREQUENCY", + "text": "频率: " + }, + { + "id": "IDS_DLG_DUTY_CYCLE", + "text": "占空比: " + }, + { + "id": "IDS_DLG_MEASURE", + "text": "测量" + }, + { + "id": "IDS_DLG_TRIGGER_TIME", + "text": "触发时间: " + }, + { + "id": "IDS_DLG_SAMPLES_CAPTURED", + "text": "捕获样本!" } ] \ No newline at end of file diff --git a/lang/cn/msg.json b/lang/cn/msg.json index 6e666ec6..5762f4e2 100644 --- a/lang/cn/msg.json +++ b/lang/cn/msg.json @@ -1,4 +1,35 @@ [ + { + "id": "IDS_MSG_OK", + "text": "确定" + }, + { + "id": "IDS_MSG_SKIP", + "text": "跳过" + }, + { + "id": "IDS_MSG_CANCEL", + "text": "取消" + },{ + "id": "IDS_MSG_ATTENTION", + "text": "注意" + }, + { + "id": "IDS_MSG_ERROR", + "text": "错误" + }, + { + "id": "IDS_MSG_INFORMATION", + "text": "消息" + }, + { + "id": "IDS_MSG_CONTINUE", + "text": "继续" + }, + { + "id": "IDS_MSG_A_CAL_START", + "text": "自动校准程序将启动。不要连接任何探头。这可能需要一段时间!" + }, { "id": "IDS_MSG_A_CAL", "text": "自动校准" @@ -7,24 +38,313 @@ "id": "IDS_MSG_ADJUST_SAVE", "text": "请调整零偏差并保存结果" }, - { - "id": "IDS_MSG_OK", - "text": "好" - }, - { - "id": "IDS_MSG_SKIP", - "text": "跳过" - }, - { - "id": "IDS_MSG_A_CAL_START", - "text": "自动校准程序将启动。不要连接任何探头。这可能需要一段时间!" - }, { "id": "IDS_MSG_SAVE_CAPDATE", - "text": "是否保存捕获的数据?" + "text": "保存捕获的数据?" }, { "id": "IDS_MSG_SAVE_CANFIND_SESSIONFILE", - "text": "找不到此设备的默认会话文件!" + "text": "找不到此设备的默认会话文件!" + }, + { + "id": "IDS_MSG_OPEN_FILE_ERROR", + "text": "打开文件错误!" + }, + { + "id": "IDS_MSG_NOT_COMPATIBLE", + "text": "会话文件与当前设备或模式不兼容!" + }, + { + "id": "IDS_MSG_RE_WIN_ST_ER", + "text": " 还原窗口状态错误!" + }, + { + "id": "IDS_MSG_INVAILD_CURSOR", + "text": " 样本范围的游标索引无效!" + }, + { + "id": "IDS_MSG_SEL_FILENAME", + "text": "您需要选择文件名" + }, + { + "id": "IDS_MSG_PROTOCOL_REPEAT", + "text": "存在重复id或名字的协议:" + }, + { + "id": "IDS_MSG_NO_PROTOCOL", + "text": "协议列表为空!" + }, + { + "id": "IDS_MSG_NO_SEL_PROTOCOL", + "text": "请选择一个协议!" + }, + { + "id": "IDS_MSG_FIND_BASE_PROTOCOL_ERROR", + "text": "查找基本协议错误!" + }, + { + "id": "IDS_MSG_NO_PROTOCOL_DEL", + "text": "没有要删除的协议分析器!" + }, + { + "id": "IDS_MSG_PROTOCOL_COMFRIEM_DEL_ALL", + "text": "是否确定要删除所有协议分析器?" + }, + { + "id": "IDS_MSG_PROTOCOL_COMFRIEM_DEL", + "text": "是否确定要删除这个协议分析器?" + }, + { + "id": "IDS_MSG_CLOSE_DEVICE", + "text": "是否确定关闭这个设备?" + }, + { + "id": "IDS_MSG_SET_DEF_CAL_SETTING", + "text": "所有校准设置将成为默认值!" + }, + { + "id": "IDS_MSG_ALL_CHANNEL_DISABLE", + "text": " 所有频道已禁用请至少启用一个通道" + }, + { + "id": "IDS_MSG_MAX_CHANNEL", + "text": "当前模式仅支持最大" + }, + { + "id": "IDS_MSG_CHANNEL", + "text": " 频道数!" + }, + { + "id": "IDS_MSG_TRI_SET_ISSUE", + "text": "触发设置问题" + }, + { + "id": "IDS_MSG_CHANGE_HOR_TRI_POS_FAIL", + "text": "更改水平触发器位置失败!" + }, + { + "id": "IDS_MSG_CHANGE_TRI_HOLDOFF_TIME_FAIL", + "text": "更改触发器保持时间失败!" + }, + { + "id": "IDS_MSG_CHANGE_SENSITIVITY_FAIL", + "text": "更改触发值灵敏度失败!" + }, + { + "id": "IDS_MSG_CHANGE_SOURCE_FAIL", + "text": " 更改触发源失败!" + }, + { + "id": "IDS_MSG_CHANGE_CHANNEL_FAIL", + "text": "更改触发器通道失败!" + }, + { + "id": "IDS_MSG_CHANGE_TYPE_FAIL", + "text": "更改触发器类型失败!" + }, + { + "id": "IDS_MSG_PLEASE_INSERT_CURSOR", + "text": "请在使用光标测量之前插入光标." + }, + { + "id": "IDS_MSG_SEARCH", + "text": "查找" + }, + { + "id": "IDS_MSG_NO_SAMPLE_DATA", + "text": "无样本数据!" + }, + { + "id": "IDS_MSG_SEARCH_AT_START", + "text": "在起始位置搜索光标!" + }, + { + "id": "IDS_MSG_PATTERN_NOT_FOUND", + "text": "找不到样式!" + }, + { + "id": "IDS_MSG_SEARCH_AT_END", + "text": "在结束位置搜索光标!" + }, + { + "id": "IDS_MSG_TRIGGER", + "text": "触发" + }, + { + "id": "IDS_MSG_STREAM_NO_AD_TRIGGER", + "text": "流模式不支持高级触发模式!" + }, + { + "id": "IDS_MSG_AD_TRIGGER_NEED_HARDWARE", + "text": " 高级触发模式需要DSLogic硬件支持!" + }, + { + "id": "IDS_MSG_SET_TRI_MULTI_CHANNEL", + "text": "触发设置在多个通道上!\n仅当所有设置的通道在一个样本中满足触发条件时才会触发" + }, + { + "id": "IDS_MSG_NOT_SHOW_AGAIN", + "text": "不再显示" + }, + { + "id": "IDS_MSG_CLEAR_TRIG", + "text": "清除触发" + }, + { + "id": "IDS_MSG_IGNORE", + "text": "忽略" + }, + { + "id": "IDS_MSG_OPEN", + "text": "打开" + }, + { + "id": "IDS_MSG_FAIL_TO_LOAD", + "text": "加载失败" + }, + + { + "id": "IDS_MSG_HARDWARE_ERROR", + "text": "硬件操作失败" + }, + { + "id": "IDS_MSG_HARDWARE_ERROR_DET", + "text": "请重新插入设备以刷新硬件配置!" + }, + { + "id": "IDS_MSG_MALLOC_ERROR", + "text": "动态内存分配错误" + }, + { + "id": "IDS_MSG_MALLOC_ERROR_DET", + "text": " 内存不足,无法容纳此样本!\n请降低采样深度!" + }, + { + "id": "IDS_DATA_ERROR", + "text": "数据错误" + }, + { + "id": "IDS_DATA_ERROR_DET1", + "text": " 接收的数据与预定义的测试数据不一致!" + }, + { + "id": "IDS_DATA_ERROR_DET2", + "text": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" + }, + { + "id": "IDS_MSG_PACKET_ERROR", + "text": "数据包错误" + }, + { + "id": "IDS_MSG_PACKET_ERROR_DET", + "text": " 接收到的数据包的内容不是预期的 !" + }, + { + "id": "IDS_MSG_DATA_OVERFLOW", + "text": "数据溢出" + }, + { + "id": "IDS_MSG_DATA_OVERFLOW_DET", + "text": " USB带宽无法支持当前采样率 ! \n请降低采样深度!" + }, + { + "id": "IDS_MSG_UNDEFINED_ERROR", + "text": "未定义错误" + }, + { + "id": "IDS_MSG_UNDEFINED_ERROR_DET", + "text": "意外错误!" + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR1", + "text": " DSView当前不支持\n多数据类型的文件保存." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR2", + "text": "没有要保存的数据." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR3", + "text": "没有文件名." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR4", + "text": " 生成临时文件数据失败." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR5", + "text": "生成解码文件数据失败." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR6", + "text": "生成会话文件数据失败." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR7", + "text": "生成zip文件失败." + }, + { + "id": "IDS_MSG_STORESESS_SAVEPROC_ERROR1", + "text": "无法创建zip文件.内存分配错误." + }, + { + "id": "IDS_MSG_STORESESS_SAVEPROC_ERROR2", + "text": "无法创建zip文件.请检查此路径的写入权限." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR1", + "text": "DSView当前不支持\n多数据类型的文件导出." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR2", + "text": "没有要保存的数据." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR3", + "text": "没有设置文件名." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR4", + "text": "导出格式无效." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR1", + "text": "不支持的数据类型." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR2", + "text": "缓冲区内存分配失败." + }, + { + "id": "IDS_MSG_SAVE_FILE", + "text": "保存文件" + }, + { + "id": "IDS_MSG_EXPORT_DATA", + "text": "导出数据" + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR2", + "text": "缓冲区内存分配失败." + }, + { + "id": "IDS_MSG_EXPORT_DATA", + "text": "导出文件" + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR", + "text": "n尚未指定一个或多个 \n所需通道" + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_DATA_ERROR", + "text": "至少有一个选定通道未启用." + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_STACK_ERROR", + "text": "未能创建解码实例" + }, + { + "id": "IDS_MSG_MESSAGE", + "text": "消息" } ] \ No newline at end of file diff --git a/lang/en/dlg.json b/lang/en/dlg.json index 84372361..ddb7cad2 100644 --- a/lang/en/dlg.json +++ b/lang/en/dlg.json @@ -22,5 +22,625 @@ { "id": "IDS_DLG_SAVE_SEESION", "text": "Save Session" + }, + { + "id": "IDS_DLG_DOCUMENT", + "text": "Document" + }, + { + "id": "IDS_DLG_TRIGGER_DOCK_TITLE", + "text": "Trigger Setting..." + }, + { + "id": "IDS_DLG_PROTOCOL_DOCK_TITLE", + "text": "Protocol" + }, + { + "id": "IDS_DLG_MEASURE_DOCK_TITLE", + "text": "Measurement" + }, + { + "id": "IDS_DLG_SEARCH_DOCK_TITLE", + "text": "Search..." + }, + { + "id": "IDS_DLG_SAVE_AS", + "text": "Save As" + }, + { + "id": "IDS_DLG_CHECK_USB_SPEED_ERROR", + "text": "Plug it into a USB 2.0 port will seriously affect its performance.\n Please replug it into a USB 3.0 port." + }, + { + "id": "IDS_DLG_CHECK_SESSION_FILE_VERSION_ERROR", + "text": "Current loading file has an old format. \nThis will lead to a slow loading speed. \nPlease resave it after loaded." + }, + { + "id": "IDS_DLG_ABOUT", + "text": "About" + }, + { + "id": "IDS_DLG_DISPLAY_OPTIONS", + "text": "Display options" + }, + { + "id": "IDS_DLG_QUICK_SCROLL", + "text": "Quick scroll" + }, + { + "id": "IDS_DLG_SAVE", + "text": "Save" + }, + { + "id": "IDS_DLG_RESET", + "text": "Reset" + }, + { + "id": "IDS_DLG_EXIT", + "text": "Exit" + }, + { + "id": "IDS_DLG_MANUAL_CALIBRATION", + "text": "Manual Calibration" + }, + { + "id": "IDS_DLG_CHANNEL", + "text": "Channel" + }, + { + "id": "IDS_DLG_SAVE_CALIBRATION_RESULTS", + "text": "Save calibration results... It can take a while." + }, + { + "id": "IDS_DLG_CANCEL", + "text": "Cancel" + }, + { + "id": "IDS_DLG_RELOAD_CALIBRATION_RESULTS", + "text": "Reload last calibration results... It can take a while." + }, + { + "id": "IDS_DLG_DECODER_OPTIONS", + "text": "Decoder Options" + }, + { + "id": "IDS_DLG_CURSOR", + "text": "Cursor " + }, + { + "id": "IDS_DLG_CURSOR_FOR_DECODE_START", + "text": "The cursor for decode start time" + }, + { + "id": "IDS_DLG_CURSOR_FOR_DECODE_END", + "text": "The cursor for decode end time" + }, + { + "id": "IDS_DLG_DEVICE_OPTIONS", + "text": "Device Options" + }, + { + "id": "IDS_DLG_MODE", + "text": "Mode" + }, + { + "id": "IDS_DLG_OPERATION_MODE", + "text": "Operation Mode" + }, + { + "id": "IDS_DLG_ENABLE_ALL", + "text": "Enable All" + }, + { + "id": "IDS_DLG_DISABLE_ALL", + "text": "Disable All" + }, + { + "id": "IDS_DLG_ENABLE", + "text": "Enable: " + }, + { + "id": "IDS_DLG_AUTO_CALIBRATION", + "text": "Auto Calibration" + }, + { + "id": "IDS_DLG_CALIBRATION", + "text": "Calibration" + }, + { + "id": "IDS_DLG_MEASUREMENTS", + "text": "Measurements" + }, + { + "id": "IDS_DLG_FFT_ENABLE", + "text": "FFT Enable: " + }, + { + "id": "IDS_DLG_FFT_LENGTH", + "text": "FFT Length: " + }, + { + "id": "IDS_DLG_SAMPLE_INTERVAL", + "text": "Sample Interval: " + }, + { + "id": "IDS_DLG_FFT_SOURCE", + "text": "FFT Source: " + }, + { + "id": "IDS_DLG_FFT_WINDOW", + "text": "FFT Window: " + }, + { + "id": "IDS_DLG_DC_IGNORED", + "text": "DC Ignored: " + }, + { + "id": "IDS_DLG_Y-AXIS_MODE", + "text": "Y-axis Mode: " + }, + { + "id": "IDS_DLG_DBV_RANGE", + "text": "DBV Range: " + }, + { + "id": "IDS_DLG_FFT_OPTIONS", + "text": "FFT Options" + }, + { + "id": "IDS_DLG_INTERVAL_S", + "text": "Interval(s): " + }, + { + "id": "IDS_DLG_REPETITIVE_INTERVAL", + "text": "Repetitive Interval" + }, + { + "id": "IDS_DLG_X_AXIS", + "text": "X-axis" + }, + { + "id": "IDS_DLG_Y_AXIS", + "text": "Y-axis" + }, + { + "id": "IDS_DLG_LISSAJOUS_OPTIONS", + "text": "Lissajous Options" + }, + { + "id": "IDS_DLG_ADD", + "text": "Add" + }, + { + "id": "IDS_DLG_SUBSTRACT", + "text": "Substract" + }, + { + "id": "IDS_DLG_MULTIPLY", + "text": "Multiply" + }, + { + "id": "IDS_DLG_DIVIDE", + "text": "Divide" + }, + { + "id": "IDS_DLG_MATH_TYPE", + "text": "Math Type" + }, + { + "id": "IDS_DLG_1ST_SOURCE", + "text": "1st Source" + }, + { + "id": "IDS_DLG_2ST_SOURCE", + "text": "2nd Source" + }, + { + "id": "IDS_DLG_MATH_OPTIONS", + "text": "Math Options" + }, + { + "id": "IDS_DLG_EXPORT_FORMAT", + "text": "Export Format: " + }, + { + "id": "IDS_DLG_PROTOCOL_EXPORT", + "text": "Protocol Export" + }, + { + "id": "IDS_DLG_EXPORT_DATA", + "text": "Export Data: " + }, + { + "id": "IDS_DLG_EXPORT_PROTOCOL_LIST_RESULT", + "text": "Export Protocol List Result... It can take a while." + }, + { + "id": "IDS_DLG_FIT_TO_WINDOW", + "text": "Fit to Window" + }, + { + "id": "IDS_DLG_FIXED", + "text": "Fixed" + }, + { + "id": "IDS_DLG_MAP_ZOOM", + "text": "Map Zoom: " + }, + { + "id": "IDS_DLG_DECODED_PROTOCOLS", + "text": "Decoded Protocols: " + }, + { + "id": "IDS_DLG_PROTOCOL_LIST_VIEWER", + "text": "Protocol List Viewer" + }, + { + "id": "IDS_DLG_REGION", + "text": "Region" + }, + { + "id": "IDS_DLG_SEARCH_LABEL", + "text": "X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge" + }, + { + "id": "IDS_DLG_SEARCH_OPTIONS", + "text": "Search Options" + }, + { + "id": "IDS_DLG_CHANGE", + "text": "change" + }, + { + "id": "IDS_DLG_SAVING", + "text": "Saving..." + }, + { + "id": "IDS_DLG_ORIGINAL_DATA", + "text": "Original data" + }, + { + "id": "IDS_DLG_COMPRESSED_DATA", + "text": "Compressed data" + }, + { + "id": "IDS_DLG_EXPORTING", + "text": "Exporting..." + }, + { + "id": "IDS_DLG_DONT_CONNECT_PROBES", + "text": "Don't connect any probes!" + }, + { + "id": "IDS_DLG_LOAD_CURRENT_SETTING", + "text": "Load current setting... It can take a while." + }, + { + "id": "IDS_DLG_WAITING", + "text": "Waiting" + }, + { + "id": "IDS_DLG_FINISHED", + "text": "Finished!" + }, + { + "id": "IDS_DLG_US", + "text": "uS" + }, + { + "id": "IDS_DLG_MS", + "text": "mS" + }, + { + "id": "IDS_DLG_S", + "text": "S" + }, + { + "id": "IDS_DLG_TRIGGER_POSITION", + "text": "Trigger Position: " + }, + { + "id": "IDS_DLG_HOLD_OFF_TIME", + "text": "Hold Off Time: " + }, + { + "id": "IDS_DLG_NOISE_SENSITIVITY", + "text": "Noise Sensitivity: " + }, + { + "id": "IDS_DLG_TRIGGER_SOURCES", + "text": "Trigger Sources: " + }, + { + "id": "IDS_DLG_TRIGGER_TYPES", + "text": "Trigger Types: " + }, + { + "id": "IDS_DLG_RISING_EDGE", + "text": "Rising Edge" + }, + { + "id": "IDS_DLG_FALLING_EDGE", + "text": "Falling Edge" + }, + { + "id": "IDS_DLG_AUTO", + "text": "Auto" + }, + { + "id": "IDS_DLG_CHANNEL_0", + "text": "Channel 0" + }, + { + "id": "IDS_DLG_CHANNEL_1", + "text": "Channel 1" + }, + { + "id": "IDS_DLG_CHANNEL_0_AND_1", + "text": "Channel 0 && 1" + }, + { + "id": "IDS_DLG_CHANNEL_0_OR_1", + "text": "Channel 0 | 1" + }, + { + "id": "IDS_DLG_KEYWORD_LINEEID", + "text": "Protocol search..." + }, + { + "id": "IDS_DLG_TIME_SAMPLES", + "text": "Time/Samples" + }, + { + "id": "IDS_DLG_MOUSE_MEASUREMENT", + "text": "Mouse measurement" + }, + { + "id": "IDS_DLG_ENABLE_FLOATING_MEASUREMENT", + "text": "Enable floating measurement" + }, + { + "id": "IDS_DLG_CURSOR_DISTANCE", + "text": "Cursor Distance" + }, + { + "id": "IDS_DLG_EDGES", + "text": "Edges" + }, + { + "id": "IDS_DLG_CURSORS", + "text": "Cursors" + }, + { + "id": "IDS_DLG_RIS_OR_FAL_EDGE", + "text": "Rising/Falling/Edges" + }, + { + "id": "IDS_DLG_W", + "text": "W: " + }, + { + "id": "IDS_DLG_P", + "text": "P: " + }, + { + "id": "IDS_DLG_F", + "text": "F: " + }, + { + "id": "IDS_DLG_D", + "text": "D: " + }, + { + "id": "IDS_DLG_SEARCH", + "text": "search" + }, + { + "id": "IDS_DLG_MATCHING_ITEMS", + "text": "Matching Items:" + }, + { + "id": "IDS_DLG_OUT_OF_MEMORY", + "text": "Out of Memory" + }, + { + "id": "IDS_DLG_SEARCHING", + "text": "Searching..." + }, + { + "id": "IDS_DLG_SEARCH_PREVIOUS", + "text": "Search Previous..." + }, + { + "id": "IDS_DLG_SEARCH_NEXT", + "text": "Search Next..." + }, + { + "id": "IDS_DLG_SIMPLE_TRIGGER", + "text": "Simple Trigger" + }, + { + "id": "IDS_DLG_ADVANCED_TRIGGER", + "text": "Advanced Trigger" + }, + { + "id": "IDS_DLG_TRIGGER_POSITION", + "text": "Trigger Position: " + }, + { + "id": "IDS_DLG_TOTAL_TRIGGER_STAGES", + "text": "Total Trigger Stages: " + }, + { + "id": "IDS_DLG_START_FLAG", + "text": "Start Flag: " + }, + { + "id": "IDS_DLG_STOP_FLAG", + "text": "Stop Flag: " + }, + { + "id": "IDS_DLG_CLOCK_FLAG", + "text": "Clock Flag: " + }, + { + "id": "IDS_DLG_DATA_CHANNEL", + "text": "Data Channel: " + }, + { + "id": "IDS_DLG_DATA_VALUE", + "text": "Data Value: " + }, + { + "id": "IDS_DLG_SERIAL_TRIGGER", + "text": "Serial Trigger" + }, + { + "id": "IDS_DLG_STAGE_TRIGGER", + "text": "Stage Trigger" + }, + { + "id": "IDS_DLG_SERIAL_NOTE_LABEL", + "text": "X: Don't care\n0: Low level\n1: High level\nR: Rising edge\nF: Falling edge\nC: Rising/Falling edge" + }, + { + "id": "IDS_DLG_DATA_BITS", + "text": "Data Bits" + }, + { + "id": "IDS_DLG_INV", + "text": "Inv" + }, + { + "id": "IDS_DLG_COUNTER", + "text": "Counter" + }, + { + "id": "IDS_DLG_CONTIGUOUS", + "text": "Contiguous" + }, + { + "id": "IDS_DLG_STAGE", + "text": "Stage" + }, + { + "id": "IDS_DLG_OR", + "text": "Or" + }, + { + "id": "IDS_DLG_AND", + "text": "And" + }, + { + "id": "IDS_DLG_HZ", + "text": "Hz" + }, + { + "id": "IDS_DLG_UNSHOWN", + "text": "Unshown" + }, + { + "id": "ZOOM_IN_FOR_DETAILS", + "text": "Zoom in for details" + }, + { + "id": "IDS_DLG_DECODETRACE_ERROR1", + "text": "Error: " + }, + { + "id": "IDS_DLG_DECODETRACE_ERROR2", + "text": "Error: ..." + }, + { + "id": "IDS_DLG_ADD_GROUP", + "text": "Add Group" + }, + { + "id": "IDS_DLG_DEL_GROUP", + "text": "Del Group" + }, + { + "id": "IDS_DLG_SET_CHANNEL_COLOUR", + "text": "Set Channel Colour" + }, + { + "id": "IDS_DLG_LISSAJOUS_FIGURE", + "text": "Lissajous Figure" + }, + { + "id": "IDS_DLG_DATA_SOURCE_ERROR", + "text": "Data source error." + }, + { + "id": "IDS_DLG_ADD_X_CURSOR", + "text": "Add X-cursor" + }, + { + "id": "IDS_DLG_ADD_Y_CURSOR", + "text": "Add Y-cursor" + }, + { + "id": "IDS_DLG_AUTO_ROLL", + "text": "Auto(Roll)" + }, + { + "id": "IDS_DLG_WAITING_TRIG", + "text": "Waiting Trig" + }, + { + "id": "IDS_DLG_TRIG_D", + "text": "Trig'd" + }, + { + "id": "IDS_DLG_TRIGGERED", + "text": "Triggered! " + }, + { + "id": "IDS_DLG_CAPTURED", + "text": "% Captured" + }, + { + "id": "IDS_DLG_WAITING_FOR_TRIGGER", + "text": "Waiting for Trigger! " + }, + { + "id": "IDS_DLG_RISING", + "text": "Rising: " + }, + { + "id": "IDS_DLG_FALLING", + "text": "Falling: " + }, + { + "id": "IDS_DLG_Edges_1", + "text": "Edges: " + }, + { + "id": "IDS_DLG_WIDTH", + "text": "Width: " + }, + { + "id": "IDS_DLG_PERIOD", + "text": "Period: " + }, + { + "id": "IDS_DLG_FREQUENCY", + "text": "Frequency: " + }, + { + "id": "IDS_DLG_DUTY_CYCLE", + "text": "Duty Cycle: " + }, + { + "id": "IDS_DLG_MEASURE", + "text": "Measure" + }, + { + "id": "IDS_DLG_TRIGGER_TIME", + "text": "Trigger Time: " + }, + { + "id": "IDS_DLG_SAMPLES_CAPTURED", + "text": "Samples Captured!" } ] \ No newline at end of file diff --git a/lang/en/msg.json b/lang/en/msg.json index ef92fbd0..ae88d59b 100644 --- a/lang/en/msg.json +++ b/lang/en/msg.json @@ -1,12 +1,4 @@ [ - { - "id": "IDS_MSG_A_CAL", - "text": "Auto Calibration" - }, - { - "id": "IDS_MSG_ADJUST_SAVE", - "text": "Please adjust zero skew and save the result" - }, { "id": "IDS_MSG_OK", "text": "Ok" @@ -15,10 +7,38 @@ "id": "IDS_MSG_SKIP", "text": "Skip" }, + { + "id": "IDS_MSG_CANCEL", + "text": "Cancel" + }, + { + "id": "IDS_MSG_ATTENTION", + "text": "Attention" + }, + { + "id": "IDS_MSG_ERROR", + "text": "error" + }, + { + "id": "IDS_MSG_INFORMATION", + "text": "Information" + }, + { + "id": "IDS_MSG_CONTINUE", + "text": "Continue" + }, { "id": "IDS_MSG_A_CAL_START", "text": "Auto Calibration program will be started. Don't connect any probes. It can take a while!" }, + { + "id": "IDS_MSG_A_CAL", + "text": "Auto Calibration" + }, + { + "id": "IDS_MSG_ADJUST_SAVE", + "text": "Please adjust zero skew and save the result" + }, { "id": "IDS_MSG_SAVE_CAPDATE", "text": "Save captured data?" @@ -26,5 +46,306 @@ { "id": "IDS_MSG_SAVE_CANFIND_SESSIONFILE", "text": "Cannot find default session file for this device!" + }, + { + "id": "IDS_MSG_OPEN_FILE_ERROR", + "text": "Open file error!" + }, + { + "id": "IDS_MSG_NOT_COMPATIBLE", + "text": "Session File is not compatible with current device or mode!" + }, + { + "id": "IDS_MSG_RE_WIN_ST_ER", + "text": "restore window status error!" + }, + { + "id": "IDS_MSG_INVAILD_CURSOR", + "text": "Invalid cursor index for sample range!" + }, + { + "id": "IDS_MSG_SEL_FILENAME", + "text": "You need to select a file name." + }, + { + "id": "IDS_MSG_PROTOCOL_REPEAT", + "text": "Any protocol have repeated id or name:" + }, + { + "id": "IDS_MSG_NO_PROTOCOL", + "text": "Protocol list is empty!" + }, + { + "id": "IDS_MSG_NO_SEL_PROTOCOL", + "text": "Please select a protocol!" + }, + { + "id": "IDS_MSG_FIND_BASE_PROTOCOL_ERROR", + "text": "find the base protocol error!" + }, + { + "id": "IDS_MSG_NO_PROTOCOL_DEL", + "text": "No Protocol Analyzer to delete!" + }, + { + "id": "IDS_MSG_PROTOCOL_COMFRIEM_DEL_ALL", + "text": "Are you sure to remove all protocol analyzer?" + }, + { + "id": "IDS_MSG_PROTOCOL_COMFRIEM_DEL", + "text": "Are you sure to remove this protocol analyzer?" + }, + { + "id": "IDS_MSG_CLOSE_DEVICE", + "text": "Are you sure to close the device?" + }, + { + "id": "IDS_MSG_SET_DEF_CAL_SETTING", + "text": "All calibration settings will become the defualt values!" + }, + { + "id": "IDS_MSG_ALL_CHANNEL_DISABLE", + "text": "All channel disabled! Please enable at least one channel." + }, + { + "id": "IDS_MSG_MAX_CHANNEL", + "text": "Current mode only suppport max " + }, + { + "id": "IDS_MSG_CHANNEL", + "text": " channels!" + }, + { + "id": "IDS_MSG_TRI_SET_ISSUE", + "text": "Trigger Setting Issue" + }, + { + "id": "IDS_MSG_CHANGE_HOR_TRI_POS_FAIL", + "text": "Change horiz trigger position failed!" + }, + { + "id": "IDS_MSG_CHANGE_TRI_HOLDOFF_TIME_FAIL", + "text": "Change trigger hold off time failed!" + }, + { + "id": "IDS_MSG_CHANGE_SENSITIVITY_FAIL", + "text": "Change trigger value sensitivity failed!" + }, + { + "id": "IDS_MSG_CHANGE_SOURCE_FAIL", + "text": "Change trigger source failed!" + }, + { + "id": "IDS_MSG_CHANGE_CHANNEL_FAIL", + "text": "Change trigger channel failed!" + }, + { + "id": "IDS_MSG_CHANGE_TYPE_FAIL", + "text": "Change trigger type failed!" + }, + { + "id": "IDS_MSG_PLEASE_INSERT_CURSOR", + "text": "Please insert cursor before using cursor measure." + }, + { + "id": "IDS_MSG_SEARCH", + "text": "Search" + }, + { + "id": "IDS_MSG_NO_SAMPLE_DATA", + "text": "No Sample data!" + }, + { + "id": "IDS_MSG_SEARCH_AT_START", + "text": "Search cursor at the start position!" + }, + { + "id": "IDS_MSG_PATTERN_NOT_FOUND", + "text": "Pattern not found!" + }, + { + "id": "IDS_MSG_SEARCH_AT_END", + "text": "Search cursor at the end position!" + }, + { + "id": "IDS_MSG_TRIGGER", + "text": "Trigger" + }, + { + "id": "IDS_MSG_STREAM_NO_AD_TRIGGER", + "text": "Stream Mode Don't Support Advanced Trigger!" + }, + { + "id": "IDS_MSG_AD_TRIGGER_NEED_HARDWARE", + "text": "Advanced Trigger need DSLogic Hardware Support!" + }, + { + "id": "IDS_MSG_SET_TRI_MULTI_CHANNEL", + "text": "Trigger setted on multiple channels!\nCapture will Only triggered when all setted channels fullfill at one sample" + }, + { + "id": "IDS_MSG_NOT_SHOW_AGAIN", + "text": "Not Show Again" + }, + { + "id": "IDS_MSG_CLEAR_TRIG", + "text": "Clear Trig" + }, + { + "id": "IDS_MSG_IGNORE", + "text": "Ignore" + }, + { + "id": "IDS_MSG_OPEN", + "text": "Open" + }, + { + "id": "IDS_MSG_FAIL_TO_LOAD", + "text": "Failed to load " + }, + + { + "id": "IDS_MSG_HARDWARE_ERROR", + "text": "Hardware Operation Failed" + }, + { + "id": "IDS_MSG_HARDWARE_ERROR_DET", + "text": "Please replug device to refresh hardware configuration!" + }, + { + "id": "IDS_MSG_MALLOC_ERROR", + "text": "Malloc Error" + }, + { + "id": "IDS_MSG_MALLOC_ERROR_DET", + "text": "Memory is not enough for this sample!\nPlease reduce the sample depth!" + }, + { + "id": "IDS_DATA_ERROR", + "text": "Data Error" + }, + { + "id": "IDS_DATA_ERROR_DET1", + "text": "the received data are not consist with pre-defined test data!" + }, + { + "id": "IDS_DATA_ERROR_DET2", + "text": "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" + }, + { + "id": "IDS_MSG_PACKET_ERROR", + "text": "Packet Error" + }, + { + "id": "IDS_MSG_PACKET_ERROR_DET", + "text": "the content of received packet are not expected!" + }, + { + "id": "IDS_MSG_DATA_OVERFLOW", + "text": "Data Overflow" + }, + { + "id": "IDS_MSG_DATA_OVERFLOW_DET", + "text": "USB bandwidth can not support current sample rate! \nPlease reduce the sample rate!" + }, + { + "id": "IDS_MSG_UNDEFINED_ERROR", + "text": "Undefined Error" + }, + { + "id": "IDS_MSG_UNDEFINED_ERROR_DET", + "text": "Not expected error!" + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR1", + "text": "DSView does not currently support\nfile saving for multiple data types." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR2", + "text": "No data to save." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR3", + "text": "No file name." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR4", + "text": "Generate temp file data failed." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR5", + "text": "Generate decoder file data failed." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR6", + "text": "Generate session file data failed." + }, + { + "id": "IDS_MSG_STORESESS_SAVESTART_ERROR7", + "text": "Generate zip file failed." + }, + { + "id": "IDS_MSG_STORESESS_SAVEPROC_ERROR1", + "text": "Failed to create zip file. Malloc error." + }, + { + "id": "IDS_MSG_STORESESS_SAVEPROC_ERROR2", + "text": "Failed to create zip file. Please check write permission of this path." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR1", + "text": "DSView does not currently support\nfile export for multiple data types." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR2", + "text": "No data to save." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR3", + "text": "No set file name." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTSTART_ERROR4", + "text": "Invalid export format." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR1", + "text": "data type don't support." + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR2", + "text": "xbuffer malloc failed." + }, + { + "id": "IDS_MSG_SAVE_FILE", + "text": "Save File" + }, + { + "id": "IDS_MSG_EXPORT_DATA", + "text": "Export Data" + }, + { + "id": "IDS_MSG_STORESESS_EXPORTPROC_ERROR2", + "text": "xbuffer malloc failed." + }, + { + "id": "IDS_MSG_EXPORT_DATA", + "text": "Export Data" + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_WORK_ERROR", + "text": "One or more required channels \nhave not been specified" + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_DATA_ERROR", + "text": "At least one of selected channels are not enabled." + }, + { + "id": "IDS_MSG_DECODERSTACK_DECODE_STACK_ERROR", + "text": "Failed to create decoder instance" + }, + { + "id": "IDS_MSG_MESSAGE", + "text": "Message" } ] \ No newline at end of file