一键导入
i18n-standards
Standards and best practices for internationalization (i18n) in SecInterp
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Standards and best practices for internationalization (i18n) in SecInterp
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
This skill allows the agent to manage its own semantic memory, extracting lessons, patterns, and user preferences to improve long-term effectiveness.
Project coding standards, focused on the use of pathlib, Google docstrings, and strict typing.
Standards for handling drillhole data, section interpolation, and 3-level validation.
Standards for testing in a Dockerized environment and use of Mocks for QGIS.
Expert guide for QGIS 4.x migration and agnostic API usage
Standards for the custom SecInterp interface, focused on programmatic creation and premium aesthetics.
| name | i18n-standards |
| description | Standards and best practices for internationalization (i18n) in SecInterp |
This skill defines the standard workflow for maintaining, updating, and validating translations in the SecInterp project.
self.tr("...") (inside QObject classes) or QCoreApplication.translate("Context", "...").%s, .format(), f-strings with tr) instead of concatenation to allow for word reordering according to the target language's grammar.
self.tr("File %s not found") % filenameself.tr("File ") + filename + self.tr(" not found")To add multiple languages or perform bulk updates:
scripts/i18n/master_data/<lang>.json. It contains the Source: Translation map.# Generates/Syncs the .ts with the source code
./scripts/update-strings.sh "<lang>"
# Injects translations from JSON to .ts
python3 scripts/i18n/apply_full.py <lang> scripts/i18n/master_data/<lang>.json
lrelease i18n/SecInterp_<lang>.ts
For minor fixes or context review:
Use Qt Linguist on the .ts files in i18n/.
%1, %s, etc., intact.To test in QGIS:
# Compiles .ts to .qm binary
make trans-compile
The .qm files are generated alongside the .ts files and are loaded by SecInterp.initGui().
The i18n/sec_interp.pro file controls which files are scanned.
venv.core/, gui/, sec_interp_plugin.py..qm files (binary)..ts files (source) to reduce ZIP size.changelog in metadata.txt, escape the percent sign (%) as %% if used (e.g., "Completed 100%%").The qgis-plugin-ci tool may report false positives for "Partial Translation" if it detects docstrings as translatable strings.
sec_interp/
├── i18n/
│ ├── sec_interp.pro # lupdate configuration
│ ├── SecInterp_es.ts # Spanish source
│ ├── SecInterp_es.qm # Spanish binary (Generated)
│ └── ... (other languages)
├── resources.qrc # Should include .qm if used as resources (optional in QGIS)
└── Makefile # make trans-* commands
__init__.py or plugin.py)locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(self.plugin_dir, 'i18n', 'SecInterp_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
QCoreApplication.installTranslator(self.translator)