Skip to content

Commit

Permalink
notebook translation
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed May 15, 2018
1 parent 1cc8c33 commit 128fad0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Prototypes/Notebook.wl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ CopyAsBitmap[expr_] := Module[{nb},
SetOptions[ $FrontEnd, SpellingOptions->{"AutoSpellCheckDelay" -> 0, "AutoSpellCheckPopupDelay" -> 0,"MaxSuggestions"->10}];


NotebookTranslate[nb_NotebookObject, opts___] := Module[{nbe},
nbe = NotebookGet[nb];
nbe = nbe /.
Cell[s_String, args___] :>
Cell[TextTranslation[s, opts ], args];
NotebookPut[nbe]
]




(*)
Expand Down
5 changes: 3 additions & 2 deletions Prototypes/PacletInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Description -> "A paclet for prototype functions",
Creator -> "Arnoud Buzing",
Publisher -> "Wolfram Research",
Version -> "0.2.3",
Version -> "0.2.4",
MathematicaVersion -> "11.2+",
Loading -> Automatic,
Thumbnail -> "icons/icon.png",
Expand Down Expand Up @@ -49,7 +49,8 @@
"Prototypes`RGBColor255", "Prototypes`$AppDataDirectory", "Prototypes`$LocalAppDataDirectory",
"Prototypes`$RoamingAppDataDirectory",
"Prototypes`DockButton", "Prototypes`$DockButtons", "Prototypes`CreateDock",
"Prototypes`CreateDockButton", "Prototypes`EntityPropertiesDataset", "Prototypes`WolframBeta"
"Prototypes`CreateDockButton", "Prototypes`EntityPropertiesDataset", "Prototypes`WolframBeta",
"Prototypes`NotebookTranslate"
},
Context -> {"Prototypes`"} }
}
Expand Down
1 change: 1 addition & 0 deletions Prototypes/Usage.wl
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,4 @@ QuickSearch::usage = "QuickSearch[] provides a quick interactive way to search a
EntityPropertiesDataset::usage = "EntityPropertiesDataset[entity] creates a dataset for the supported properties for 'entity'";
(* wolfram alpha *)
WolframBeta::usage = "WolframBeta[input] translates 'input' to English, then calls WolframAlpha with the translation";
NotebookTranslate::usage = "NotebookTranslate[nb, lang] translates 'nb' to the specified language 'lang' using TextTranslation";

0 comments on commit 128fad0

Please sign in to comment.