Skip to content

Commit

Permalink
Fix 447715: allow popup menu text to be localizable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Daily committed May 3, 2024
1 parent e678a3a commit 92a485d
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 15 deletions.
Binary file modified Assets/DisplayFunctions.wxf
Binary file not shown.
12 changes: 6 additions & 6 deletions Developer/StylesheetBuilder.wl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 46 additions & 6 deletions FrontEnd/StyleSheets/Chatbook.nb
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ Notebook[
],
Cell[
StyleData["ChatStyleSheetInformation"],
TaggingRules -> <|"StyleSheetVersion" -> "1.4.6.3922429268"|>
TaggingRules -> <|"StyleSheetVersion" -> "1.4.6.3923736444"|>
],
Cell[
StyleData["Text"],
Expand Down Expand Up @@ -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$]},
Expand All @@ -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$]},
Expand All @@ -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$]},
Expand All @@ -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$]},
Expand All @@ -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$]},
Expand Down
7 changes: 6 additions & 1 deletion FrontEnd/TextResources/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
@|
@|
Expand Down
7 changes: 6 additions & 1 deletion FrontEnd/TextResources/Japanese/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
@|
@|
Expand Down
7 changes: 6 additions & 1 deletion FrontEnd/TextResources/Spanish/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
@|
@|
Expand Down

0 comments on commit 92a485d

Please sign in to comment.