i18next / i18next-parser

Parse your code to extract translation keys/values and manage your catalog files
MIT License
480 stars 195 forks source link

TypeError: Cannot set property bold of [object String] which has only a getter #273

Closed geohuz closed 3 years ago

geohuz commented 3 years ago

🐛 Bug Report

A clear and concise description of what the bug is.

I'm getting the following error when running the i18next,

.config/yarn/global/node_modules/i18next-parser/dist/transform.js:242
        }} catch (err) {_didIteratorError2 = true;_iteratorError2 = err;} finally {try {if (!_iteratorNormalCompletion2 && _iterator2.return) {_iterator2.return();}} finally {if (_didIteratorError2) {throw _iteratorError2;}}}
                                                                                                                                                                                                        ^

TypeError: Cannot set property bold of [object String] which has only a getter

To Reproduce

A codesandbox example or similar or at least steps to reproduce the behavior:

// Paste your code here

and here is my translate.json file:

{
  "跌落消息": "Drop warning",
  "红点按钮消息": "RTLS button message",
  "发送按钮消息": "Send message",
  "任务消息": "Task message",
  "聚众": "Crowd",
  "人数上限": "Maximum",
  "缺员": "Vacancy",
  "人数下限": "Minimum",
  "滞留": "Stay time",
  "限时": "Limited time",
  "静止": "Still",
  "视频跟踪": "Video tracking",
  "无": "None",
  "禁出": "Keep-in",
  "禁入": "Keep-out",
  "在线总人数:": "Total online number: ",
  "退出": "Exit",
  "数据调用中": "Processing",
  "实时地图": "Real-time map",
  "消息中心": "Message centre",
  "项目仪表板": "Dashboard",
  "3d地图": "3D map",
  "轨迹回放": "Playback",
  "标签": "Tag",
  "定位对象组": "Tractables group",
  "定位对象类别": "Tractables category",
  "定位对象": "Tractables",
  "管理规则": "Management rules",
  "管理区域定义": "Define management zone",
  "规则违反情况": "Rule violation",
  "任务类别": "Category",
  "任务准备清单定义": "Define pre-task checklist",
  "任务内容表单定义": "Define task content",
  "调度计划": "Scheduling",
  "任务对象": "Task object",
  "下达任务": "Task execution",
  "任务执行报告": "Task execution report",
  "任务地图": "Task map",
  "行程分析": "Travel analysis",
  "报警分析": "Alarm analysis",
  "区域进出": "Zone activity",
  "用户/角色": "User/Role",
  "组织结构": "Organization",
  "同步红点数据": "Data sync",
  "管理定位对象": "Tractables management",
  "作业行为管理": "Operation management",
  "任务管理(设置)": "Task (setup)",
  "任务管理(下达)": "Task (execution)",
  "分析报表": "Analysis report",
  "选择报告起始时间": "Start time",
  "选择报告结束时间": "End time",
  "刷新数据": "Refresh",
  "姓名": "Name",
  "部门": "Department",
  "区域": "Zone",
  "进入时间": "Entry time",
  "离开时间": "Leave time",
  "时长": "Duration",
  "行程(米)": "Travel distance(m)",
  "静止时长(秒)": "Static time(s)",
  "区域进出报告": "Zone activity report",
  "进入次数": "Number of Entries",
  "入场详情": "Entry detail",
  "实时区域进出": "Real-time activity",
  "入场人员报告": "Entrance activity report",
  "部门名称": "Department",
  "确认操作": "Confirm",
  "表单定义": "Form definition",
  "字段名称": "Field name",
  "描述": "Description",
  "类型": "Type",
  "文本": "Text",
  "数字": "Numeric",
  "逻辑": "Logic",
  "输入选择项": "Choice list",
  "数据选择项": "Select data",
  "默认值": "Default",
  "必填": "Required",
  "输入格式": "Input format",
  "上下按钮": "Up and down button",
  "范围": "Range",
  "单选按钮": "Radio button",
  "最大值": "Maximum",
  "最小值": "Minimum",
  "文件上传": "File upload",
  "日期": "Date",
  "日期时间": "Date time",
  "文本块": "Text block",
  "密码": "Password",
  "颜色": "Colour",
  "添加列表值": "Add list of value",
  "值": "Value",
  "选择列表数据源": "Select data source",
  "编辑": "Edit",
  "新增": "New",
  "类别名称": "Category name",
  "广播者": "Announcer",
  "广播监听者": "Monitor",
  "资产": "Assets",
  "移动": "Mobile",
  "导航": "Navigation",
  "定位对象名称": "Tractable name",
  "添加": "Add",
  "围栏": "Zone",
  "围栏半径": "Zone radius",
  "激活围栏": "Active zone",
  "应用到所有的定位对象和组除了": "Everything except the listed",
  "高级选项": "Advanced option",
  "默认高度(m)": "Default height(m)",
  "定位对象类型": "Tractables type",
  "固定位": "Stationary",
  "更新间隔": "Update interval",
  "位置坐标x(m)": "Position coordinate X(m)",
  "位置坐标y(m)": "Position coordinate Y(m)",
  "低延时链路": "Proximity warning",
  "角色沿用组设置": "Inherit configuration from group",
  "角色": "Role",
  "向广播者报告": "Reports back to announcer",
  "覆盖距离": "Warning distance",
  "编辑定位对象": "Edit tractables",
  "保存": "Save",
  "覆盖角度": "Angle of coverage",
  "管理区域名称": "Zone name",
  "摄像头路径": "Camera directory",
  "是否属于视频区域": "Video zone?",
  "移动对象检测": "Moving object detection",
  "开启报警": "Enable alarm",
  "关闭报警": "Disable alarm",
  "生效时间": "Effective time",
  "开始时间": "Starting time",
  "结束时间": "Ending time",
  "是否跨天": "Cross-date?",
  "告警订阅": "Alarm subscription",
  "警告接收人": "Alarm receptions",
  "选择": "Select",
  "邮箱": "Mail box",
  "电话": "Telephone",
  "启用": "Enable",
  "是": "Yes",
  "否": "No",
  "提交": "Submit",
  "确认删除": "Delete confirmation",
  "确定": "Confirm",
  "取消": "Cancel",
  "围栏设计修改": "Zone design",
  "删除": "Delete",
  "区域名称": "Zone name",
  "定位区域": "Zone",
  "区域类型": "Zone category",
  "信息": "Information",
  "包含对象/组": "Include tractables/groups",
  "例外对象/组": "Exclude tractables/groups",
  "告警级别": "Severity",
  "报警": "Alarm",
  "出界检测": "Outbound detection",
  "进入检测": "Inbound detection",
  "操作": "Operation",
  "管理参数": "More...",
  "编辑围栏": "Edit zone",
  "通用": "General",
  "高级": "Advanced",
  "围栏类型": "Zone type",
  "围栏名称": "Zone name",
  "已启用": "Enabled",
  "已关闭": "Closed",
  "警告级别": "Severity",
  "自定义信息": "Custom information",
  "定位对象/组": "Tractables/groups",
  "不包括列表中的项目": "Everything except the listed",
  "只包括列表中的项目": "Only the listed",
  "活动调度": "Activity Schedule",
  "按调度": "By schedule",
  "24小时有效": "Valid for 24 hours",
  "启动": "Start",
  "停止": "Stop",
  "围栏设计": "Zone Design",
  "管理规则类别": "Rule category",
  "名称": "Name",
  "类别": "Category",
  "激活": "Active zone",
  "电子围栏类型不能为空": "Please select zone type",
  "围栏名称不能为空": "Please enter zone name",
  "电子围栏类型": "Zone type",
  "实时违规情况": "Real-time violations",
  "过去24小时违规报告": "24 hours violation report",
  "规则": "Rules",
  "人": "People",
  "进入区域对象": "Tractables in zone",
  "当前人数": "Current number",
  "时间戳": "Time stamp",
  "24小时报告": "24 hours report",
  "规则名称": "Rule name",
  "时间参数": "Time parameters",
  "人数参数": "Parameters",
  "规则时间段": "Rule period",
  "违规时间": "Violation time",
  "mac地址": "Mac address",
  "最后一次报告": "Last report",
  "电池": "Battery",
  "固件信息": "Firmware information",
  "登录": "Login",
  "用户名": "Username",
  "登录失败, 请检查用户名密码": "Login failed, please check username and password",
  "消息内容": "Message content",
  "跌落时间": "Fall time",
  "消除原因": "Reason to clear",
  "是否误报": "Right message?",
  "时间": "Time",
  "全部": "All",
  "发送消息": "Send message",
  "定位对象id": "Tractable id",
  "添加下级结构": "Add substructure",
  "编辑组织结构": "Edit organization",
  "删除节点": "Delete node",
  "以及子节点数据": "And child node data",
  "节点名称": "Node name",
  "的下级单位": "Subordinate",
  "该组织结构有下级组织结构,禁止删除": "This organizational structure has a subordinate organizational structure, it is prohibited to delete.",
  "好的": "OK",
  "组织结构名称": "Organization structure name",
  "上级组织结构": "Parent organization",
  "同步中": "Synchronizing",
  "完成": "Complete",
  "出错": "Error",
  "项目": "Location",
  "分区": "Sublocation",
  "同步": "Sync",
  "视频追踪": "Video tracking",
  "选择定位对象": "Tractables",
  "只显示视频区域": "Only display video zone",
  "显示围栏名称": "Display zone name",
  "当前在线人数:": "Online total number",
  "点击查看视频": "Click to view video",
  "暂无": "Null",
  "违规": "Violations",
  "今天": "Today",
  "昨天": "Yesterday",
  "本周至今": "Week to date",
  "本月至今": "Month to date",
  "自定义": "Custom",
  "周日": "Sunday",
  "周一": "Monday",
  "周二": "Tuesday",
  "周三": "Wednesday",
  "周四": "Thursday",
  "周五": "Friday",
  "超员": "Overcrowded",
  "定位对象总报警数": "Tractables alarms",
  "区域总报警数": "Area total alarms",
  "周天计报警数": "Weekly alarms",
  "围栏计报警数": "Zone alarms",
  "报警类型计报警数": "Zone type alarms",
  "总计报警": "Total alarms",
  "小时": "Hour",
  "日": "Day",
  "周": "Week",
  "月": "Month",
  "日期区间选择": "Select data",
  "重置": "Reset",
  "里程(米)": "Distance(m)",
  "千公里": "Thousand kilometers",
  "公里": "Kilometers",
  "米": "Meter",
  "天": "Day",
  "分钟": "Minute",
  "周六": "Saturday",
  "里程": "Distance",
  "定位对象总": "Tractables  ",
  "周天计": "Weekly ",
  "区域计": "Zone ",
  "定位对象小时": "Tractables hourly ",
  "缩放拖拽": "Zoom",
  "危险源管理": "Hazard management",
  "添加任务内容及标准": "Add task content and standards",
  "任务描述": "Task description",
  "任务目的": "Task purpose",
  "任务准备清单": "Pre-task checklist",
  "任务名称": "Task name",
  "每分钟": "every minute",
  "每隔2分钟": "every 2 minutes",
  "每2分钟 每2小时": "At every 2nd minute past every 2nd hour",
  "每小时在上午09到下午0559之间": "At minute 0 past every hour from 9 through 17",
  "上午0120": "At 01:20",
  "下午0220仅星期一": "At 14:20 on Monday",
  "上午0830星期一至星期五": "At 08:30 on every day-of-week from Monday through Friday",
  "下午0610每隔3天": "At 18:10 on every 3rd day-of-month",
  "上午12限每月2号": "At 00:00 on day-of-month 2",
  "双号": "At minute 0 past every hour from 8 through 18 on every 2nd day-of-month from 2 through 31",
  "单号": "At minute 0 past every hour from 8 through 18 on every 2nd day-of-month from 1 through 31",
  "每月": "At 00:00 on day-of-month 5",
  "隔月一次": "0 0 5 */2 *",
  "年度定期": "0 8-16 10-14 11 *",
  "任务": "Task",
  "任务组": "Task group",
  "调度": "Scheduling",
  "计划用时": "Planning time",
  "提醒时间(分钟)": "Reminder time (minutes)",
  "执行人": "Performer",
  "任务内容": "Content",
  "部门不能为空": "Please select department",
  "任务名称不能为空": "Please enter task name",
  "任务对象不能为空": "Please select task object",
  "执行人不能为空": "Please select performer",
  "调度表不能为空": "Please select scheduling time",
  "任务创建": "Create task",
  "新增任务": "New task",
  "任务计划用时": "Task planning time",
  "提醒间隔(分钟)": "Reminder time (minutes)",
  "调度表": "Schedule",
  "任务启用": "Enable task",
  "任务关闭": "Disable task",
  "查看": "View",
  "任务名称:": "Task name",
  "任务描述:": "Description",
  "计划开始时间:": "Plan start time",
  "状态:": "Status",
  "创建时间": "Create time",
  "计划开始时间": "Planning start time",
  "计划完成时间": "Planning completed time",
  "实际完成时间": "Actual completed time",
  "状态更新": "Task status",
  "任务完成": "Task completed",
  "任务提醒已发送": "Task reminder",
  "表单已填报": "Form submitted ",
  "任务完成状态": "Task completion status",
  "正常": "Normal",
  "异常": "Abnormal",
  "查看任务表单": "View task",
  "任务历史": "Task history",
  "电子围栏不能为空": "Please select zone",
  "任务内容不能为空": "Please select task content",
  "刷新": "Refresh",
  "任务准备清单类别": "Pre-task checklist type",
  "新增任务对象": "Add new task content",
  "电子围栏": "Zone",
  "任务对象重复提交": "Task object duplicated",
  "任务清单名称": "Task checklist name",
  "提交修改": "Submit",
  "加入到调度表": "Add to scheduling",
  "样例": "Sample",
  "调度备注": "Scheduling notes",
  "调度描述": "Scheduling description",
  "调度表达式": "Scheduling expression",
  "需要输入位置坐标": "Need to enter location coordinates",
  "需要输入半径": "Need to enter radius",
  "需要输入名字": "Need to enter name",
  "确认删除记录": "Need to delete record",
  "将要删除定位对象": "Will delete tractables",
  "绑定": "Assign",
  "从此定位对象新建": "Create tractables from",
  "别名": "Alias",
  "电量": "Battery",
  "组": "Group",
  "绑定/解绑": "Assign/Unassign",
  "解除绑定": "Unassign",
  "确认解除定位对象": "Are you sure you want to unassign trackable",
  "与标签": "With tag",
  "之间的绑定吗": "?",
  "解除": "Unassign",
  "标签绑定": "Tag assignment",
  "选择绑定对象": "Select assigned tractables",
  "的标签": "with tag",
  "业务信息": "More...",
  "新建定位对象": "New tractables",
  "身份证号码重复使用": "Duplicated ID",
  "定位对象-基础信息": "Tractables-general info",
  "新定位对象-基础信息": "New tractable-general info",
  "定位对象分类": "Tractables category",
  "人员": "People",
  "物体": "Object",
  "请选择定位对象分类": "Please select tractables category",
  "查看内部表单": "View internal forms",
  "您修改的表单为系统内部表单,请跟系统管理员确认。": "Please contact system admin.",
  "仍要修改": "Modify?",
  "移出组": "Remove from group",
  "将要删除定位对象组": "Will delete tractables group",
  "组名": "Group name",
  "自定义参数": "Custom parameters",
  "传感器集成": "Sensor integration",
  "特殊功能": "Extra function",
  "相关联定位对象": "Related tractables",
  "属于组": "tractables group",
  "编辑组": "Edit group",
  "定位对象数量": "Tractables number",
  "监听广播者": "Monitor",
  "运动轨迹": "Trajectory",
  "选择日期": "Select date",
  "楼层": "Area",
  "播放速度": "Speed",
  "用户": "User",
  "角色名称": "Role name",
  "管理员": "Administrator",
  "移动用户": "Mobile",
  "角色类型": "Role type",
  "后台管理用户": "Admin user",
  "移动端/定位对象": "Mobile/tractables",
  "后台超级管理员": "Superuser",
  "授权功能": "Authorization function",
  "授权": "Authorization",
  "角色功能菜单项目选择": "Select menu",
  "清除所有项目": "Clear all",
  "选择所有项目": "Select all",
  "功能项": "Function item",
  "从拖放结束开始绘制": "Start time"
}

Expected behavior

I don't know where is the problem.

A clear and concise description of what you expected to happen.

// Paste the expected results here

Your Environment

karellm commented 3 years ago

Nothing in the code calls bold. You need to provide actual reproduceable steps if you want help.

yleclanche commented 3 years ago

I had the same issue. I was translating a key called {t("cost:")} It interprets the : as a new module so it was generating an empty file called cost.json. When executing the command a second time, I had this error.

Maybe it would be better to have a warning or something in this case ?