Skip to content
Discussion options

You must be logged in to vote
i18n/
├─ locales/            
│  ├─ en.json          
│  └─ zh.json                 
└─ main.v     
{
  "hello": "Hello",
  "welcome": "Welcome to our service",
  "common": {
    "success": "Successfully",
    "msg": {
      "Failed": "Failed"
    }
  }
}


{
  "hello": "你好",
  "welcome": "欢迎使用我们的服务",
  "common": {
    "success": "成功",
    "msg": {
      "Failed": "失败"
    }
  }
}


module main

import os
import x.json2 as json
import veb
import time

// ------------------------- Context -------------------------
pub struct Context {
	veb.Context
pub mut:
	extra map[string]string = map[string]string{}
	i18n  &I18nStore        = unsafe { nil }
}

// ------------------------- I18n ------…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Avey777
Comment options

You must be logged in to vote
1 reply
@Avey777
Comment options

Comment options

You must be logged in to vote
1 reply
@Avey777
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants