diff --git a/TelegramBotBase/Controls/Hybrid/TaggedButtonGrid.cs b/TelegramBotBase/Controls/Hybrid/TaggedButtonGrid.cs index 9db6a87..7fac716 100644 --- a/TelegramBotBase/Controls/Hybrid/TaggedButtonGrid.cs +++ b/TelegramBotBase/Controls/Hybrid/TaggedButtonGrid.cs @@ -41,6 +41,10 @@ public class TaggedButtonGrid : MultiView public string UncheckAllLabel = Default.Language["ButtonGrid_UncheckAll"]; + public string SearchIcon = Default.Language["ButtonGrid_SearchIcon"]; + + public string TagIcon = Default.Language["ButtonGrid_TagIcon"]; + public TaggedButtonGrid() { DataSource = new ButtonFormDataSource(); @@ -427,7 +431,7 @@ public class TaggedButtonGrid : MultiView } else if (EnableSearch) { - if (result.MessageText.StartsWith("🔍")) + if (result.MessageText.StartsWith(SearchIcon)) { //Sent note about searching if (SearchQuery == null) @@ -452,7 +456,7 @@ public class TaggedButtonGrid : MultiView } else if (Tags != null) { - if (result.MessageText == "📁") + if (result.MessageText == TagIcon) { //Remove button click message if (DeletePreviousMessage && !Device.ActiveForm.IsAutoCleanForm()) @@ -993,14 +997,14 @@ public class TaggedButtonGrid : MultiView if (Tags != null && Tags.Count > 0) { - row.Add(new ButtonBase("📁", "$filter$")); + row.Add(new ButtonBase(TagIcon, "$filter$")); } row.Add(new ButtonBase(NextPageLabel, "$next$")); if (EnableSearch) { - row.Insert(2, new ButtonBase("🔍 " + (SearchQuery ?? ""), "$search$")); + row.Insert(2, new ButtonBase($"{SearchIcon} {(SearchQuery ?? "")}", "$search$")); } dataForm.InsertButtonRow(0, row); diff --git a/TelegramBotBase/Localizations/English.cs b/TelegramBotBase/Localizations/English.cs index 5a7c362..51881b1 100644 --- a/TelegramBotBase/Localizations/English.cs +++ b/TelegramBotBase/Localizations/English.cs @@ -10,8 +10,7 @@ public class English : Localization Values["ButtonGrid_PreviousPage"] = "◀️"; Values["ButtonGrid_NextPage"] = "▶️"; Values["ButtonGrid_CurrentPage"] = "Page {0} of {1}"; - Values["ButtonGrid_SearchFeature"] = - "💡 Send a message to filter the list. Click the 🔍 to reset the filter."; + Values["ButtonGrid_SearchFeature"] = "💡 Send a message to filter the list. Click the 🔍 to reset the filter."; Values["ButtonGrid_Back"] = "Back"; Values["ButtonGrid_CheckAll"] = "Check all"; Values["ButtonGrid_UncheckAll"] = "Uncheck all"; @@ -31,5 +30,7 @@ public class English : Localization Values["MultiToggleButton_Changed"] = "Chosen"; Values["PromptDialog_Back"] = "Back"; Values["ToggleButton_Changed"] = "Setting changed"; + Values["ButtonGrid_SearchIcon"] = "🔍"; + Values["ButtonGrid_TagIcon"] = "📁"; } }