mirror of
https://github.com/google/blockly.git
synced 2026-01-04 07:30:08 +01:00
Add source code link to custom dialog demo.
Fix typos.
This commit is contained in:
@@ -40,11 +40,11 @@ Blockly.confirm = function(message, callback) {
|
|||||||
CustomDialog.show('Confirm', message, {
|
CustomDialog.show('Confirm', message, {
|
||||||
showOkay: true,
|
showOkay: true,
|
||||||
onOkay: function() {
|
onOkay: function() {
|
||||||
callback(true)
|
callback(true);
|
||||||
},
|
},
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
onCancel: function() {
|
onCancel: function() {
|
||||||
callback(false)
|
callback(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -56,11 +56,11 @@ Blockly.prompt = function(message, defaultValue, callback) {
|
|||||||
showInput: true,
|
showInput: true,
|
||||||
showOkay: true,
|
showOkay: true,
|
||||||
onOkay: function() {
|
onOkay: function() {
|
||||||
callback(CustomDialog.inputField.value)
|
callback(CustomDialog.inputField.value);
|
||||||
},
|
},
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
onCancel: function() {
|
onCancel: function() {
|
||||||
callback(null)
|
callback(null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CustomDialog.inputField.value = defaultValue;
|
CustomDialog.inputField.value = defaultValue;
|
||||||
@@ -69,8 +69,8 @@ Blockly.prompt = function(message, defaultValue, callback) {
|
|||||||
/** Hides any currently visible dialog. */
|
/** Hides any currently visible dialog. */
|
||||||
CustomDialog.hide = function() {
|
CustomDialog.hide = function() {
|
||||||
if (CustomDialog.backdropDiv_) {
|
if (CustomDialog.backdropDiv_) {
|
||||||
CustomDialog.backdropDiv_.style.display = 'none'
|
CustomDialog.backdropDiv_.style.display = 'none';
|
||||||
CustomDialog.dialogDiv_.style.display = 'none'
|
CustomDialog.dialogDiv_.style.display = 'none';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,10 @@
|
|||||||
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
<h1><a href="https://developers.google.com/blockly/">Blockly</a> >
|
||||||
<a href="../index.html">Demos</a> > Custom Dialog</h1>
|
<a href="../index.html">Demos</a> > Custom Dialog</h1>
|
||||||
|
|
||||||
<p>This is a simple demo of replacing modal browser dialogs with HTML.</p>
|
<p>This is a simple demo of replacing modal browser dialogs with HTML.
|
||||||
|
To see how it works, see the source code in
|
||||||
|
<a href="custom-dialog.js">custom-dialog.js</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>Try creating new variables, creating variables with names already in
|
<p>Try creating new variables, creating variables with names already in
|
||||||
use, or deleting multiple blocks on the workspace.
|
use, or deleting multiple blocks on the workspace.
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ Finally, generate all the language versions wih this command:
|
|||||||
java -jar soy/SoyToJsSrcCompiler.jar --locales ar,be-tarask,br,ca,da,de,el,en,es,fa,fr,he,hrx,hu,ia,is,it,ja,ko,ms,nb,nl,pl,pms,pt-br,ro,ru,sc,sv,th,tr,uk,vi,zh-hans,zh-hant --messageFilePathFormat xlf/translated_msgs_{LOCALE}.xlf --outputPathFormat "generated/{LOCALE}.js" template.soy
|
java -jar soy/SoyToJsSrcCompiler.jar --locales ar,be-tarask,br,ca,da,de,el,en,es,fa,fr,he,hrx,hu,ia,is,it,ja,ko,ms,nb,nl,pl,pms,pt-br,ro,ru,sc,sv,th,tr,uk,vi,zh-hans,zh-hant --messageFilePathFormat xlf/translated_msgs_{LOCALE}.xlf --outputPathFormat "generated/{LOCALE}.js" template.soy
|
||||||
|
|
||||||
This is the process that Google uses for maintaining Blockly Games in 40+
|
This is the process that Google uses for maintaining Blockly Games in 40+
|
||||||
languages. The XLIFF fromat is simple enough that it is trival to write a
|
languages. The XLIFF format is simple enough that it is trivial to write a
|
||||||
Python script to reformat it into some other format (such as JSON) for
|
Python script to reformat it into some other format (such as JSON) for
|
||||||
compatability with other translation consoles.
|
compatibility with other translation consoles.
|
||||||
|
|
||||||
For more information, see message translation for Closure Templates:
|
For more information, see message translation for Closure Templates:
|
||||||
https://developers.google.com/closure/templates/docs/translation
|
https://developers.google.com/closure/templates/docs/translation
|
||||||
|
|||||||
Reference in New Issue
Block a user