mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-27 05:22:50 -06:00
Wide coverage demo web app improvements
+ Adapt language selection menus to the languages supported by the grammar. + Add translation quality colors to the links to alternative translations. + Also added more country codes in langcode.js (needed for speech synthesis voice selection).
This commit is contained in:
@@ -25,9 +25,8 @@ gftranslate.translate=function(source,from,to,start,limit,cont) {
|
||||
else cont([{error:"sentence too long"}])
|
||||
}
|
||||
|
||||
// Get functions to test which source and target langauges are supported
|
||||
gftranslate.get_support=function(cont) {
|
||||
function support(code) { return gftranslate.targets[code] }
|
||||
// Get list of supported languages
|
||||
gftranslate.get_languages=function(cont) {
|
||||
function init2(grammar_info) {
|
||||
var ls=grammar_info.languages
|
||||
gftranslate.grammar=grammar_info.name
|
||||
@@ -35,9 +34,19 @@ gftranslate.get_support=function(cont) {
|
||||
for(var i=0;i<ls.length;i++)
|
||||
if(ls[i].name.substr(0,n)==pre) langs.push(ls[i].name.substr(n))
|
||||
gftranslate.targetlist=langs
|
||||
cont(langs)
|
||||
}
|
||||
if(gftranslate.targetlist) cont(gftranslate.targetlist)
|
||||
else gftranslate.call("?command=c-grammar",init2)
|
||||
}
|
||||
|
||||
// Get functions to test which source and target langauges are supported
|
||||
gftranslate.get_support=function(cont) {
|
||||
function support(code) { return gftranslate.targets[code] }
|
||||
function init2(langs) {
|
||||
gftranslate.targets=toSet(langs)
|
||||
cont(support,support)
|
||||
}
|
||||
if(gftranslate.targets) cont(support,support)
|
||||
else gftranslate.call("?command=c-grammar",init2)
|
||||
else gftranslate.get_languages(init2)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user