[monitor] 监控类型名称i18n国际化支持
This commit is contained in:
@@ -1,24 +1,26 @@
|
||||
// 请参考:https://ng-alain.com/docs/i18n
|
||||
import { Platform } from '@angular/cdk/platform';
|
||||
import { registerLocaleData } from '@angular/common';
|
||||
import {Platform} from '@angular/cdk/platform';
|
||||
import {registerLocaleData} from '@angular/common';
|
||||
import ngEn from '@angular/common/locales/en';
|
||||
import ngZh from '@angular/common/locales/zh';
|
||||
import ngZhTw from '@angular/common/locales/zh-Hant';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {
|
||||
_HttpClient,
|
||||
AlainI18nBaseService,
|
||||
DelonLocaleService,
|
||||
en_US as delonEnUS,
|
||||
SettingsService,
|
||||
zh_CN as delonZhCn,
|
||||
zh_TW as delonZhTw,
|
||||
_HttpClient,
|
||||
AlainI18nBaseService
|
||||
zh_TW as delonZhTw
|
||||
} from '@delon/theme';
|
||||
import { AlainConfigService } from '@delon/util/config';
|
||||
import { enUS as dfEn, zhCN as dfZhCn, zhTW as dfZhTw } from 'date-fns/locale';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { en_US as zorroEnUS, NzI18nService, zh_CN as zorroZhCN, zh_TW as zorroZhTW } from 'ng-zorro-antd/i18n';
|
||||
import { Observable } from 'rxjs';
|
||||
import {AlainConfigService} from '@delon/util/config';
|
||||
import {enUS as dfEn, zhCN as dfZhCn, zhTW as dfZhTw} from 'date-fns/locale';
|
||||
import {NzSafeAny} from 'ng-zorro-antd/core/types';
|
||||
import {en_US as zorroEnUS, NzI18nService, zh_CN as zorroZhCN, zh_TW as zorroZhTW} from 'ng-zorro-antd/i18n';
|
||||
import {Observable, zip} from 'rxjs';
|
||||
import {map} from "rxjs/operators";
|
||||
import {Message} from "../../pojo/Message";
|
||||
|
||||
interface LangConfigData {
|
||||
abbr: string;
|
||||
@@ -92,7 +94,16 @@ export class I18NService extends AlainI18nBaseService {
|
||||
}
|
||||
|
||||
loadLangData(lang: string): Observable<NzSafeAny> {
|
||||
return this.http.get(`http://localhost:4200/assets/tmp/i18n/${lang}.json`);
|
||||
return zip(this.http.get(`http://localhost:4200/assets/tmp/i18n/${lang}.json`),this.http.get(`/i18n/${lang}`))
|
||||
.pipe(
|
||||
map(([langLocalData, langRemoteData]: [Record<string, string>, Message<any>]) => {
|
||||
let remote:Record<string, string> = langRemoteData.data;
|
||||
Object.keys(remote).forEach(key => {
|
||||
langLocalData[key] = remote[key];
|
||||
});
|
||||
return langLocalData;
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
use(lang: string, data: Record<string, unknown>): void {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</nz-breadcrumb-item>
|
||||
<nz-breadcrumb-item>
|
||||
<i nz-icon nzType="edit"></i>
|
||||
<span>修改 {{monitor.app}} 监控</span>
|
||||
<span>修改 {{'monitor.app.' + monitor.app | i18n}} 监控</span>
|
||||
</nz-breadcrumb-item>
|
||||
</nz-breadcrumb>
|
||||
<nz-divider></nz-divider>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</nz-breadcrumb-item>
|
||||
<nz-breadcrumb-item>
|
||||
<i nz-icon nzType="monitor"></i>
|
||||
<span>{{app?app.toUpperCase() : ""}} 监控列表</span>
|
||||
<span>{{'monitor.app.' + app | i18n}} 监控列表</span>
|
||||
</nz-breadcrumb-item>
|
||||
</nz-breadcrumb>
|
||||
<nz-divider></nz-divider>
|
||||
@@ -15,7 +15,7 @@
|
||||
<button nz-button nzType="primary">
|
||||
<a routerLink="/monitors/new" [queryParams]="{app: app}">
|
||||
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
|
||||
新增 {{app}}
|
||||
新增 {{'monitor.app.' + app | i18n}}
|
||||
</a>
|
||||
</button>
|
||||
<button nz-button nzType="primary" (click)="onEditMonitor()" >
|
||||
@@ -85,7 +85,7 @@
|
||||
<td nzAlign="center">
|
||||
<nz-tag nzColor="processing">
|
||||
<i nz-icon nzType="cloud"></i>
|
||||
<span>{{ data.app }}</span>
|
||||
<span>{{ 'monitor.app.' + data.app | i18n }}</span>
|
||||
</nz-tag>
|
||||
</td>
|
||||
<td nzAlign="center">{{ data.gmtUpdate? data.gmtUpdate : data.gmtCreate }}</td>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</nz-breadcrumb-item>
|
||||
<nz-breadcrumb-item>
|
||||
<i nz-icon nzType="plus-circle"></i>
|
||||
<span>新增 {{monitor.app}} 监控</span>
|
||||
<span>新增 {{'monitor.app.' + monitor.app | i18n}} 监控</span>
|
||||
</nz-breadcrumb-item>
|
||||
</nz-breadcrumb>
|
||||
<nz-divider></nz-divider>
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
{
|
||||
"menu": {
|
||||
"main": "主导航",
|
||||
"lang": "语言",
|
||||
"dashboard": "仪表盘",
|
||||
"search.placeholder": "搜索监控:名称、IP等",
|
||||
"fullscreen": "全屏",
|
||||
"fullscreen.exit": "退出全屏",
|
||||
"clear.local.storage": "清理本地缓存",
|
||||
"monitor": {
|
||||
"": "监控",
|
||||
"service": "应用服务监控",
|
||||
@@ -9,6 +14,13 @@
|
||||
"os": "操作系统监控",
|
||||
"mid": "中间件监控"
|
||||
},
|
||||
"account": {
|
||||
"": "个人页",
|
||||
"center": "个人中心",
|
||||
"settings": "个人设置",
|
||||
"trigger": "触发错误",
|
||||
"logout": "退出登录"
|
||||
},
|
||||
"alert": {
|
||||
"": "告警",
|
||||
"center": "告警中心",
|
||||
@@ -38,115 +50,6 @@
|
||||
"redis": "Redis"
|
||||
}
|
||||
},
|
||||
"menu.search.placeholder": "搜索监控:名称、IP等",
|
||||
"menu.fullscreen": "全屏",
|
||||
"menu.fullscreen.exit": "退出全屏",
|
||||
"menu.clear.local.storage": "清理本地缓存",
|
||||
"menu.lang": "语言",
|
||||
"menu.shortcut": "快捷菜单",
|
||||
"menu.widgets": "小部件",
|
||||
"menu.alain": "Alain",
|
||||
"menu.style": "样式",
|
||||
"menu.style.typography": "字体排印",
|
||||
"menu.style.gridmasonry": "瀑布流",
|
||||
"menu.style.colors": "色彩",
|
||||
"menu.delon": "Delon 类库",
|
||||
"menu.delon.form": "动态表单",
|
||||
"menu.delon.table": "简易表格",
|
||||
"menu.delon.util": "工具集",
|
||||
"menu.delon.print": "打印",
|
||||
"menu.delon.guard": "路由守卫",
|
||||
"menu.delon.cache": "字典缓存",
|
||||
"menu.delon.qr": "二维码",
|
||||
"menu.delon.acl": "基于角色访问控制",
|
||||
"menu.delon.downfile": "下载文件",
|
||||
"menu.delon.xlsx": "Excel操作",
|
||||
"menu.delon.zip": "本地解压缩",
|
||||
"menu.pro": "Antd Pro",
|
||||
"menu.form": "表单页",
|
||||
"menu.form.basicform": "基础表单",
|
||||
"menu.form.stepform": "分步表单",
|
||||
"menu.form.stepform.info": "分步表单(填写转账信息)",
|
||||
"menu.form.stepform.confirm": "分步表单(确认转账信息)",
|
||||
"menu.form.stepform.result": "分步表单(完成)",
|
||||
"menu.form.advancedform": "高级表单",
|
||||
"menu.list": "列表页",
|
||||
"menu.list.searchtable": "查询表格",
|
||||
"menu.list.basiclist": "标准列表",
|
||||
"menu.list.cardlist": "卡片列表",
|
||||
"menu.list.searchlist": "搜索列表",
|
||||
"menu.list.searchlist.articles": "搜索列表(文章)",
|
||||
"menu.list.searchlist.projects": "搜索列表(项目)",
|
||||
"menu.list.searchlist.applications": "搜索列表(应用)",
|
||||
"menu.profile": "详情页",
|
||||
"menu.profile.basic": "基础详情页",
|
||||
"menu.profile.advanced": "高级详情页",
|
||||
"menu.result": "结果页",
|
||||
"menu.result.success": "成功页",
|
||||
"menu.result.fail": "失败页",
|
||||
"menu.exception": "异常页",
|
||||
"menu.exception.not-permission": "403",
|
||||
"menu.exception.not-find": "404",
|
||||
"menu.exception.server-error": "500",
|
||||
"menu.account": "个人页",
|
||||
"menu.account.center": "个人中心",
|
||||
"menu.account.settings": "个人设置",
|
||||
"menu.account.trigger": "触发错误",
|
||||
"menu.account.logout": "退出登录",
|
||||
"menu.report": "报表",
|
||||
"menu.report.relation": "全屏关系图",
|
||||
"menu.extras": "扩展",
|
||||
"menu.extras.helpcenter": "帮助中心",
|
||||
"menu.extras.settings": "设置",
|
||||
"menu.extras.poi": "门店",
|
||||
"app.analysis.test": "工专路 {{no}} 号店",
|
||||
"app.analysis.introduce": "指标说明",
|
||||
"app.analysis.total-sales": "总销售额",
|
||||
"app.analysis.day-sales": "日销售额",
|
||||
"app.analysis.visits": "访问量",
|
||||
"app.analysis.visits-trend": "访问量趋势",
|
||||
"app.analysis.visits-ranking": "门店访问量排名",
|
||||
"app.analysis.day-visits": "日访问量",
|
||||
"app.analysis.week": "周同比",
|
||||
"app.analysis.day": "日同比",
|
||||
"app.analysis.payments": "支付笔数",
|
||||
"app.analysis.conversion-rate": "转化率",
|
||||
"app.analysis.operational-effect": "运营活动效果",
|
||||
"app.analysis.sales-trend": "销售趋势",
|
||||
"app.analysis.sales-ranking": "门店销售额排名",
|
||||
"app.analysis.all-year": "全年",
|
||||
"app.analysis.all-month": "本月",
|
||||
"app.analysis.all-week": "本周",
|
||||
"app.analysis.all-today": "今日",
|
||||
"app.analysis.search-users": "搜索用户数",
|
||||
"app.analysis.per-capita-search": "人均搜索次数",
|
||||
"app.analysis.online-top-search": "线上热门搜索",
|
||||
"app.analysis.the-proportion-of-sales": "销售额类别占比",
|
||||
"app.analysis.channel.all": "全部渠道",
|
||||
"app.analysis.channel.online": "线上",
|
||||
"app.analysis.channel.stores": "门店",
|
||||
"app.analysis.sales": "销售额",
|
||||
"app.analysis.traffic": "客流量",
|
||||
"app.analysis.table.rank": "排名",
|
||||
"app.analysis.table.search-keyword": "搜索关键词",
|
||||
"app.analysis.table.users": "用户数",
|
||||
"app.analysis.table.weekly-range": "周涨幅",
|
||||
"app.monitor.trading-activity": "活动实时交易情况",
|
||||
"app.monitor.total-transactions": "今日交易总额",
|
||||
"app.monitor.sales-target": "销售目标完成率",
|
||||
"app.monitor.remaining-time": "活动剩余时间",
|
||||
"app.monitor.total-transactions-per-second": "每秒交易总额",
|
||||
"app.monitor.activity-forecast": "活动情况预测",
|
||||
"app.monitor.efficiency": "券核效率",
|
||||
"app.monitor.ratio": "跳出率",
|
||||
"app.monitor.proportion-per-category": "各品类占比",
|
||||
"app.monitor.fast-food": "中式快餐",
|
||||
"app.monitor.western-food": "西餐",
|
||||
"app.monitor.hot-pot": "火锅",
|
||||
"app.monitor.waiting-for-implementation": "等待后期实现",
|
||||
"app.monitor.popular-searches": "热门搜索",
|
||||
"app.monitor.resource-surplus": "资源剩余",
|
||||
"app.monitor.fund-surplus": "补贴资金剩余",
|
||||
"app.lock": "锁屏",
|
||||
"app.login.message-invalid-credentials": "账户或密码错误(admin/ant.design)",
|
||||
"app.login.message-invalid-verification-code": "验证码错误",
|
||||
|
||||
Reference in New Issue
Block a user