From d35790e656fe70f0fa258fb8fb84aa65f9887616 Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 12 Apr 2013 18:29:15 +0000 Subject: GF cloud: work on syntax editor integration + The syntax editor is now accessible from the Simple Translaton Tool. + The minibar now automatically provides access to the syntax editor (provided the necessary JavaScript files and style sheets have been loaded). + Preparations for making the syntax editor accessible from the grammar editor. --- src/www/translator/about.html | 12 +++++++++--- src/www/translator/index.html | 7 ++++++- src/www/translator/translator.css | 2 +- src/www/translator/translator.js | 15 +++++++-------- 4 files changed, 23 insertions(+), 13 deletions(-) (limited to 'src/www/translator') diff --git a/src/www/translator/about.html b/src/www/translator/about.html index 5a45582ea..8b1de512a 100644 --- a/src/www/translator/about.html +++ b/src/www/translator/about.html @@ -35,11 +35,18 @@ The tool supports two machine translation services: translation from English to a few other languages. -

If an unsatisfactory automatic translation is +

+If an unsatisfactory automatic translation is obtained, the user can click on it and replace it with a manual translation. If multiple translations are obtained, one of them is shown by default and the other ones are available in a popup menu. +

+Source segments can also be edited. If a GF grammar is used for translation, +the Minibar and the +Syntax Editor can be used. +A plain text box is also available, regardless of translation method. +

The tool handles a set of documents. Documents can be named, saved, closed and reopened later. Documents can be saved locally or in the cloud. @@ -56,7 +63,6 @@ closed and reopened later. Documents can be saved locally or in the cloud. to be capitalized, e.g. "I am ready." and "Spanish wine is good."

  • Document sharing in the cloud.
  • Interface to other translation services. -
  • Guided text entry, using the Minibar or some variant of it.
  • Interface to the grammar editor for grammar extension.
  • More browser compatibility testing (Chrome, Firefox, Safari & Opera Mobile tested so far). @@ -67,7 +73,7 @@ closed and reopened later. Documents can be saved locally or in the cloud.
    -Last modified: Fri Apr 5 15:24:59 CEST 2013 +Last modified: Fri Apr 12 19:39:40 CEST 2013
    TH diff --git a/src/www/translator/index.html b/src/www/translator/index.html index b561f0fc3..97eeb22d7 100644 --- a/src/www/translator/index.html +++ b/src/www/translator/index.html @@ -4,6 +4,7 @@ + @@ -77,10 +78,11 @@
    HMTL -Last modified: Fri Apr 12 14:18:13 CEST 2013 +Last modified: Fri Apr 12 17:03:43 CEST 2013
    About + @@ -92,6 +94,9 @@ + + + diff --git a/src/www/translator/translator.css b/src/www/translator/translator.css index d85c605ab..060fca2c2 100644 --- a/src/www/translator/translator.css +++ b/src/www/translator/translator.css @@ -120,7 +120,7 @@ div.overlay > div { /*border-radius: 5px;*/ } -div#minibar { +div#minibar, div#syntax_editor { border: 1px solid black; padding: 5px; background: #ccc url("../minibar/brushed-metal.png"); diff --git a/src/www/translator/translator.js b/src/www/translator/translator.js index 38b4d01da..7d766258d 100644 --- a/src/www/translator/translator.js +++ b/src/www/translator/translator.js @@ -305,11 +305,7 @@ function uses_gf(doc,segment) { var m= segment.options.method || doc.options.method var d=segment.use_default if(d || d==null) m=doc.options.method - switch(m) { - case "Manual": return null - case "Apertium": return null - default: return m - } + return /\.pgf$/.test(m) ? m : null } Translator.prototype.add_apertium=function() { @@ -769,7 +765,8 @@ Translator.prototype.edit_source=function(source,i) { var pgf_server=t.servers[grammarname] function cont2(source) { function ok() { - unlextext(gf_unlex(minibar.input.current.input),change) + function cont(input) { unlextext(input,change) } + minibar.get_current_input(cont) t.hide_filebox() } function cancel() { @@ -789,9 +786,11 @@ Translator.prototype.edit_source=function(source,i) { initial:{from:gfrom, startcat:grammar_info.startcat, input:source.split(" ")}, - initial_toLangs: [gto] + initial_toLangs: [gfrom,gto] } - replaceChildren(t.filebox,empty_id("div","minibar")) + clear(t.filebox) + appendChildren(t.filebox,[empty_id("div","minibar"), + empty_id("div","syntax_editor")]) var minibar=new Minibar(pgf_server,minibar_options) appendChildren(t.filebox,[button("OK",ok), button("Cancel",cancel)]) -- cgit v1.2.3