Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect translation in zh_tw #831

Open
jim60105 opened this issue Dec 20, 2024 · 3 comments
Open

Incorrect translation in zh_tw #831

jim60105 opened this issue Dec 20, 2024 · 3 comments
Assignees
Labels
localization Localization/Translation

Comments

@jim60105
Copy link

<x:String x:Key="Text.Preference.AI.AnalyzeDiffPrompt" xml:space="preserve">分析變更差異提示詞</x:String>
<x:String x:Key="Text.Preference.AI.GenerateSubjectPrompt" xml:space="preserve">產生提交訊息提示詞</x:String>

「產生提交訊息提示詞」 means "Generating commit message prompt," which is not correct.
訊息 = message
標題/主題 = subject

「產生提交標題之提示詞」 would be a bit clearer since it is actually used to generate commit subject.

「分析變更差異提示詞」 can also change to 「分析變更差異之提示詞」for consistency.

@ChiahongHong
Copy link
Contributor

I was the one who translated it, so let me explain briefly:

The original text is Generate Subject Prompt, which you referred to as 產生提交標題之提示詞. However, if you check the default prompt, you'll notice that the actual term used is "commit message," though it has a 50-character limit, serving as the "subject":

GenerateSubjectPrompt = """
You are an expert developer specialist in creating commits messages.
Your only goal is to retrieve a single commit message.
Based on the provided user changes, combine them in ONE SINGLE commit message retrieving the global idea, following strictly the next rules:

I don’t have a particular preference for using either 標題 (subject) or 訊息 (message), as both should be clear and understandable.

I also have no strong opinion on whether or not to include the character in the phrasing.

@jim60105
Copy link
Author

var summarybuilder = new StringBuilder();
var bodyBuilder = new StringBuilder();
foreach (var change in _changes)
{
if (_cancelToken.IsCancellationRequested)
return "";
_onProgress?.Invoke($"Analyzing {change.Path}...");
var summary = GenerateChangeSummary(change);
summarybuilder.Append("- ");
summarybuilder.Append(summary);
summarybuilder.Append("(file: ");
summarybuilder.Append(change.Path);
summarybuilder.Append(")");
summarybuilder.AppendLine();
bodyBuilder.Append("- ");
bodyBuilder.Append(summary);
bodyBuilder.AppendLine();
}
if (_cancelToken.IsCancellationRequested)
return "";
_onProgress?.Invoke($"Generating commit message...");
var body = bodyBuilder.ToString();
var subject = GenerateSubject(summarybuilder.ToString());
return string.Format("{0}\n\n{1}", subject, body);

After delving deeper into the code, it is indeed used to generate commit subjects at line 64.


This is somewhat beyond the scope of this issue, but I think there is room for further optimization of this prompt.

For reference, this is the prompt I use myself. I have been using a similar one in another CodeGPT project for several months and it works well.

As Git Maestro, craft a razor-sharp PR title. Capture essence of changes in one imperative sentence with no colon. 60 chars max. Focus on impact, not details. Be specific yet high-level. Contains succinct description of the change containing an optional scope and a subject.

Make sure to use the Conventional Commits. Here are the labels you can choose from:

- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm, dockerfile)
- chore: Updating libraries, copyrights or other repo setting, includes updating dependencies.
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, GitHub Actions, Azure Pipeline)
- docs: Non-code changes, such as fixing typos or adding new documentation (example scopes: Markdown file)
- feat: a commit of the type feat introduces a new feature to the codebase
- fix: A commit of the type fix patches a bug in your codebase
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- test: Adding missing tests or correcting existing tests

REPLY IN THIS STYLE (This is just a sample for styling):

ci(base): add weekly schedule for base image build

@ChiahongHong
Copy link
Contributor

But line 61 actually displays Generating commit message Anyway, word choice is subjective, and I don’t have any strong preferences, so feel free to submit a PR to update the translation if needed.

SourceGit’s prompt is derived from CommitOllama. In my experience, prompts are like a "mystical art"—their effectiveness can vary depending on the project, and it’s often difficult to quantify objectively which one performs better. For this aspect, you might want to open a separate issue to discuss it with the author. But personally, I’ll give it a try. Thanks for sharing.

@love-linger love-linger self-assigned this Dec 24, 2024
@love-linger love-linger added the localization Localization/Translation label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
localization Localization/Translation
Projects
None yet
Development

No branches or pull requests

3 participants