diff --git a/InterSpec_resources/app_text/HelpSystem.xml b/InterSpec_resources/app_text/HelpSystem.xml index 89652a70..6fbec5b6 100644 --- a/InterSpec_resources/app_text/HelpSystem.xml +++ b/InterSpec_resources/app_text/HelpSystem.xml @@ -6,4 +6,5 @@ Tutorials and usage hints Help Page Not Found Could not open help JSON file at '{1}'. + Search \ No newline at end of file diff --git a/InterSpec_resources/app_text/README.md b/InterSpec_resources/app_text/README.md index 16a531ae..c70b1a74 100644 --- a/InterSpec_resources/app_text/README.md +++ b/InterSpec_resources/app_text/README.md @@ -39,9 +39,9 @@ To add a language, you do not need to translate all elements in an XML file, or At a minimum, you must add a version of `InterSpec.xml` for the new language - preferably translating all elements, but this isn't required. In the InterSpec app, the available languages (Help → Languages →) are populated according to which `InterSpec_xx-YY.xml` files are present. -But in addition `InterSpec.xml` to You really should, at a minimum, modify: +But in addition `InterSpec.xml` to you really should, at a minimum, modify: - `D3SpectrumDisplayDiv.xml`, `CompactFileManager.xml`, `ReferencePhotopeakDisplay.xml`, `PeakModel.xml`, `PeakInfoDisplay.xml`, `EnergyCalTool.xml`, `IsotopeSearchByEnergy.xml` -This will translate the text seem in the application in its basic view, including all the tool-tabs that are open by default. +This will translate the text seen in the application in its basic view, including all the tool-tabs that are open by default, so things will look consistent, until the user opens one of the specialized tools. *** @@ -53,4 +53,9 @@ Some potential issues you may run into: - Unfortunately, if the file is not valid XML, or a un-allowed character entity is used, the error-messaging is not great. When the application is loaded, the file wont be used, but on Windows, no error messages are printed out. On macOS or Linux, if you run the InterSpec executable from the command-line, an error will be printed out to stderr, giving the location of the error in the XML file. +*** +A note on performance 20240521: +On an M1 mac, built in release mode, for local server, timing from the time the `InterSpec` class is created, to the ender of its first `render()` call (which I think should capture the added overhead of parsing the language XML, and localizing strings), I compared the pre-internationalization time, to the post-internationalization. +On the first load, of post-internationalized, the worst performance I got was 49 ms, however, was usually ~35 ms. On pre-internationalized, typical was 33ms. On second load (without restarting app), the timings were essentially the same between apps, with it being 10 ms for second load, and 6 ms for subsequent loads. +So all-in-all, internationalization does not cause a performance issue - assuming how I took the timings was valid. \ No newline at end of file diff --git a/src/InterSpec.cpp b/src/InterSpec.cpp index 728b9381..02ed09af 100644 --- a/src/InterSpec.cpp +++ b/src/InterSpec.cpp @@ -469,7 +469,9 @@ InterSpec::InterSpec( WContainerWidget *parent ) m_renderedWidth( 0 ), m_renderedHeight( 0 ), m_colorPeaksBasedOnReferenceLines( true ), - m_findingHintPeaks( false ) + m_findingHintPeaks( false ), + m_hintQueue{}, + m_infoNotificationsMade{} { //Initialization of the app (this function) takes about 11ms on my 2.6 GHz // Intel Core i7, as of (20150316). @@ -9691,10 +9693,12 @@ void InterSpec::handleToolTabChanged( int tab ) if( focus && (current_tab == calibtab) ) { - if( InterSpecUser::preferenceValue( "ShowTooltips", this ) ) - passMessage( "You can also recalibrate graphically by right-clicking and " - "dragging the spectrum to where you want", - WarningWidget::WarningMsgInfo ); + if( !m_infoNotificationsMade.count("recal-tab") + && InterSpecUser::preferenceValue( "ShowTooltips", this ) ) + { + m_infoNotificationsMade.insert( "recal-tab" ); + passMessage( WString::tr("info-recal-tab-selected"), WarningWidget::WarningMsgInfo ); + } }//if( tab == calibtab ) m_currentToolsTab = current_tab; diff --git a/src/PhysicalUnits.cpp b/src/PhysicalUnits.cpp index ae0ac218..c80e7434 100644 --- a/src/PhysicalUnits.cpp +++ b/src/PhysicalUnits.cpp @@ -47,8 +47,8 @@ namespace PhysicalUnits #define METRIC_PREFIX_UNITS "m|M|k|g|G|t|T|u|" MU_CHARACTER_1 "|" MU_CHARACTER_2 "|p|n|f|milli|micro|pico|nano|femto|kilo|mega|giga|terra" #define PLUS_MINUS_REGEX "(\\xC2?\\xB1|\\+\\-\\s*|\\-\\+\\s*)" -#define TIME_UNIT_REGEX "(years|year|yr|y|days|day|d|hrs|hours|hour|h|minute|minutes|min|m|second|seconds|sec|s|ms|microseconds|us|nanoseconds|ns)" -#define HALF_LIFE_REGEX "(hl|halflife|halflives|half-life|half-lives|half lives|half life)" +#define TIME_UNIT_REGEX "(years|year|yr|y|days|day|d|hrs|hours|hour|h|minute|minutes|min|m|second|seconds|sec|s|ms|microseconds|us|nanosecond|nanoseconds|ns)" +#define HALF_LIFE_REGEX "(hl|halflife|halflives|half-life|half-lives|half lives|half lifes|half live|halflive|half life)" #define ACTIVITY_UNIT_REGEX "(bq|becquerel|ci|cu|curie|c)" #define ABSORBED_DOSE_UNIT_REGEX "(gray|Gy|gy|rad|erg|erg\\/g|erg per gram)" #define EQUIVALENT_DOSE_UNIT_REGEX "(sievert|Sv|rem|roentgen|r" DIAERESIS_O "entgen)" diff --git a/target/testing/CMakeLists.txt b/target/testing/CMakeLists.txt index aa44689e..de5262ee 100644 --- a/target/testing/CMakeLists.txt +++ b/target/testing/CMakeLists.txt @@ -70,7 +70,7 @@ add_test( NAME PhysicalUnits add_executable( test_PhysicalUnitsLocalized test_PhysicalUnitsLocalized.cpp ) target_link_libraries( test_PhysicalUnitsLocalized PRIVATE InterSpecLib ) add_test( NAME test_PhysicalUnitsLocalized - COMMAND $ ${BOOST_TEST_CL_ARGS} + COMMAND $ ${BOOST_TEST_CL_ARGS} -- ${DATA_DIR_ARGS} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/target/testing/test_PhysicalUnitsLocalized.cpp b/target/testing/test_PhysicalUnitsLocalized.cpp index 3518d490..799a3f50 100644 --- a/target/testing/test_PhysicalUnitsLocalized.cpp +++ b/target/testing/test_PhysicalUnitsLocalized.cpp @@ -98,6 +98,11 @@ void set_app_text_dir() const string possible_paths[] = { SpecUtils::append_path(datadir,".."), SpecUtils::append_path(datadir,"../.."), + SpecUtils::get_working_path(), + SpecUtils::append_path( SpecUtils::get_working_path(), ".."), +#ifdef _WIN32 + "D:\\a\\InterSpec\\", +#endif ".", "../", "../../", "../../../", "/Users/wcjohns/rad_ana/InterSpec/" };