-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
200 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# 技术方案 | ||
|
||
## CEF与Electron | ||
|
||
[github CEF](https://github.com/chromiumembedded/cef) | ||
[Chromium Embedded Framework (CEF). A simple framework for embedding Chromium-based browsers in other applications.](https://bitbucket.org/chromiumembedded/workspace/projects/CEF) | ||
CEF面向会使用C++和JS、HTML、CSS的,是对Chromium做了精简和封装,允许开发者通过C++控制chromium核心,与Javascript交互,但其他都需要开发者自己处理 | ||
|
||
Electron面向纯前端开发者 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Image Tool | ||
|
||
## [wsrv.nl](https://images.weserv.nl/) | ||
An image cache & resize service. Manipulate images on-the-fly with a worldwide cache. | ||
据说速度很快 | ||
- [Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s). ](https://github.com/weserv/images) | ||
- [A fast image processing library with low memory needs. ](https://github.com/libvips/libvips) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 多语言 | ||
> i18n是国际化的英文为 internationalization,为了方便,通常会简写为 i18n(开头的 i、中间的 18 个字符、末尾的 n) | ||
分三类信息, | ||
- message,文本的替换 | ||
- date time format,时间日期的格式 | ||
- number,数字格式,货币形式等 | ||
|
||
但难点还是很多的: | ||
- 多语言的没有标准,使用起来就存在各种兼容的问题,如中文有zh,zh_CN等来区分中文, 可参考BCP 47,全称为Best Current Practice for Tags for the Identification of Languages,是一个基于RFC 5646标准的语言标签格式的建议标准。 | ||
- 多语言还是影响视觉设计,开发时就需要考虑这些问题,不同语言的表述会导致字符的长度差异较大 | ||
- 语言的字段是复用还是语义化,都是一个难点,随着需求的变化可能会有很大的影响 | ||
- 符合用户习惯与不同文化的需求 | ||
|
||
|
||
## web | ||
|
||
**vue** | ||
|
||
把i18n实列对象放入Vue的实例中,通过this.$i18n.locale='zh'来设置对应的语言 | ||
|
||
也可以存储在store或cookie中, | ||
|
||
但对惰性组件,如echarts这类需要重新渲染的,就需要手动处理了,方法有: | ||
- 利用watch监听locale字段是否发现变化,主动调用重新渲染 | ||
- locale变化时直接this.reload强制刷新页面 | ||
|
||
```js | ||
new Vuei81n({ | ||
locale:'', | ||
messages: {}, // $t(path) | ||
numberFormats: {}, // $n() | ||
dateTimeFormats: {}, // $d() | ||
}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.