feat: add a framework for translations #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #24
i18n / Overriding descriptions
The descriptions of the tools can be overridden by creating a github-mcp-server.json file in the same directory as the binary.
The file should contain a JSON object with the tool names as keys and the new descriptions as values.
For example:
You can create an export of the current translations by running the binary with the
--export-translations
flag.This flag will preserve any translations/overrides you have made, while adding any new translations that have been added to the binary since the last time you exported.
You can also use ENV vars to override the descriptions. The environment variable names are the same as the keys in the JSON file,
prefixed with
GITHUB_MCP_
and all uppercase.For example, to override the
TOOL_ADD_ISSUE_COMMENT_DESCRIPTION
tool, you can set the following environment variable:The JSON Dump
So far, I have drawn the line at descriptions, but parameters can easily be added, I just didn't want this PR to touch any more parts. This is the whole shebang:
Live example
tools/list
An example running with a file, and an env var: