多语言登录页面 (Siemens Low-Code 9.6.0)
小艺001
2022.01.13 11:49发布于技术 - 前端与UI
2531

方案 多语言登录页面 (mendix 9.6.0)

完整工程项目mendix-solution-login-i18n

具体步骤

  • 复制js
    image.png
    进主题目录
    image.png

  • 修改login_i18n.js

// 从浏览器获取语言标识
if ('zh-CN' == navigator.language) {
  window.i18nMap = { "username": "用户名", "password": "密码", "loginButton": "Sign in", "http401": "The username or password you entered is incorrect.", "http404": "Server not found.", "http500": "An internal server error occurred.", "http503": "Service unavailable.", "httpdefault": "Sign in failed.", "http402": "The current license does not allow more users to sign in.", "http460": "You were signed out, because you signed in somewhere else.", "http419": "Your session has expired. Please enter your user name and password to continue working.", "goHomeButton": "Back to Homepage", "http403": "You don't have enough permissions to access this page. You may try to login as a different user.", "cancel": "Cancel", "loginHeader": "Sign in" }
} else {
  window.i18nMap = { "username": "User name", "password": "Password", "loginButton": "Sign in", "http401": "The username or password you entered is incorrect.", "http404": "Server not found.", "http500": "An internal server error occurred.", "http503": "Service unavailable.", "httpdefault": "Sign in failed.", "http402": "The current license does not allow more users to sign in.", "http460": "You were signed out, because you signed in somewhere else.", "http419": "Your session has expired. Please enter your user name and password to continue working.", "goHomeButton": "Back to Homepage", "http403": "You don't have enough permissions to access this page. You may try to login as a different user.", "cancel": "Cancel", "loginHeader": "Sign in" }
}

效果

chrome://settings/?search=语言

chrome://settings/?search=语言

image.png

image.png

Knut
点赞
收藏
手机查看
举报
1个评论
倒序看帖
仅看楼主
    b00595794976
    2022.07.14 12:39 发布
    #1
    首赞
    评论
    举报