Skip to content

Commit ebe8705

Browse files
committed
Merge pull request #1297 from INOPIAE/translationHotkeys
Translation
2 parents 80d5822 + 63716f5 commit ebe8705

File tree

4 files changed

+66
-6
lines changed

4 files changed

+66
-6
lines changed

RetailCoder.VBE/Common/Hotkeys/Hotkey.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void Attach()
5353

5454
if (key == Keys.None)
5555
{
56-
throw new InvalidOperationException("Invalid key.");
56+
throw new InvalidOperationException(Rubberduck.UI.RubberduckUI.CommonHotkey_InvalidKey);
5757
}
5858

5959
HookKey(key, shift);
@@ -63,7 +63,7 @@ public void Detach()
6363
{
6464
if (!IsAttached)
6565
{
66-
throw new InvalidOperationException("Hook is already detached.");
66+
throw new InvalidOperationException(Rubberduck.UI.RubberduckUI.CommonHotkey_HookDetached);
6767
}
6868

6969
User32.UnregisterHotKey(_hWndVbe, HotkeyInfo.HookId);
@@ -76,20 +76,20 @@ private void HookKey(Keys key, uint shift)
7676
{
7777
if (IsAttached)
7878
{
79-
throw new InvalidOperationException("Hook is already attached.");
79+
throw new InvalidOperationException(Rubberduck.UI.RubberduckUI.CommonHotkey_HookAttached);
8080
}
8181

8282
var hookId = (IntPtr)Kernel32.GlobalAddAtom(Guid.NewGuid().ToString());
8383
var success = User32.RegisterHotKey(_hWndVbe, hookId, shift, (uint)key);
8484
if (!success)
8585
{
86-
Debug.WriteLine("Hotkey ({0}) not registered.", key);
87-
//throw new Win32Exception("HotKey was not registered.");
86+
Debug.WriteLine(Rubberduck.UI.RubberduckUI.CommonHotkey_KeyNotRegistered, key);
87+
//throw new Win32Exception(Rubberduck.UI.RubberduckUI.CommonHotkey_KeyNotRegistered, key);
8888
}
8989

9090
HotkeyInfo = new HotkeyInfo(hookId, Combo);
9191
IsAttached = true;
92-
Debug.WriteLine("Hotkey '{0}' hooked successfully to command '{1}'", Key, Command.GetType());
92+
Debug.WriteLine("Hotkey '{0}' hooked successfully to command '{1}'", Key, Command.GetType()); //no translation needed for Debug.Writeline
9393
}
9494

9595
private static readonly IDictionary<char,uint> Modifiers = new Dictionary<char, uint>

RetailCoder.VBE/UI/RubberduckUI.Designer.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/RubberduckUI.de.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,4 +1459,16 @@ Allen Sternguckern, Likern &amp; Followern, für das warme Kribbeln
14591459
<data name="UnitTest_NewMethod_ErrorNotRaised" xml:space="preserve">
14601460
<value>Der erwartete Fehler wurde nicht gefunden</value>
14611461
</data>
1462+
<data name="CommonHotkey_InvalidKey" xml:space="preserve">
1463+
<value>Ungültiges Zeichen.</value>
1464+
</data>
1465+
<data name="CommonHotkey_HookDetached" xml:space="preserve">
1466+
<value>Hook ist nicht mehr aktiv.</value>
1467+
</data>
1468+
<data name="CommonHotkey_HookAttached" xml:space="preserve">
1469+
<value>Hook ist schon hinzugefügt.</value>
1470+
</data>
1471+
<data name="CommonHotkey_KeyNotRegistered" xml:space="preserve">
1472+
<value>Hotkey ({0}) ist nicht registriert.</value>
1473+
</data>
14621474
</root>

RetailCoder.VBE/UI/RubberduckUI.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,4 +1477,16 @@ All our stargazers, likers &amp; followers, for the warm fuzzies
14771477
<data name="UnitTest_NewMethod_ErrorNotRaised" xml:space="preserve">
14781478
<value>Expected error was not raised</value>
14791479
</data>
1480+
<data name="CommonHotkey_InvalidKey" xml:space="preserve">
1481+
<value>Invalid key.</value>
1482+
</data>
1483+
<data name="CommonHotkey_HookDetached" xml:space="preserve">
1484+
<value>Hook is already detached.</value>
1485+
</data>
1486+
<data name="CommonHotkey_HookAttached" xml:space="preserve">
1487+
<value>Hook is already attached.</value>
1488+
</data>
1489+
<data name="CommonHotkey_KeyNotRegistered" xml:space="preserve">
1490+
<value>Hotkey ({0}) not registered.</value>
1491+
</data>
14801492
</root>

0 commit comments

Comments
 (0)