Add more term fixes and markdown format fixes

This commit is contained in:
Will
2019-03-03 00:40:37 +08:00
parent accc3cc768
commit d5355ad2ec
69 changed files with 573 additions and 393 deletions

View File

@@ -4,6 +4,7 @@
## i18n 整合
beego 中設定全域性變數如下:
```Go
Translation i18n.IL
@@ -11,6 +12,7 @@ Lang string //設定語言套件zh、en
LangPath string //設定語言套件所在位置
```
初始化多語言函式:
```Go
func InitLang(){
@@ -20,6 +22,7 @@ func InitLang(){
}
```
為了方便在範本中直接呼叫多語言套件,我們設計了三個函式來處理回應的多語言:
```Go
beegoTplFuncMap["Trans"] = i18n.I18nT
@@ -64,6 +67,7 @@ func I18nMoney(args ...interface{}) string {
```
## 多語言開發使用
1. 設定語言以及語言套件所在位置,然後初始化 i18n 物件:
```Go
beego.Lang = "zh"
@@ -98,6 +102,7 @@ beego.InitLang()
我們可以在 controller 中呼叫翻譯取得回應的翻譯語言,如下所示:
```Go
func (this *MainController) Get() {
@@ -106,6 +111,7 @@ func (this *MainController) Get() {
}
```
我們也可以在範本中直接呼叫回應的翻譯函式:
```Go
//直接文字翻譯