mandolin / hia-multilingual-vue-template

多语言辅助开发框架模板。Multilingual auxiliary development framework template
MIT License
6 stars 2 forks source link

多语言辅助开发框架模板

适用于希望用中文开发vue前端应用的开发者。\ 理论上适用于任何希望用非英语语言开发的用户。

前提

已安装好node.js、已全局安装vue-cli。

项目安装

npm install

pug的中文id和中文样式类的速写形式支持

安装好后,请使用tool文件夹中的 pug-lexer/index.js 替换 node_module 中的相应文件。 (使pug能支持 .中文类#中文id 的写法)

编译并热加载调试

npm run serve

编译并打包为生产环境代码

npm run build

说明

使用方法

指南

实现机制及效果

特性和不足

总体上来说,本项目目前用最精简的方式,实现了大范围的中文可用性,效能比突出;\ 另一方面,功能还很单薄,很多不足之处也很明显。\ 后期会不断改进。

一些需要注意的地方

代码方面

button(@click = '更新一些时间') //-无效
/*须加上括号:*/ button(@click = '更新一些时间()')
//- 英文名方法则无此问题

语库

本应用尚处于demo状态,主要是标准语库刚开始建立,如果你希望立即在你的开发环境中运用此框架,你至少需要建立及完善你自身的语库。

中英混用

使用建议(仅供参考):某些情形下适宜用中文(多见于可读性更重要的场景),某些情形下适宜用英文尤其是简短字符(多见于需要快速输入代码的场景,比如快速实现一些逻辑简明但是语法啰嗦的私有方法内部方法等),请斟酌结合使用,找到最佳的使用方式。

适用项目

为什么中文开发

多年开发的经历给了本人一个启示:改代码、读代码的所需时间和精力远远超出写代码。\ 本人作为一个中文母语的开发者,英文的掌握还算合格,但在阅读和理解速度上始终磕磕碰碰,各人的语言天赋毕竟有先天差异,并非后天一定能弥补(或者代价很大),(另还有中文、英文在象形表意、表音之间的差异和影响,也是额外的因素,这些可以查看很多这方面的相关论述)。\ 基于以上及更多相关因素,本人逐渐开始尝试在编程中更多的引入中文名,取得不错效果后,从此坚定了自己走中文开发的步子。工作中以前端为主,而前端中vue在中国使用广泛,因此决定在vue基础上实现一套多语言机制方便中文开发。

对编程个体的意义

一言蔽之:“此之蜜糖,彼之砒霜”。


hia-multilingual-vue-template

Apply to vue front-end application developers who wanna use Chinese for programming.\ In theory it is applicable to any user whe wants to use the Non English language for development.

Premise

Node.js is installed and Vue cli is installed globally.

Project setup

npm install

Make it usable for Chinese id and Chinese style class sketch form of pug

After installation,Please use file ./tool/pug-lexer/index.js replace the relevant file of node_module . (make the pug can support sketch form of .中文类#中文id

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Description

Method of use

Guide

Implementation mechanism and effect

Features and shortcomings

Overall, the project has achieved a wide range of Chinese availability in the most streamlined manner, with an outstanding efficiency ratio. \ On the other hand, the functions are very thin and many shortcomings are obvious. \ It will continue to improve in the later stages.

Some things to note

Code aspect

button (@click = 'Update some time') //-Invalid
/* Require parentheses: */ button (@click = 'Update some time ()')
//- English name method does not have this problem

Corpus

This application is still in the demo state, and the standard corpus is just beginning to be established. If you want to use this framework in your development environment immediately, you need to build and improve your own corpus at least.

Chinese and English mixed

Suggestions for use (for reference only): Chinese is appropriate in some cases (most commonly in scenarios where readability is more important), and English, especially short characters, is appropriate in some situations (mostly in scenarios where you need to quickly enter code, such as quick Implement some logically concise but grammatically private methods, etc.), please consider combining them to find the best way to use them.

Applicable items

Why Chinese Development

The experience of many years of development has given me an inspiration: the time and effort required to change and read the code is far more than writing code. \ As a native Chinese developer, I still have a good command of English, but I always have a bump in the speed of reading and understanding. After all, each person's language talents have innate differences, which may not be able to make up (or cost a lot). (There are also differences and influences between pictographs and phonetics in Chinese and English, which are also additional factors. These can be viewed in many related discussions in this regard). \ Based on the above and more related factors, I gradually began to try to introduce more Chinese names in programming. After achieving good results, I have firmly established myself in the pace of Chinese development. The front-end is mainly used in the work, and vue is widely used in China. Therefore, it is decided to implement a multi-language mechanism based on vue to facilitate Chinese development.

Meaning for programming individuals

In a word: "This honey, the other frost."

License

MIT 2020 mandolin.mdy@gmail.com