mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
Move i18n scripts under scripts/ (#4044)
* Move i18n scripts under scripts/
This commit is contained in:
@@ -8,14 +8,14 @@
|
|||||||
/static/demos/plane/soy/*.jar
|
/static/demos/plane/soy/*.jar
|
||||||
/static/demos/plane/xlf/
|
/static/demos/plane/xlf/
|
||||||
/static/externs/
|
/static/externs/
|
||||||
/static/i18n/
|
|
||||||
/static/msg/json/
|
/static/msg/json/
|
||||||
/static/node_modules/
|
/static/node_modules/
|
||||||
/static/package/
|
/static/package/
|
||||||
/static/theme_scripts/
|
/static/scripts/
|
||||||
/static/typings/
|
/static/typings/
|
||||||
|
|
||||||
/static/build.py
|
/static/build.py
|
||||||
|
/static/eslintrc.json
|
||||||
/static/gulpfile.js
|
/static/gulpfile.js
|
||||||
/static/jsconfig.json
|
/static/jsconfig.json
|
||||||
/static/LICENSE
|
/static/LICENSE
|
||||||
|
|||||||
8
build.py
8
build.py
@@ -408,14 +408,14 @@ class Gen_langfiles(threading.Thread):
|
|||||||
try:
|
try:
|
||||||
subprocess.check_call([
|
subprocess.check_call([
|
||||||
"python",
|
"python",
|
||||||
os.path.join("i18n", "js_to_json.py"),
|
os.path.join("scripts", "i18n", "js_to_json.py"),
|
||||||
"--input_file", "msg/messages.js",
|
"--input_file", "msg/messages.js",
|
||||||
"--output_dir", "msg/json/",
|
"--output_dir", "msg/json/",
|
||||||
"--quiet"])
|
"--quiet"])
|
||||||
except (subprocess.CalledProcessError, OSError) as e:
|
except (subprocess.CalledProcessError, OSError) as e:
|
||||||
# Documentation for subprocess.check_call says that CalledProcessError
|
# Documentation for subprocess.check_call says that CalledProcessError
|
||||||
# will be raised on failure, but I found that OSError is also possible.
|
# will be raised on failure, but I found that OSError is also possible.
|
||||||
print("Error running i18n/js_to_json.py: ", e)
|
print("Error running scripts/i18n/js_to_json.py: ", e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Checking whether it is necessary to rebuild the js files would be a lot of
|
# Checking whether it is necessary to rebuild the js files would be a lot of
|
||||||
@@ -425,7 +425,7 @@ class Gen_langfiles(threading.Thread):
|
|||||||
# Use create_messages.py to create .js files from .json files.
|
# Use create_messages.py to create .js files from .json files.
|
||||||
cmd = [
|
cmd = [
|
||||||
"python",
|
"python",
|
||||||
os.path.join("i18n", "create_messages.py"),
|
os.path.join("scripts", "i18n", "create_messages.py"),
|
||||||
"--source_lang_file", os.path.join("msg", "json", "en.json"),
|
"--source_lang_file", os.path.join("msg", "json", "en.json"),
|
||||||
"--source_synonym_file", os.path.join("msg", "json", "synonyms.json"),
|
"--source_synonym_file", os.path.join("msg", "json", "synonyms.json"),
|
||||||
"--source_constants_file", os.path.join("msg", "json", "constants.json"),
|
"--source_constants_file", os.path.join("msg", "json", "constants.json"),
|
||||||
@@ -438,7 +438,7 @@ class Gen_langfiles(threading.Thread):
|
|||||||
cmd.extend(json_files)
|
cmd.extend(json_files)
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
except (subprocess.CalledProcessError, OSError) as e:
|
except (subprocess.CalledProcessError, OSError) as e:
|
||||||
print("Error running i18n/create_messages.py: ", e)
|
print("Error running scripts/i18n/create_messages.py: ", e)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Output list of .js files created.
|
# Output list of .js files created.
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
*
|
*
|
||||||
* After modifying this file, either run "build.py" from the parent directory,
|
* After modifying this file, either run "build.py" from the parent directory,
|
||||||
* or run (from this directory):
|
* or run (from this directory):
|
||||||
* ../i18n/js_to_json.py
|
* ../scripts/i18n/js_to_json.py
|
||||||
* to regenerate json/{en,qqq,synonyms}.json.
|
* to regenerate json/{en,qqq,synonyms}.json.
|
||||||
*
|
*
|
||||||
* To convert all of the json files to .js files, run:
|
* To convert all of the json files to .js files, run:
|
||||||
* ../i18n/create_messages.py json/*.json
|
* ../scripts/i18n/create_messages.py json/*.json
|
||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|||||||
@@ -407,7 +407,7 @@ goog.require('Blockly.requires')
|
|||||||
*/
|
*/
|
||||||
function buildLangfiles(done) {
|
function buildLangfiles(done) {
|
||||||
// Run js_to_json.py
|
// Run js_to_json.py
|
||||||
const jsToJsonCmd = `python ./i18n/js_to_json.py \
|
const jsToJsonCmd = `python ./scripts/i18n/js_to_json.py \
|
||||||
--input_file ${path.join('msg', 'messages.js')} \
|
--input_file ${path.join('msg', 'messages.js')} \
|
||||||
--output_dir ${path.join('msg', 'json')} \
|
--output_dir ${path.join('msg', 'json')} \
|
||||||
--quiet`;
|
--quiet`;
|
||||||
@@ -418,7 +418,7 @@ function buildLangfiles(done) {
|
|||||||
json_files = json_files.filter(file => file.endsWith('json') &&
|
json_files = json_files.filter(file => file.endsWith('json') &&
|
||||||
!(new RegExp(/(keys|synonyms|qqq|constants)\.json$/).test(file)));
|
!(new RegExp(/(keys|synonyms|qqq|constants)\.json$/).test(file)));
|
||||||
json_files = json_files.map(file => path.join('msg', 'json', file));
|
json_files = json_files.map(file => path.join('msg', 'json', file));
|
||||||
const createMessagesCmd = `python ./i18n/create_messages.py \
|
const createMessagesCmd = `python ./scripts/i18n/create_messages.py \
|
||||||
--source_lang_file ${path.join('msg', 'json', 'en.json')} \
|
--source_lang_file ${path.join('msg', 'json', 'en.json')} \
|
||||||
--source_synonym_file ${path.join('msg', 'json', 'synonyms.json')} \
|
--source_synonym_file ${path.join('msg', 'json', 'synonyms.json')} \
|
||||||
--source_constants_file ${path.join('msg', 'json', 'constants.json')} \
|
--source_constants_file ${path.join('msg', 'json', 'constants.json')} \
|
||||||
|
|||||||
Reference in New Issue
Block a user