mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-01 07:12:50 -06:00
minibar: internal state type change
The current intput is now represented as an array of words instead of as a string. (This is the kind of change is scary to do in a dynamically type language like JavaScript. In a statically typed language like Haskell you can do it with confidence, since you know the compiler can help you catch all mistakes...)
This commit is contained in:
@@ -164,8 +164,8 @@ Minibar.prototype.append_extra_buttons=function(extra,options) {
|
||||
Minibar.prototype.try_google=function() {
|
||||
with(this) {
|
||||
var to=translations.target_lang();
|
||||
var s=input.current.input;
|
||||
if(input.surface.typed) s+=input.surface.typed.value;
|
||||
var s=gf_unlex(input.current.input);
|
||||
if(input.surface.typed) s+=" "+input.surface.typed.value;
|
||||
var url="http://translate.google.com/?sl="
|
||||
+langpart(input.current.from,grammar.name);
|
||||
if(to!="All") url+="&tl="+to;
|
||||
@@ -198,7 +198,7 @@ function prefill_feedback_form() {
|
||||
var form=document.forms.namedItem("feedback");
|
||||
setField(form,"grammar",gn);
|
||||
setField(form,"from",langpart(state.current.from,gn));
|
||||
setField(form,"input",state.current.input);
|
||||
setField(form,"input",gf_unlex(state.current.input));
|
||||
setField(form,"to",to);
|
||||
if(to=="All") element("translation_box").innerHTML=" To suggest a better translation to a particular language, select that language in the To: menu before pressing the Feedback button."
|
||||
else setField(form,"translation",trans.single_translation.join(" / "));
|
||||
|
||||
Reference in New Issue
Block a user