Skip to content

A Chinese version of our favorite programming language, JavaScript.

Notifications You must be signed in to change notification settings

notedwin-dev/chinese-js

Repository files navigation

Chinese JavaScript (cn-js)

Chinese JavaScript is a project aimed at providing basic features for writing and running JavaScript code with Chinese syntax. It includes a VM code runner to execute JavaScript code in an isolated sandbox environment.

A little background behind Chinese JS

This was originally just a meme between my developer friends and myself. But then I told myself, I could never find such a language that allows me to code in Chinese! Why not I build one myself? So this is how CN-js was born. It turned from a meme that everyone laughed and forget about after a while into a potentially huge project where so many Chinese developers may benefit from it.

So here is the Chinese locale version of our favourite programming language, JavaScript!

Features

  • Write JavaScript code using Chinese syntax.
  • Execute code in an isolated sandbox environment for security.
  • Basic support for common JavaScript operations and functions.

Getting Started

Prerequisites

  • Node.js installed on your machine.

Installation

  1. Clone the repository:
    git clone https://github.com/yourusername/chinese-js.git
  2. Navigate to the project directory:
    cd chinese-js

Basic Usage

To use Chinese JavaScript, simply create a .cn.js file and start writing JavaScript code using Chinese keywords. The extension will automatically provide syntax highlighting and language support. You can get it here

Basic Syntax Hightlighting that are currently supported by cn-js

  • let
  • const常量
  • var变量
  • function: 函数
  • return返回
  • for:
  • forEach: 为每个
  • while:
  • do
  • if如果
  • else if否则如果
  • else否则
  • throw: 抛出
  • new: 新建
  • try尝试
  • catch捕获
  • finally最终
  • instanceof实例
  • typeof类型
  • true (note: might be removed in the future to maintain Boolean in English)
  • false (note: might be removed in the future to maintain Boolean in English)
  • basic maths operators such as =, -, + are supported
  • all console methods should function as expected.

Developer Notes

CN-JavaScript is born to modify most of the basic syntax from regular JavaScript into Chinese Characters, however, we do want to make things more easier for existing JavaScript Developers who are interested in exploring CN-js. Therefore, as the project grows larger with more open source contributions, this README may be migrated to a more proper Documentation website.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgements

  • Thanks to all contributors and the open-source community.

Bugs and Issues

If you encounter any bugs or issues, please report them on the GitHub Issues page.

Author

Repository

Keywords

  • chinese-js
  • chinese-javascript
  • cn-javascript
  • cnjs
  • cn-js
  • cndotjs
  • chinesedotjs
  • chinese-syntax
  • localized-js
  • multilingual-js
  • js-localization
  • language-extension

Support me here!

Made with love ko-fi

About

A Chinese version of our favorite programming language, JavaScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published