Skip to main content

Language table editor

Project description

UPLanguageTool

基于 Python + PyQt6 的多语言表格编辑工具,用于维护 .lang / .json 语言资源。

环境准备

poetry install

运行

poetry run uplanguagetool

核心功能

  • 支持打开与拖拽导入 .lang.json 文件
  • 支持按列(语言)与按行(key)进行增删改
  • 提供查找、复制/剪切/粘贴、清空、全选
  • 支持撤销/恢复历史记录
  • 右键菜单与工具栏均可执行主要操作

AI 翻译(DeepSeek)

当前 AI 翻译仅使用 DeepSeek 兼容接口。

工具栏 AI 菜单包含:

  • 配置翻译服务:选择 DeepSeek 预设并填写 API Key
  • 配置术语关键词:单独配置行业术语关键词(逗号或换行分隔)
  • 翻译选中单元格到本行其他语言:将当前选中单元格文本翻译到同一行其他语言列

注意:

  • 当前不提供“整列批量翻译全部行”入口
  • 同一行多目标语言翻译会优先使用单次多目标请求,以减少请求次数
  • 翻译在后台异步执行,并显示可取消进度窗口
  • 翻译写回支持撤销/恢复

翻译提示词策略

以下规则通过提示词约束实现,而非代码级强制改写:

  • 自动根据列名推断语言(如 en.jsonzh_cn.jsonja.lang
  • 目标语言为 zh-TW 时,要求使用台湾繁体中文表达(语义翻译,避免简体)
  • 字母类语言结果要求首字母大写
  • 保留占位符、转义序列与标记符号
  • 可注入术语关键词,增强行业术语一致性

AI 配置存储

AI 配置保存为用户目录下的 JSON 文件(不写入注册表):

  • 默认路径:~/.uplanguagetool/uplanguagetool.ai.json
  • UPLANGUAGETOOL_AI_CONFIG_FILE:指定完整配置文件路径
  • UPLANGUAGETOOL_AI_CONFIG_DIR:指定配置目录(文件名固定为 uplanguagetool.ai.json

测试

poetry run pytest

打包 EXE

poetry run pyinstaller UPLanguageTool.spec

输出文件位于 dist/UPLanguageTool.exe

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uplanguagetool-0.2.2.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uplanguagetool-0.2.2-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file uplanguagetool-0.2.2.tar.gz.

File metadata

  • Download URL: uplanguagetool-0.2.2.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for uplanguagetool-0.2.2.tar.gz
Algorithm Hash digest
SHA256 eab28f400e8e9596a3e6e66ff65530be58728f2f0a10910fcfd795794f4cad5d
MD5 28be4c0d0df2047f21f9c86f956b1d42
BLAKE2b-256 83f79a58a9bf5db50c8cf89fd169c6771b005848a67d62cb955526b0b68011bf

See more details on using hashes here.

File details

Details for the file uplanguagetool-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: uplanguagetool-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for uplanguagetool-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0e6d4977f28ba13555c6f3ffcc1733b65ffbbf3d88b7a19ec31ee7b65ecafd3d
MD5 2b0cb831ea62296934333e0e09933132
BLAKE2b-256 4c294fcc69c1ad1cedb3e03fda95725227da323f781af219f3b1c383fb01961a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page