Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internacionalizacion de procedimientos #10

Merged
merged 7 commits into from
Mar 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ This library installs new custom procedures for blockly, with custom modificatio
- Support for a `Blockly.CUSTOM_COLORS` object.

## Usage

If you desire to use a different language than Spanish, you can define your own translations for the needed blocks using `Blockly.Msg`, for example:

```javascript
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = 'your translation';
```

Then proceed to call `ProcedsBlockly.init()` to load these new translations. Otherwise, you can use the default language by calling `ProcedsBlockly.setDefacultLocale()`:

```
<script src="node_modules/proceds-blockly/proceds-blockly-original.js"></script>
<script src="node_modules/proceds-blockly/proceds-blockly.js"></script>
<script>
initProcedsBlockly();
// or initProcedsBlockly("Statement"); for custom statement type configurations
ProcedsBlockly.setDefacultLocale() // if no translation was loaded previously
ProcedsBlockly.init();
// or ProcedsBlockly.init("Statement"); for custom statement type configurations
asanzo marked this conversation as resolved.
Show resolved Hide resolved
</script>
```

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proceds-blockly",
"version": "1.0.1",
"version": "1.1.0",
"description": "This library installs new custom procedures for blockly, with custom modifications: - The parameters now can be easily added and removed with buttons, replacing the mutator popup. - The arguments (`variables_get`) are associated with the procedure. All this blocks now have a `$parent` field with the id of the procedure where they belong. **For this to work, you must save this `$parent` in the mutation of `variables_get`**. - The 'help' option was removed from the context menu. - The block `procedures_defnoreturn` has been splitted in `procedures_defnoreturn` and `procedures_defnoreturnnoparams`. - The block `procedures_defreturn` has been splitted in `procedures_defreturn`, `procedures_defreturnsimplewithparams` and `procedures_defreturnsimple`. - The blocks can be added on every category you want. If you want to create a category for the calls, use the custom names `PROCEDURE_CALLS` and `FUNCTION_CALLS`. - Procedure descriptions are disabled by default.",
"main": "proceds-blockly.js",
"scripts": {
Expand All @@ -19,4 +19,4 @@
"dependencies": {
"blockly-package": "1.0.0"
}
}
}
Loading