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

Two console tabs if UI is not english #5916

Closed
deathaxe opened this issue Dec 15, 2018 · 10 comments
Closed

Two console tabs if UI is not english #5916

deathaxe opened this issue Dec 15, 2018 · 10 comments
Assignees
Milestone

Comments

@deathaxe
Copy link

What is the current behavior?

GitExtensions displays a "Console" tab next to the "Konsole" tab if the UI language is set to German. "Konsole" is empty while the real conemu is displayed under "Console"

grafik

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  1. Set UI language to German
  2. Restart GitExtensions
  3. Start working with a repos

What is the expected behavior?

Only one "Konsole" tab.

Environment you encounter the issue:

  • GitExtensions version: 3.0.0
  • GIT version: 2.20
  • OS version: Win10 x64 1803
  • .NET version: 4.7.2

Did this work in previous version of GitExtensions (which)?

2.51

@gerhardol
Copy link
Member

Cannot reproduce
image

@drewnoakes
Copy link
Member

@deathaxe are you using the option that shows the commit info tab elsewhere? Do the rest of your tabs look the same as @gerhardol's?

@gerhardol
Copy link
Member

Can reproduce if showing the Commit in the revision graph

@gerhardol gerhardol added this to the 3.1.0 milestone Dec 15, 2018
@drewnoakes
Copy link
Member

Thanks for verifying @gerhardol. Doesn't happen for me in English language.

This code looks interesting:

var tabPageCaption = _consoleTabCaption.Text;
var tabPageCreated = CommitInfoTabControl.TabPages.ContainsKey(tabPageCaption);
TabPage tabPage;
if (tabPageCreated)
{
tabPage = CommitInfoTabControl.TabPages[tabPageCaption];
}
else
{
const string imageKey = "Resources.IconConsole";
CommitInfoTabControl.ImageList.Images.Add(imageKey, Images.Console);
CommitInfoTabControl.Controls.Add(tabPage = new TabPage(tabPageCaption));
tabPage.Name = tabPageCaption;
tabPage.ImageKey = imageKey;
}

_consoleTabCaption is a TranslationString. The code might be deciding tabPageCreated is false and then creating a second console (with the English name?). Is it possible that the translation string changes its value over time? This doesn't directly explain why it would be related to Commit Info position.

@mstv
Copy link
Member

mstv commented Dec 15, 2018

I guess there must be some timing issue in FormBrowse. Maybe FillTerminalTab() is called by the constructor before the translations are loaded. This creates a not yet translated tab "Console" using the field TranslationString _consoleTabCaption. Later, e.g. by the hotkey command FocusGitConsole, the translated text from this field is used. I don't know when and how the translations are loaded.

@deathaxe
Copy link
Author

The tabs normally look the same way as @gerhardol's screenshot shows. This is the normal state after opening a repo. At some point the "Konsole" tab is created, while working at the repo. Just retried to reproduce, but haven't been able to find the trigger for the tab to be created.

My feeling says, there is a translated text being used to identify the tab at some point while an untranslated one is used normally.

@deathaxe
Copy link
Author

In general I'd expect the tab's caption to be translated as the others are as well. Hence "Konsole" would be the correct caption in german language.

@deathaxe
Copy link
Author

It seems to be triggered by interactive rebase operations at some point. After heavy git activity the second tab suddenly appears without me even to navigate to the console tab at all.

grafik

@RussKie
Copy link
Member

RussKie commented Dec 17, 2018

One of the first questions here - why your "Console" tab isn't in German to start with. I think once it is fixed, everything else will fall in place

drewnoakes added a commit to drewnoakes/gitextensions that referenced this issue Dec 19, 2018
Previously, the page's caption was used to look the page up via the
tab control. This change assigns the terminal tab page to its own field
so there's never any ambiguity.

It also converts the image registration to the standard approach.

Fixes gitextensions#5916
drewnoakes added a commit to drewnoakes/gitextensions that referenced this issue Dec 19, 2018
Previously, the page's caption was used to look the page up via the
tab control. This change assigns the terminal tab page to its own field
so there's never any ambiguity.

It also converts the image registration to the standard approach.

Fixes gitextensions#5916
@drewnoakes
Copy link
Member

I believe this to be fixed by #5951.

@ghost ghost assigned drewnoakes Dec 19, 2018
@ghost ghost added the status: ready label Dec 19, 2018
@ghost ghost removed the status: ready label Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants