diff --git a/src/i18n_review.cpp b/src/i18n_review.cpp index 247e342..03163cf 100644 --- a/src/i18n_review.cpp +++ b/src/i18n_review.cpp @@ -55,6 +55,9 @@ namespace i18n_check const std::wregex i18n_review::m_1word_regex{ LR"((\b|\s|^)([[:alpha:]_ŽžŸÀ-ÖØ-öø-ÿżźćńółęąśŻŹĆĄŚĘŁÓŃěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮĚÓАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя&'\.@]+)(2D|3D)?(\b|\s|$))" }; + const std::wregex i18n_review::m_keyboard_accelerator_regex{ + LR"(&[[:alpha:]_ŽžŸÀ-ÖØ-öø-ÿżźćńółęąśŻŹĆĄŚĘŁÓŃěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮĚÓАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя])" + }; // cuneiform-suppress-end const std::wregex i18n_review::m_hashtag_regex{ LR"(#[[:alnum:]]{2,})" }; const std::wregex i18n_review::m_key_shortcut_regex{ diff --git a/src/i18n_review.h b/src/i18n_review.h index 8feb430..2a2c65c 100644 --- a/src/i18n_review.h +++ b/src/i18n_review.h @@ -1171,6 +1171,7 @@ namespace i18n_check static const std::wregex m_angle_braced_one_word_regex; static const std::wregex m_2letter_regex; static const std::wregex m_1word_regex; + static const std::wregex m_keyboard_accelerator_regex; static const std::wregex m_hashtag_regex; static const std::wregex m_key_shortcut_regex; static const std::wregex m_function_signature_regex; diff --git a/src/translation_catalog_review.cpp b/src/translation_catalog_review.cpp index fe3a11f..bdd51f7 100644 --- a/src/translation_catalog_review.cpp +++ b/src/translation_catalog_review.cpp @@ -175,8 +175,6 @@ namespace i18n_check if (static_cast(m_review_styles & check_accelerators)) { - const std::wregex keyboardAcceleratorRegex{ L"&[[:alnum:]]" }; - if (!catEntry.second.m_translation.empty()) { srcResults.clear(); @@ -187,13 +185,13 @@ namespace i18n_check std::wstring::const_iterator searchTransStart( catEntry.second.m_translation.cbegin()); while (std::regex_search(searchSrcStart, catEntry.second.m_source.cend(), - reMatches, keyboardAcceleratorRegex)) + reMatches, m_keyboard_accelerator_regex)) { srcResults.push_back(reMatches[0]); searchSrcStart = reMatches.suffix().first; } while (std::regex_search(searchTransStart, catEntry.second.m_translation.cend(), - reMatches, keyboardAcceleratorRegex)) + reMatches, m_keyboard_accelerator_regex)) { transResults.push_back(reMatches[0]); searchTransStart = reMatches.suffix().first; @@ -219,14 +217,14 @@ namespace i18n_check std::wstring::const_iterator searchTransStart( catEntry.second.m_translation_plural.cbegin()); while (std::regex_search(searchSrcStart, catEntry.second.m_source_plural.cend(), - reMatches, keyboardAcceleratorRegex)) + reMatches, m_keyboard_accelerator_regex)) { srcResults.push_back(reMatches[0]); searchSrcStart = reMatches.suffix().first; } while (std::regex_search(searchTransStart, - catEntry.second.m_translation_plural.cend(), - reMatches, keyboardAcceleratorRegex)) + catEntry.second.m_translation_plural.cend(), reMatches, + m_keyboard_accelerator_regex)) { transResults.push_back(reMatches[0]); searchTransStart = reMatches.suffix().first;