页面多语言文案获取 #3

Closed
opened 2024-11-11 15:20:01 +08:00 by yunhorn · 9 comments
Owner

从多语言文案接口获取文案内容

https://smartoilets.net/openapi/api/configI18N/info/get?retainAlertTextReplaceCopy=true&siteName=twsc&mode=keyName&type=simplepage(项目name, 例如 simplepage)

{
    "msg": "success",
    "timestamp": 1731309528805,
    "data": {
        "simplepage": {
            "BabyCareNursery_out_of_service_notification": {
                "en": "BabyCareNursery_out_of_service_notification",
                "zh": "BabyCareNursery_out_of_service_notification",
                "tw": "BabyCareNursery_out_of_service_notification",
                "jap": "NONE"
            },
            "Female_Maintenance_service_notification": {
                "en": "Female_Maintenance_service_notification",
                "zh": "Female_Maintenance_service_notification",
                "tw": "Female_Maintenance_service_notification",
                "jap": "NONE"
            },
            "Male_Maintenance_service_notification": {
                "en": "Male_Maintenance_service_notification",
                "zh": "Male_Maintenance_service_notification",
                "tw": "Male_Maintenance_service_notification",
                "jap": "NONE"
            }
        }
    }
}

可以看到图中黄色大方块的内容需要多语言显示

98ec1f04dc70434fc38572679cb7bf8

确认一下动态化命名规范要如何填写,例如

<g id="STS__XXXXX" transform="translate(120 33)" data-url="https://smartoilets.net/openapi/api/configI18N/info/get?retainAlertTextReplaceCopy=true&siteName=twsc&mode=keyName&type=simplepage" data-method="GET" data-payload="CDATA">
            <text style="mix-blend-mode:normal;fill:#FFFFFF;font-family:Inter;font-size:33;font-weight:bold;">
              <tspan x="0" y="31.969">STS__XXXXX</tspan>

还需要考虑请求需要添加 Bearer token 认证

从多语言文案接口获取文案内容 https://smartoilets.net/openapi/api/configI18N/info/get?retainAlertTextReplaceCopy=true&siteName=twsc&mode=keyName&type=simplepage(项目name, 例如 simplepage) ```json { "msg": "success", "timestamp": 1731309528805, "data": { "simplepage": { "BabyCareNursery_out_of_service_notification": { "en": "BabyCareNursery_out_of_service_notification", "zh": "BabyCareNursery_out_of_service_notification", "tw": "BabyCareNursery_out_of_service_notification", "jap": "NONE" }, "Female_Maintenance_service_notification": { "en": "Female_Maintenance_service_notification", "zh": "Female_Maintenance_service_notification", "tw": "Female_Maintenance_service_notification", "jap": "NONE" }, "Male_Maintenance_service_notification": { "en": "Male_Maintenance_service_notification", "zh": "Male_Maintenance_service_notification", "tw": "Male_Maintenance_service_notification", "jap": "NONE" } } } } ``` 可以看到图中黄色大方块的内容需要多语言显示 ![98ec1f04dc70434fc38572679cb7bf8](/attachments/6c25ef21-757f-4ddd-b0fb-f53a1f29ad27) 确认一下动态化命名规范要如何填写,例如 ``` <g id="STS__XXXXX" transform="translate(120 33)" data-url="https://smartoilets.net/openapi/api/configI18N/info/get?retainAlertTextReplaceCopy=true&siteName=twsc&mode=keyName&type=simplepage" data-method="GET" data-payload="CDATA">             <text style="mix-blend-mode:normal;fill:#FFFFFF;font-family:Inter;font-size:33;font-weight:bold;">               <tspan x="0" y="31.969">STS__XXXXX</tspan> ``` 还需要考虑请求需要添加 Bearer token 认证
jeff was assigned by yunhorn 2024-11-11 15:22:43 +08:00
jeff was unassigned by yunhorn 2024-11-11 15:22:50 +08:00
jeff added the
done-waiting-confirmed
label 2024-11-21 12:50:06 +08:00
Owner

@liangyuanpeng @yunhorn
已經處理了, 可以驗收一下

@liangyuanpeng @yunhorn 已經處理了, 可以驗收一下
Author
Owner

是否支持接口 Bearer token 认证 @ginfone 相关命名规范信息都可以更新在这里

是否支持接口 Bearer token 认证 @ginfone 相关命名规范信息都可以更新在这里
Author
Owner

命名使用 STS_I18N_ 为前缀?

命名使用 STS_I18N_ 为前缀?
Author
Owner

附近厕所也需要显示多语言名称, 当前似乎没有去获取对应的厕所多语言数据

附近厕所也需要显示多语言名称, 当前似乎没有去获取对应的厕所多语言数据
yunhorn removed the
done-waiting-confirmed
label 2024-11-21 16:51:50 +08:00
Owner

因为是通用组件,考虑到每次组件使用都需要命名会太繁琐,因此此组件设计为无需组件命名,在需要使用多语言文案的地方,直接使用 {{i18n_key}} 即可。

因为是通用组件,考虑到每次组件使用都需要命名会太繁琐,因此此组件设计为无需组件命名,在需要使用多语言文案的地方,直接使用 {{i18n_key}} 即可。
Owner

目前没有添加 bearer token 认证

目前没有添加 bearer token 认证
Author
Owner

另外, http API 相关请求都应该有重试机制, 例如重试失败10次

另外, http API 相关请求都应该有重试机制, 例如重试失败10次
jeff added the
done-waiting-confirmed
label 2024-11-24 18:49:09 +08:00
Owner

附近厕位, 当前厕位 的多语言文案已增加

附近厕位, 当前厕位 的多语言文案已增加
Author
Owner

厕所名多语言显示需要等待 https://gitea.yunhorn.com/smartoilets-front/projects/issues/8 后验证,目前重叠不太好确认

厕所名多语言显示需要等待 https://gitea.yunhorn.com/smartoilets-front/projects/issues/8 后验证,目前重叠不太好确认
yunhorn removed the
done-waiting-confirmed
label 2024-11-27 15:58:07 +08:00
jeff added the
done-waiting-confirmed
label 2024-12-08 23:06:38 +08:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: smartoilets-front/projects#3
No description provided.