mirror of
https://gitee.com/johng/gf.git
synced 2024-12-04 13:18:01 +08:00
24 lines
411 B
Go
24 lines
411 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"github.com/gogf/gf/frame/g"
|
|
"github.com/gogf/gf/i18n/gi18n"
|
|
)
|
|
|
|
func main() {
|
|
var (
|
|
orderId = 865271654
|
|
orderAmount = 99.8
|
|
)
|
|
fmt.Println(g.I18n().Tf(
|
|
gi18n.WithLanguage(context.TODO(), `en`),
|
|
`{#OrderPaid}`, orderId, orderAmount,
|
|
))
|
|
fmt.Println(g.I18n().Tf(
|
|
gi18n.WithLanguage(context.TODO(), `zh-CN`),
|
|
`{#OrderPaid}`, orderId, orderAmount,
|
|
))
|
|
}
|