Adding a New Language to Ardublockly

Adding a New Language to Ardublockly

(Work in Progress: This page should describe how to add new languages to Ardublockly)

While Blockly has been translated to a large number of languages using TranslateWiki (more infohere), only a small subset of these translations has been expanded to cover the additional blocks and user interface text for Ardublockly. Ardublockly itself does not use TranslateWiki and to add a new language the JavaScript and JSON files have to be manually edited.

There are 3 main files related to the localisation, but only one needs to be updated to add a new language:

  • blockly/msg/messages.js: This file defines all the strings (in English) used by Ardublockly. If you are only adding a new language, then it can be ignored as everything required will already be present. Every time Blockly is built, the strings defined here are included in theblockly/msg/<language>.js JavaScript file, translated by the entries from the respective JSON file if they have been defined.

  • blockly/msg/json/<language>.json: An existing file for your language should already exists in this directory. This JSON file contains the string name and its translation, but for unsupported languages it will not include the entries required by Ardublockly (only those for Blockly). This is the file that will need to be updated (more details below).

  • blockly/msg/<language>.js: An existing file for your language should already exists in this directory. This file will be automatically generated and updated from theblockly/msg/messages.js and blockly/msg/json/<language>.json data when building Blockly, so this file should not be edited either.

Translating the Ardublockly strings

(Description on how to do this should go here)

Generating/Updating the language files

Once the translated entries have been added to the JSON file, Blockly needs to be built to convert them into strings in the respective JavaScript file. To do this, from the Ardublockly project folder on a terminal (make sure you are using Python 2):

cd blockly
python build.py

(Mention that Blockly doesn't neccesarily have to be built and that just sending a PR with those two files should be fine)

(Mention that the front end js file can be updated to include the new language on the settings menu.)

(Indicate how to send a PR)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值