From 92a485d56d44693a23b8c936e3664d13a7dbec88 Mon Sep 17 00:00:00 2001 From: Kevin Daily Date: Fri, 3 May 2024 14:50:32 -0700 Subject: [PATCH] Fix 447715: allow popup menu text to be localizable --- Assets/DisplayFunctions.wxf | Bin 522916 -> 523373 bytes Developer/StylesheetBuilder.wl | 12 ++-- FrontEnd/StyleSheets/Chatbook.nb | 52 ++++++++++++++++-- FrontEnd/TextResources/ChatbookStrings.tr | 7 ++- .../TextResources/Japanese/ChatbookStrings.tr | 7 ++- .../TextResources/Spanish/ChatbookStrings.tr | 7 ++- 6 files changed, 70 insertions(+), 15 deletions(-) diff --git a/Assets/DisplayFunctions.wxf b/Assets/DisplayFunctions.wxf index 7ea6b29615d413a093e7a39cccf316ff56c21bb4..ea8e83f35afb321c3b0c1e09b97205610f86a297 100644 GIT binary patch delta 366 zcmZ4TRsQV{`3)a5rk}sWE;TtwMQ*zMeRe?|+2E4OoYdls)YKB!ih`W{lvL-`oSb6M zynvj<hKxYW1jNih%mT!$K+Lv%rXf4`NdPx3jX3}S delta 203 zcmaF+Lw?Cu`3)a5WP+uXTq_E4@>5b3oKtghiWM|G^ArMd5|dLkl{P0DF)>a~*V-u? zERC+prL-U?GdZyYqKuJo@(i7W;=!Uy&iMtE3Q!YMAVz}B0V+7F_f0fdSSchwJv}E? z!7aZiH?gE7GcO$~ZDzPzI9L#(-#H_(#6Kx3HMvBoInk&cs2zxzfS4JGS%8=oh}pI$ J8nN@70swSAM9u&J diff --git a/Developer/StylesheetBuilder.wl b/Developer/StylesheetBuilder.wl index 7f4272a0..c0911704 100644 --- a/Developer/StylesheetBuilder.wl +++ b/Developer/StylesheetBuilder.wl @@ -331,13 +331,13 @@ menuItem[ icon_, label_, code_ ] := $chatOutputMenu := $chatOutputMenu = ToBoxes @ makeMenu[ { - (* Icon , Label , ActionName *) - { "DivideCellsIcon" , "Explode Cells (In Place)" , "ExplodeInPlace" }, - { "OverflowIcon" , "Explode Cells (Duplicate)", "ExplodeDuplicate" }, - { "HyperlinkCopyIcon", "Copy Exploded Cells" , "CopyExplodedCells" }, + (* Icon , Label , ActionName *) + { "DivideCellsIcon" , tr[ "StylesheetExplodeCellsInPlace" ] , "ExplodeInPlace" }, + { "OverflowIcon" , tr[ "StylesheetExplodeCellsDuplicate" ], "ExplodeDuplicate" }, + { "HyperlinkCopyIcon", tr[ "StylesheetCopyExplodedCells" ] , "CopyExplodedCells" }, Delimiter, - { "TypesettingIcon" , "Toggle Formatting" , "ToggleFormatting" }, - { "InPlaceIcon" , "Copy ChatObject" , "CopyChatObject" } + { "TypesettingIcon" , tr[ "StylesheetToggleFormatting" ] , "ToggleFormatting" }, + { "InPlaceIcon" , tr[ "StylesheetCopyChatObject" ] , "CopyChatObject" } }, GrayLevel[ 0.85 ], 250 diff --git a/FrontEnd/StyleSheets/Chatbook.nb b/FrontEnd/StyleSheets/Chatbook.nb index 232994aa..67b61033 100644 --- a/FrontEnd/StyleSheets/Chatbook.nb +++ b/FrontEnd/StyleSheets/Chatbook.nb @@ -1161,7 +1161,7 @@ Notebook[ ], Cell[ StyleData["ChatStyleSheetInformation"], - TaggingRules -> <|"StyleSheetVersion" -> "1.4.6.3922429268"|> + TaggingRules -> <|"StyleSheetVersion" -> "1.4.6.3923736444"|> ], Cell[ StyleData["Text"], @@ -2854,7 +2854,15 @@ Notebook[ TemplateBox[ { TemplateBox[{"DivideCellsIcon"}, "ChatMenuItemToolbarIcon"], - "\"Explode Cells (In Place)\"", + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource[ + "ChatbookStrings", + "StylesheetExplodeCellsInPlace" + ], + StandardForm + ] + ], Hold[ With[ { Wolfram`ChatNB`cell$ = EvaluationCell[] }, {Wolfram`ChatNB`root$ = ParentCell[Wolfram`ChatNB`cell$]}, @@ -2876,7 +2884,15 @@ Notebook[ TemplateBox[ { TemplateBox[{"OverflowIcon"}, "ChatMenuItemToolbarIcon"], - "\"Explode Cells (Duplicate)\"", + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource[ + "ChatbookStrings", + "StylesheetExplodeCellsDuplicate" + ], + StandardForm + ] + ], Hold[ With[ { Wolfram`ChatNB`cell$ = EvaluationCell[] }, {Wolfram`ChatNB`root$ = ParentCell[Wolfram`ChatNB`cell$]}, @@ -2901,7 +2917,15 @@ Notebook[ {"HyperlinkCopyIcon"}, "ChatMenuItemToolbarIcon" ], - "\"Copy Exploded Cells\"", + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource[ + "ChatbookStrings", + "StylesheetCopyExplodedCells" + ], + StandardForm + ] + ], Hold[ With[ { Wolfram`ChatNB`cell$ = EvaluationCell[] }, {Wolfram`ChatNB`root$ = ParentCell[Wolfram`ChatNB`cell$]}, @@ -2924,7 +2948,15 @@ Notebook[ TemplateBox[ { TemplateBox[{"TypesettingIcon"}, "ChatMenuItemToolbarIcon"], - "\"Toggle Formatting\"", + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource[ + "ChatbookStrings", + "StylesheetToggleFormatting" + ], + StandardForm + ] + ], Hold[ With[ { Wolfram`ChatNB`cell$ = EvaluationCell[] }, {Wolfram`ChatNB`root$ = ParentCell[Wolfram`ChatNB`cell$]}, @@ -2946,7 +2978,15 @@ Notebook[ TemplateBox[ { TemplateBox[{"InPlaceIcon"}, "ChatMenuItemToolbarIcon"], - "\"Copy ChatObject\"", + DynamicBox[ + ToBoxes[ + FEPrivate`FrontEndResource[ + "ChatbookStrings", + "StylesheetCopyChatObject" + ], + StandardForm + ] + ], Hold[ With[ { Wolfram`ChatNB`cell$ = EvaluationCell[] }, {Wolfram`ChatNB`root$ = ParentCell[Wolfram`ChatNB`cell$]}, diff --git a/FrontEnd/TextResources/ChatbookStrings.tr b/FrontEnd/TextResources/ChatbookStrings.tr index 469d7b88..bdfa7293 100644 --- a/FrontEnd/TextResources/ChatbookStrings.tr +++ b/FrontEnd/TextResources/ChatbookStrings.tr @@ -149,7 +149,12 @@ "StylesheetChatWidgetButtonTooltip" -> "Send to LLM", "StylesheetAssistantMenuInitializerButtonTooltip" -> "Disable automatic assistance", -"StylesheetFeedbackButtonTooltip" -> "Send feedback to Wolfram" +"StylesheetFeedbackButtonTooltip" -> "Send feedback to Wolfram", +"StylesheetExplodeCellsInPlace" -> "Explode Cells (In Place)", +"StylesheetExplodeCellsDuplicate" -> "Explode Cells (Duplicate)", +"StylesheetCopyExplodedCells" -> "Copy Exploded Cells", +"StylesheetToggleFormatting" -> "Toggle Formatting", +"StylesheetCopyChatObject" -> "Copy ChatObject" } @| @| diff --git a/FrontEnd/TextResources/Japanese/ChatbookStrings.tr b/FrontEnd/TextResources/Japanese/ChatbookStrings.tr index 39ff4af7..87143993 100644 --- a/FrontEnd/TextResources/Japanese/ChatbookStrings.tr +++ b/FrontEnd/TextResources/Japanese/ChatbookStrings.tr @@ -149,7 +149,12 @@ "StylesheetChatWidgetButtonTooltip" -> "\:5927\:898f\:6a21\:8a00\:8a9e\:30e2\:30c7\:30eb\:306b\:9001\:4fe1", "StylesheetAssistantMenuInitializerButtonTooltip" -> "\:81ea\:52d5\:30a2\:30b7\:30b9\:30bf\:30f3\:30c8\:3092\:7121\:52b9\:306b\:3059\:308b", -"StylesheetFeedbackButtonTooltip" -> "\:30d5\:30a3\:30fc\:30c9\:30d0\:30c3\:30af\:3092Wolfram\:306b\:9001\:4fe1\:3059\:308b" +"StylesheetFeedbackButtonTooltip" -> "\:30d5\:30a3\:30fc\:30c9\:30d0\:30c3\:30af\:3092Wolfram\:306b\:9001\:4fe1\:3059\:308b", +"StylesheetExplodeCellsInPlace" -> "Explode Cells (In Place)", +"StylesheetExplodeCellsDuplicate" -> "Explode Cells (Duplicate)", +"StylesheetCopyExplodedCells" -> "Copy Exploded Cells", +"StylesheetToggleFormatting" -> "Toggle Formatting", +"StylesheetCopyChatObject" -> "Copy ChatObject" } @| @| diff --git a/FrontEnd/TextResources/Spanish/ChatbookStrings.tr b/FrontEnd/TextResources/Spanish/ChatbookStrings.tr index e25c757e..d48fd735 100644 --- a/FrontEnd/TextResources/Spanish/ChatbookStrings.tr +++ b/FrontEnd/TextResources/Spanish/ChatbookStrings.tr @@ -149,7 +149,12 @@ "StylesheetChatWidgetButtonTooltip" -> "Enviar a LLM", "StylesheetAssistantMenuInitializerButtonTooltip" -> "Deshabilitar asistencia autom\[AAcute]tica", -"StylesheetFeedbackButtonTooltip" -> "Enviar comentarios a Wolfram" +"StylesheetFeedbackButtonTooltip" -> "Enviar comentarios a Wolfram", +"StylesheetExplodeCellsInPlace" -> "Explode Cells (In Place)", +"StylesheetExplodeCellsDuplicate" -> "Explode Cells (Duplicate)", +"StylesheetCopyExplodedCells" -> "Copy Exploded Cells", +"StylesheetToggleFormatting" -> "Toggle Formatting", +"StylesheetCopyChatObject" -> "Copy ChatObject" } @| @|