From 4329343b14a8f39595abd60180c32391bafec27c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=B0=E7=91=9E=E9=9B=BE=E9=87=8C?= Date: Sat, 2 Mar 2024 18:39:02 +0800 Subject: [PATCH] 1.Modified several instances of text without localization processing 2.Improved the translation template 3.Enhanced the Simplified Chinese translation --- labelme/app.py | 18 +- labelme/translate/empty.ts | 346 ++++++++++++++++++---------------- labelme/translate/zh_CN.qm | Bin 9420 -> 10007 bytes labelme/translate/zh_CN.ts | 370 ++++++++++++++++++++----------------- 4 files changed, 395 insertions(+), 339 deletions(-) diff --git a/labelme/app.py b/labelme/app.py index 8f194aa86..77987003e 100644 --- a/labelme/app.py +++ b/labelme/app.py @@ -288,19 +288,19 @@ def __init__( saveAuto.setChecked(self._config["auto_save"]) saveWithImageData = action( - text="Save With Image Data", + text=self.tr("Save With Image Data"), slot=self.enableSaveImageWithData, - tip="Save image data in label file", + tip=self.tr("Save image data in label file"), checkable=True, checked=self._config["store_data"], ) close = action( - "&Close", + self.tr("&Close"), self.closeFile, shortcuts["close"], "close", - "Close current file", + self.tr("Close current file"), ) toggle_keep_prev_mode = action( @@ -441,11 +441,11 @@ def __init__( enabled=False, ) removePoint = action( - text="Remove Selected Point", + text=self.tr("Remove Selected Point"), slot=self.removeSelectedPoint, shortcut=shortcuts["remove_selected_point"], icon="edit", - tip="Remove selected point from polygon", + tip=self.tr("Remove selected point from polygon"), enabled=False, ) @@ -492,7 +492,7 @@ def __init__( zoom = QtWidgets.QWidgetAction(self) zoomBoxLayout = QtWidgets.QVBoxLayout() - zoomLabel = QtWidgets.QLabel("Zoom") + zoomLabel = QtWidgets.QLabel(self.tr("Zoom")) zoomLabel.setAlignment(Qt.AlignCenter) zoomBoxLayout.addWidget(zoomLabel) zoomBoxLayout.addWidget(self.zoomWidget) @@ -564,11 +564,11 @@ def __init__( enabled=False, ) brightnessContrast = action( - "&Brightness Contrast", + self.tr("&Brightness Contrast"), self.brightnessContrast, None, "color", - "Adjust brightness and contrast", + self.tr("Adjust brightness and contrast"), enabled=False, ) # Group zoom controls into a list for easier toggling. diff --git a/labelme/translate/empty.ts b/labelme/translate/empty.ts index 4f608c115..643431f74 100644 --- a/labelme/translate/empty.ts +++ b/labelme/translate/empty.ts @@ -1,5 +1,5 @@ - + Canvas @@ -21,595 +21,623 @@ MainWindow - + Flags - + Polygon Labels - + Select label to start annotating for it. Press 'Esc' to deselect. - + Label List - + Search Filename - + File List - + &Quit - + Quit application - - &Open + + &Open + - + Open image or label file - - &Open Dir - - - - + Open Dir - + &Next Image - + Open next (hold Ctl+Shift to copy labels) - + &Prev Image - + Open prev (hold Ctl+Shift to copy labels) - - &Save + + &Save + - + Save labels to file - + &Save As - + Save labels to a different file - + &Delete File - + Delete current label file - + &Change Output Dir - + Change where annotations are loaded/saved - + Save &Automatically - + Save automatically - - &Close - - - - - Close current file + + Save With Image Data - - Polygon &Line Color + + Save image data in label file - - Choose polygon line color - - - - - Polygon &Fill Color + + &Close - - Choose polygon fill color + + Close current file - + Keep Previous Annotation - + Toggle "keep pevious annotation" mode - + Create Polygons - + Start drawing polygons - + Create Rectangle - + Start drawing rectangles - + Create Circle - + Start drawing circles - + Create Line - + Start drawing lines - + Create Point - + Start drawing points - + Create LineStrip - + Start drawing linestrip. Ctrl+LeftClick ends creation. - + + Create AI-Polygon + + + + + Start drawing ai_polygon. Ctrl+LeftClick ends creation. + + + + + Create AI-Mask + + + + + Start drawing ai_mask. Ctrl+LeftClick ends creation. + + + + Edit Polygons - + Move and edit the selected polygons - + Delete Polygons - + Delete the selected polygons - + Duplicate Polygons - + Create a duplicate of the selected polygons - + + Copy Polygons + + + + + Copy selected polygons to clipboard + + + + + Paste Polygons + + + + + Paste copied polygons + + + + Undo last point - + Undo last drawn point - - Add Point to Edge + + Remove Selected Point - - Add point to the nearest edge + + Remove selected point from polygon - - Undo + + Undo + - + Undo last add and edit of shape - + &Hide Polygons - + Hide all polygons - + &Show Polygons - + Show all polygons - + &Toggle Polygons - + Toggle all polygons - + &Tutorial - + Show tutorial page - + + Zoom + + + + Zoom in or out of the image. Also accessible with {} and {} from the canvas. - + Ctrl+Wheel - + Zoom &In - + Increase zoom level - + &Zoom Out - + Decrease zoom level - + &Original size - + Zoom to original size - - &Fit Window + + &Keep Previous Scale - - Zoom follows window size + + Keep previous zoom scale - - Fit &Width + + &Fit Window - - Zoom follows window width + + Zoom follows window size - - &Edit Label + + Fit &Width - - Modify the label of the selected polygon + + Zoom follows window width - + - - Shape &Line Color + + &Brightness Contrast - - Change the line color for this specific shape + + Adjust brightness and contrast - - Shape &Fill Color + + &Edit Label - - Change the fill color for this specific shape + + Modify the label of the selected polygon - + Fill Drawing Polygon - + Fill polygon while drawing - + &File - + &Edit - + &View - + &Help - + Open &Recent - + + AI Model + + + + %s started. - + Invalid label - + Invalid label '{}' with validation type '{}' - + Error saving label data - + <b>%s</b> - + Error opening file - + No such file: <b>%s</b> - + Loading %s... - + <p><b>%s</b></p><p>Make sure <i>%s</i> is a valid label file. - + Error reading %s - + <p>Make sure <i>{0}</i> is a valid image file.<br/>Supported image formats: {1}</p> - + Loaded %s - + Image & Label files (%s) - + %s - Choose Image or Label file - + %s - Save/Load Annotations in Directory - + %s . Annotations will be saved/loaded in %s - + %s - Choose File - + Label files (*%s) - + Choose File - + You are about to permanently delete this label file, proceed anyway? - + Attention - + Save annotations to "{}" before closing? - + Save annotations? - - Choose line color - - - - - Choose fill color - - - - + You are about to permanently delete {} polygons, proceed anyway? - + %s - Open Directory diff --git a/labelme/translate/zh_CN.qm b/labelme/translate/zh_CN.qm index daf21f992fd03bc331ce70544e48d99d5be50978..b8a688971f82ea8e2dfca8fb64f5342981cf5cee 100644 GIT binary patch delta 2126 zcmZ`&du&r>6hD34-rL9R*2k#ZXzw;2dxH*`;DoKiKqc!&Hy*>W(zTbaY<B&0AHph$3vI5$LypaB9%H24BxQvtzqH|P-KAI;78edqkn?{V5` zUT=vM9CGSU{r2A4FH@3_&Dr+h#oYiPSyXE)wwM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U8?K`JyE;|^q90td@Xr_=orWaZffI6ajK4|sWNA|Ym-Gs1{S9@68`{pZUrd- diff --git a/labelme/translate/zh_CN.ts b/labelme/translate/zh_CN.ts index 65a53fb4b..676fa61ac 100644 --- a/labelme/translate/zh_CN.ts +++ b/labelme/translate/zh_CN.ts @@ -1,5 +1,5 @@ - + Canvas @@ -21,595 +21,623 @@ MainWindow - + Flags 标记 - + Polygon Labels 多边形标签 - + Select label to start annotating for it. Press 'Esc' to deselect. 选择标签类型并开始以其标注。按'Esc'取消选择。 - + Label List 标签列表 - + Search Filename 按文件名检索 - + File List 文件列表 - + &Quit 退出(&Q) - + Quit application 退出应用 - - &Open + + &Open + 打开(&O) - + Open image or label file 打开图像或标签文件 - - &Open Dir - 打开目录(&O) - - - + Open Dir 打开目录 - + &Next Image 下一幅(&N) - + Open next (hold Ctl+Shift to copy labels) 打开下一幅 (按Ctl+Shift拷贝标签) - + &Prev Image 上一幅(&P) - + Open prev (hold Ctl+Shift to copy labels) 打开上一幅 (按Ctl+Shift拷贝标签) - - &Save + + &Save + 保存(&S) - + Save labels to file 保存标签到文件 - + &Save As 另存为(&S) - + Save labels to a different file 保存标签到不同的文件 - + &Delete File 删除(&D) - + Delete current label file 删除当前标签文件 - + &Change Output Dir 更改输出路径(&C) - + Change where annotations are loaded/saved 更改载入、保存标注的路径 - + Save &Automatically 自动保存(&A) - + Save automatically 自动保存 - - &Close - 关闭(&C) - - - - Close current file - 关闭当前文件 - - - - Polygon &Line Color - 多边形描边颜色(&L) + + Save With Image Data + 同时保存图像数据 - - Choose polygon line color - 选择多边形描边颜色 + + Save image data in label file + 将图像数据保存到标签文件中 - - Polygon &Fill Color - 多边形填充颜色(&F) + + &Close + 关闭(&C) - - Choose polygon fill color - 选择多边形填充颜色 + + Close current file + 关闭当前文件 - + Keep Previous Annotation 保留最后的标注 - + Toggle "keep pevious annotation" mode 开关“保留最后的标注”模式 - + Create Polygons 创建多边形 - + Start drawing polygons 开始绘制多边形 - + Create Rectangle 创建矩形 - + Start drawing rectangles 开始绘制矩形 - + Create Circle 创建圆形 - + Start drawing circles 开始绘制圆形 - + Create Line 创建直线 - + Start drawing lines 开始创建直线 - + Create Point 创建控制点 - + Start drawing points 开始绘制控制点 - + Create LineStrip 创建折线 - + Start drawing linestrip. Ctrl+LeftClick ends creation. 开始绘制折线。Ctrl+单击左键结束绘制。 - + + Create AI-Polygon + 创建AI多边形 + + + + Start drawing ai_polygon. Ctrl+LeftClick ends creation. + 开始绘制AI多边形。Ctrl+单击左键结束绘制。 + + + + Create AI-Mask + 创建AI蒙版 + + + + Start drawing ai_mask. Ctrl+LeftClick ends creation. + 开始绘制AI蒙版。Ctrl+单击左键结束绘制。 + + + Edit Polygons 编辑多边形 - + Move and edit the selected polygons 移动、编辑选中的多边形 - + Delete Polygons 删除多边形 - + Delete the selected polygons 删除选中的多边形 - + Duplicate Polygons 复制多边形 - + Create a duplicate of the selected polygons 为选中的多边形创建副本 - + + Copy Polygons + 复制多边形 + + + + Copy selected polygons to clipboard + 复制选中多边形到剪贴板 + + + + Paste Polygons + 粘贴多边形 + + + + Paste copied polygons + 粘贴已复制的多边形 + + + Undo last point 撤销最后的控制点 - + Undo last drawn point 撤销最后一次绘制的控制点 - - Add Point to Edge - 在边上加入控制点 + + Remove Selected Point + 移除选中的控制点 - - Add point to the nearest edge - 在最近的边上加一个控制点 + + Remove selected point from polygon + 从多边形中移除选中的控制点 - - Undo + + Undo + 撤销 - + Undo last add and edit of shape 撤销最近一次添加和编辑 - + &Hide Polygons 隐藏多边形(&H) - + Hide all polygons - 隐藏多边形(&H) + 隐藏所有多边形 - + &Show Polygons 显示多边形(&S) - + Show all polygons 显示所有多边形 - + &Toggle Polygons 开关多边形(&S) - + Toggle all polygons 开关所有多边形 - + &Tutorial 教程[&T] - + Show tutorial page 显示教程网页 - + + Zoom + 缩放 + + + Zoom in or out of the image. Also accessible with {} and {} from the canvas. 缩放图像。亦可从画布的{}和{}访问 - + Ctrl+Wheel Ctrl+滚轮 - + Zoom &In 放大(&I) - + Increase zoom level 增加缩放水平 - + &Zoom Out 缩小(&Z) - + Decrease zoom level 减小缩放水平 - + &Original size 原始大小(&O) - + Zoom to original size 缩放至原始大小 - + + &Keep Previous Scale + 保留最后的比例(&K) + + + + Keep previous zoom scale + 保留最后的缩放比例 + + + &Fit Window 适应窗口(&F) - + Zoom follows window size 跟随窗口大小缩放 - + Fit &Width 适应宽度(&W) - + Zoom follows window width 跟随窗口宽度缩放 + + + + &Brightness Contrast + 亮度 对比度(&B) + + + + Adjust brightness and contrast + 调节亮度和对比度 - + &Edit Label 编辑标签(&E) - + Modify the label of the selected polygon 修改选中多边形的标签 - - Shape &Line Color - 形状描边颜色(&L) - - - - Change the line color for this specific shape - 为此多边形修改描边颜色 - - - - Shape &Fill Color - 形状填充颜色(&F) - - - - Change the fill color for this specific shape - 为此多边形修改填充颜色 - - - + Fill Drawing Polygon 填充所绘多边形 - + Fill polygon while drawing 绘制时填充多边形 - + &File 文件(&F) - + &Edit 编辑(&E) - + &View 视图(&V) - + &Help 帮助(&H) - + Open &Recent 最近打开(&R) - + + AI Model + AI模型 + + + %s started. %s 启动完了 - + Invalid label 无效的标签 - + Invalid label '{}' with validation type '{}' 无效的标签'{}',验证类型'{}' - + Error saving label data 保存标签发生错误 - + <b>%s</b> <b>%s</b> - + Error opening file 打开文件发生错误 - + No such file: <b>%s</b> 文件不存在: <b>%s</b> - + Loading %s... 正在载入 %s... - + <p><b>%s</b></p><p>Make sure <i>%s</i> is a valid label file. <p><b>%s</b></p><p>请确认<i>%s</i>是一个合法的标签文件。 - + Error reading %s 打开文件发生错误 %s - + <p>Make sure <i>{0}</i> is a valid image file.<br/>Supported image formats: {1}</p> lt;p>请确认<i>{0}</i>是一个合法的图像文件。<br/>支持的格式包括: {1}</p> - + Loaded %s 已加载 %s - + Image & Label files (%s) 图像和标签文件(%s) - + %s - Choose Image or Label file %s - 选择图像或标签文件 - + %s - Save/Load Annotations in Directory %s - 保存和加载批注的路径 - + %s . Annotations will be saved/loaded in %s %s . 批注会被加载和保存在 %s - + %s - Choose File %s - 选择文件 - + Label files (*%s) 标签文件(*%s) - + Choose File 选择文件 - + You are about to permanently delete this label file, proceed anyway? 即将永久性删除此标签文件。还要继续吗? - + Attention 注意 - + Save annotations to "{}" before closing? 关闭前保存批注到"{}"吗? - + Save annotations? 保存批注吗? - - Choose line color - 选择描边颜色 - - - - Choose fill color - 选择填充颜色 - - - + You are about to permanently delete {} polygons, proceed anyway? 即将永久性删除多边形{}。还要继续吗? - + %s - Open Directory %s - 打开目录