GitHub Desktop Chinese Localization Plugin
Paste the following prompt into your AI chat to install this skill:
Please follow the guide at https://skillhub.cn/install/skillhub.md to install @user_741dc82b/github-desktop-zh.
About this skill
Problem Background
GitHub Desktop is a popular graphical Git client, but it does not officially provide a Chinese language interface. For developers or teams accustomed to a Chinese environment, the English-only UI can hinder familiarity and operational efficiency. Manually modifying the official installation package is complex and error-prone, creating a need for a reliable, reversible method to localize the interface without compromising application stability.
How It Works
This skill automates the localization process through a script, with the following core workflow:
- Automatic Path and Mode Detection:
- The script first detects the operating system (Windows, macOS, or Linux) and automatically locates the GitHub Desktop installation directory.
- It identifies two common resource packaging modes:
loosemode: Resource files are stored as loose files in theresources\appdirectory (e.g.,main.js).asarmode: All resources are compressed into a singleresources\app.asarfile.
- Core Localization Execution:
- Intelligent Dictionary Loading: It uses a built-in Chinese-English dictionary mapping. The dictionary format requires one entry per line and supports version constraints via declarations like
# @gh-version: 3.*. - Hybrid Matching Replacement Strategy: To ensure accuracy, a two-layer matching approach is used:
- Literal Match First: It prioritizes exact matches of complete string literals enclosed in identical quotes (e.g.,
("Submit")or('Cancel')), which is the safest mode. - Substring Fallback: For source strings longer than 10 characters containing spaces (typically long UI text), if the literal match fails, it falls back to substring matching. This strategy effectively translates concatenated or dynamically generated text while minimizing the risk of false positives on variable names or comments.
- Literal Match First: It prioritizes exact matches of complete string literals enclosed in identical quotes (e.g.,
- Safe Replacement Order: The script strictly replaces strings in descending order of source string length. This prevents shorter strings (e.g., "a" or "go") from breaking matches in longer strings (e.g., "a long sentence") if processed first.
- End-to-End Safety and Verification Mechanisms:
- Automatic Backup and Rollback: It backs up target files before modification. The script retains the 5 most recent backups and automatically cleans older ones. During rollback, it also backs up the current file with a
.pre_rollback_*suffix, providing a double safeguard. - Post-Deployment Syntax Check: If
nodeis available in the environment, the script automatically runsnode --checkon all modified.jsfiles after replacement. It issues warnings if syntax errors are found, preventing application crashes due to improper substitution. - Clear Process Checkpoints: After each critical step—dependency check, detection, dictionary loading, unpacking, backup, and replacement—the script checks the output and exit code. Upon failure (printing
[ERROR]or a non-zero exit code), it immediately aborts and reports the specific reason to the user, such as a missingasartool or a detection failure requiring manual--srcspecification.
Caveats and Limitations
- Mode Dependencies: For
asarmode, the global installation of@electron/asar(vianpm install -g @electron/asar) is mandatory before execution. The script automatically checks for this dependency. - Customization and Override: While a built-in dictionary is provided, users can add or override translation entries via a custom dictionary file. Note that duplicate entries are automatically deduplicated, and custom dictionaries must follow the format recognized by the script.
- Runtime Environment: It is strongly recommended to completely exit GitHub Desktop before running the localization. Modifying core application files while it is running may lead to unpredictable conflicts or data corruption.
- Inherent Risks of File Modification: Despite backups and syntax checks, directly modifying application files carries inherent risks. It is advisable to first test on a backed-up copy or in a test environment.
- Limitations: This plugin focuses exclusively on replacing UI text strings and cannot handle images, layouts, or more complex internationalization (i18n) issues.
Use Cases
- When standardizing a team's workspace, executing batch or single localization on all members' GitHub Desktop clients to ensure a consistent interface.
- A solo developer wishes to quickly replace menus, buttons, and prompt text in GitHub Desktop with Chinese to reduce unfamiliarity with the tool.
- After localizing, discovering a translation error and needing to use the built-in rollback function to restore to a previous known-good backup state.
- When the default dictionary lacks specific project terminology, creating a custom dictionary file to add precise Chinese translations for these proprietary terms.
Best For
- Team lead for a non-native English-speaking development team, needing to standardize and simplify the language environment when team members use GitHub Desktop.
- Solo developer or small studio wanting to quickly and at minimal cost complete the interface localization for their personal development tool.
- Non-core staff unfamiliar with the command line and Git concepts, who rely on the GitHub Desktop GUI for daily code commits.
- QA engineer needing to temporarily modify GitHub Desktop's interface text for specific demonstrations or testing.
Related Skills
Supports inline SVG/HTML rendering and Mermaid code output, covering common technical diagram creation like architecture and flow diagrams.
A P8-level programming expert skill that follows a six-step closed-loop workflow, covering the full development lifecycle including code generation, review, and debugging for complex software projects.
Intelligently transforms natural language requests into editable professional online diagrams, supporting various types like flowcharts, architecture diagrams, etc.
This skill automatically generates skill packages compliant with the wx.modelContext specification from WeChat Mini Program source code, supporting source analysis, interface extraction, and code generation.