github.com/kotovmak/go-admin@v1.1.1/adm/language.go (about)

     1  package main
     2  
     3  var langs = map[string]map[string]string{
     4  	"cn": {
     5  		"user login name": "用户登录名",
     6  		"user nickname":   "用户昵称",
     7  		"user password":   "用户密码",
     8  
     9  		"choose a driver":          "选择数据库驱动",
    10  		"sql address":              "连接地址",
    11  		"sql port":                 "端口",
    12  		"sql username":             "用户名",
    13  		"sql schema":               "Schema",
    14  		"sql database name":        "数据库名",
    15  		"sql file":                 "数据库文件地址",
    16  		"sql password":             "密码",
    17  		"choose table to generate": "选择要生成的表格",
    18  
    19  		"wrong config file path": "错误的配置文件路径",
    20  		"user record exists":     "用户记录已存在",
    21  		"empty tables":           "表格不能为空",
    22  
    23  		"tables to generate, use comma to split": "要生成权限的表格,用逗号分隔",
    24  
    25  		"no tables, you should build a table of your own business first.": "表格不能为空,请先创建您的业务表",
    26  		"no table is selected": "没有选择表格",
    27  
    28  		"set package name":     "设置包名",
    29  		"set connection name":  "设置连接",
    30  		"set file output path": "设置文件输出路径",
    31  
    32  		"generate permission records for tables": "是否生成表格权限",
    33  
    34  		"Query":                 "查询",
    35  		"Show Edit Form Page":   "编辑页显示",
    36  		"Show Create Form Page": "新建记录页显示",
    37  		"Edit":                  "编辑",
    38  		"Create":                "新建",
    39  		"Delete":                "删除",
    40  		"Export":                "导出",
    41  
    42  		"Use arrows to move, type to filter, enter to select": "使用方向键去移动,空格键选择,输入进行筛选",
    43  		"select all": "选择全部",
    44  		"Use arrows to move, space to select, type to filter": "使用方向键去移动,空格键选择,输入进行筛选",
    45  		"Add admin user success~~🍺🍺":                          "增加用户成功~~🍺🍺",
    46  		"Add table permissions success~~🍺🍺":                   "增加表格权限成功~~🍺🍺",
    47  		"Generate data table models success~~🍺🍺":              "生成数据模型文件成功~~🍺🍺",
    48  		"see the docs: ": "查看文档:",
    49  		"visit forum: ":  "访问论坛:",
    50  		"generating: ":   "生成中:",
    51  
    52  		"choose a theme":   "选择主题",
    53  		"choose language":  "选择语言",
    54  		"choose framework": "选择框架",
    55  		"choose a orm":     "选择一个ORM",
    56  		"none":             "不使用",
    57  		"Generate project template success~~🍺🍺":   "生成项目模板成功~~🍺🍺",
    58  		"1 Import and initialize database:":       "1 安装初始化数据库:",
    59  		"2 Execute the following command to run:": "2 执行以下命令运行:",
    60  		"3 Visit and login:":                      "3 访问并登陆:",
    61  		"4 See more in README.md":                 "4 在README.md中查看更多",
    62  		"account: admin  password: admin":         "账号:admin,密码:admin",
    63  		"Login: ":                                 "登陆:",
    64  		"Generate CRUD models: ":                  "生成CRUD模型:",
    65  
    66  		"GoAdmin CLI error: CLI has not supported MINGW64 for now, please use cmd terminal instead.": "GoAdmin CLI" +
    67  			"错误:目前不支持 MINGW64,请使用 CMD 终端。",
    68  		"Know more: http://discuss.go-admin.com/t/goadmin-cli-adm-does-not-support-git-bash-mingw64-for-now/77": "了解更多:" +
    69  			"http://discuss.go-admin.com/t/goadmin-cli-adm-git-bash-mingw64/22",
    70  
    71  		"port":        "端口",
    72  		"url prefix":  "路由前缀",
    73  		"module path": "模块路径",
    74  
    75  		"yes": "是",
    76  		"no":  "否",
    77  
    78  		"cn": "简体中文",
    79  		"en": "英文",
    80  		"jp": "日文",
    81  		"tc": "繁体中文",
    82  
    83  		"web.database settings":     "数据库设置",
    84  		"web.installation settings": "应用安装设置",
    85  		"web.application settings":  "应用设置",
    86  		"web.optional settings":     "可选设置",
    87  
    88  		"web.database type":     "数据库类型",
    89  		"web.database host":     "数据库主机",
    90  		"web.database user":     "数据库用户",
    91  		"web.database password": "数据库用户密码",
    92  		"web.database name":     "数据库名称",
    93  		"web.database file":     "数据库文件路径",
    94  		"web.database port":     "数据库端口",
    95  		"web.database schema":   "数据库Schema",
    96  
    97  		"web.theme":             "主题",
    98  		"web.language":          "语言",
    99  		"web.web framework":     "Web框架",
   100  		"web.module name":       "模块名",
   101  		"web.http port":         "HTTP 端口号",
   102  		"web.url prefix":        "路由前缀",
   103  		"web.website title":     "网站标题",
   104  		"web.login page logo":   "登录页面logo",
   105  		"web.sidebar logo":      "侧边栏logo",
   106  		"web.sidebar mini logo": "侧边栏缩小logo",
   107  		"web.use orm":           "使用 ORM",
   108  		"web.no use":            "不使用",
   109  		"web.input":             "输入",
   110  
   111  		"web.simplified chinese":  "简体中文",
   112  		"web.traditional chinese": "繁体中文",
   113  		"web.english":             "英文",
   114  		"web.japanese":            "日文",
   115  
   116  		"web.where the framework sql data install to":            "GoAdmin框架数据表安装位置。",
   117  		"web.the file path of sqlite3 database":                  "SQLite3 数据库文件路径。",
   118  		"web.please use absolute path when you start as service": "作为服务启动时,请使用绝对路径。",
   119  		"web.module name is the path of go module":               "模块名指在go module中的路径",
   120  		"web.port number which application will listen on":       "应用监听的端口号。",
   121  		"web.url prefix of the running application":              "运行访问的路由前缀。",
   122  
   123  		"web.official website":                 "官方网站",
   124  		"web.current version":                  "当前版本",
   125  		"web.goadmin web installation program": "GoAdmin Web安装程序",
   126  		"web.installation page":                "安装页面",
   127  		"web.install now":                      "立即安装",
   128  
   129  		"web.result":          "安装结果",
   130  		"web.ok":              "好的",
   131  		"web.wrong parameter": "错误的参数",
   132  		"web.install success": "安装成功~~🍺🍺",
   133  	},
   134  	"en": {
   135  		"cn": "Chinese",
   136  		"en": "English",
   137  		"jp": "Japanese",
   138  		"tc": "Traditional Chinese",
   139  
   140  		"web.database settings":     "Database Settings",
   141  		"web.installation settings": "Installation Settings",
   142  		"web.application settings":  "Application General Settings",
   143  		"web.optional Settings":     "Optional Settings",
   144  
   145  		"web.database type":     "Database Type",
   146  		"web.database host":     "Host",
   147  		"web.database user":     "User",
   148  		"web.database password": "Password",
   149  		"web.database name":     "Database Name",
   150  		"web.database file":     "Path",
   151  		"web.database port":     "port",
   152  		"web.database schema":   "Schema",
   153  
   154  		"web.theme":             "Theme",
   155  		"web.language":          "Language",
   156  		"web.web framework":     "Web Framework",
   157  		"web.module name":       "Module Name",
   158  		"web.http port":         "HTTP Port",
   159  		"web.url prefix":        "Url Prefix",
   160  		"web.website title":     "Website Title",
   161  		"web.login page logo":   "Login Page Logo",
   162  		"web.sidebar logo":      "SideBar Logo",
   163  		"web.sidebar mini logo": "SideBar Mini Logo",
   164  		"web.use orm":           "Use ORM",
   165  		"web.no use":            "No use",
   166  		"web.input":             "Input",
   167  
   168  		"web.simplified chinese":  "Simplified Chinese",
   169  		"web.traditional chinese": "Traditional Chinese",
   170  		"web.english":             "English",
   171  		"web.japanese":            "Japanese",
   172  
   173  		"web.where the framework sql data install to":            "Where the framework sql data will be installed to。",
   174  		"web.the file path of sqlite3 database. ":                "The file path of SQLite3 database. ",
   175  		"web.please use absolute path when you start as service": "Please use absolute path when you start as service.",
   176  		"web.module name is the path of go module":               "Module name is the path of go module.",
   177  		"web.port number which application will listen on":       "Port number which application will listen on.",
   178  		"web.url prefix of the running application":              "Url prefix of the running application.",
   179  
   180  		"web.official website":                 "Official Website",
   181  		"web.current version":                  "Current Version",
   182  		"web.goadmin web installation program": "GoAdmin Web Installation Program",
   183  		"web.installation page":                "Installation Page",
   184  		"web.install now":                      "Install GoAdmin",
   185  
   186  		"web.result":          "Installation Result",
   187  		"web.ok":              "Ok",
   188  		"web.wrong parameter": "Wrong parameter",
   189  		"web.install success": "Install Success~~🍺🍺",
   190  	},
   191  }
   192  
   193  var defaultLang = "en"
   194  
   195  func setDefaultLangSet(set string) {
   196  	if set != "" && (set == "cn" || set == "en") {
   197  		defaultLang = set
   198  	}
   199  }
   200  
   201  func local(lang string) func(string) string {
   202  	if _, ok := langs[defaultLang]; ok {
   203  		return func(msg string) string {
   204  			return langs[lang][msg]
   205  		}
   206  	}
   207  	return nil
   208  }
   209  
   210  func getWord(msg string) string {
   211  	if word, ok := langs[defaultLang][msg]; ok {
   212  		return word
   213  	}
   214  	return msg
   215  }