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

Localization and German translation #29

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PasteIntoFile/PasteIntoFile.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<EmbeddedResource Include="frmMain.resx">
<DependentUpon>frmMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.de.resx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down
27 changes: 16 additions & 11 deletions PasteIntoFile/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using PasteIntoFile.Properties;

namespace PasteAsFile
{
static class Program
{
public static readonly string RegistrySubKey = "Paste Into File";

/// <summary>
/// The main entry point for the application.
/// </summary>
Expand Down Expand Up @@ -50,16 +53,16 @@ public static void RegisterFilename(string filename)
{
try
{
var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
var key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey(RegistrySubKey);
key = key.CreateSubKey("filename");
key.SetValue("", filename);

MessageBox.Show("Filename has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Resources.str_message_register_filename_success, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
//throw;
MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

Expand All @@ -68,17 +71,17 @@ public static void UnRegisterApp()
try
{
var key = OpenDirectoryKey().OpenSubKey(@"Background\shell", true);
key.DeleteSubKeyTree("Paste Into File");
key.DeleteSubKeyTree(RegistrySubKey);

key = OpenDirectoryKey().OpenSubKey("shell", true);
key.DeleteSubKeyTree("Paste Into File");
key.DeleteSubKeyTree(RegistrySubKey);

MessageBox.Show("Application has been Unregistered from your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Resources.str_message_unregister_context_menu_success, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);

}
catch (Exception ex)
{
MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);

}
}
Expand All @@ -87,22 +90,24 @@ public static void RegisterApp()
{
try
{
var key = OpenDirectoryKey().CreateSubKey(@"Background\shell").CreateSubKey("Paste Into File");
var key = OpenDirectoryKey().CreateSubKey(@"Background\shell").CreateSubKey(RegistrySubKey);
key.SetValue("", Resources.explorer_context_entry);
key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
key = key.CreateSubKey("command");
key.SetValue("" , "\"" + Application.ExecutablePath + "\" \"%V\"");

key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey("Paste Into File");
key = OpenDirectoryKey().CreateSubKey("shell").CreateSubKey(RegistrySubKey);
key.SetValue("", Resources.explorer_context_entry);
key.SetValue("Icon", "\"" + Application.ExecutablePath + "\",0");
key = key.CreateSubKey("command");
key.SetValue("" , "\"" + Application.ExecutablePath + "\" \"%1\"");
MessageBox.Show("Application has been registered with your system", "Paste Into File", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show(Resources.str_message_register_context_menu_success, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);

}
catch (Exception ex)
{
//throw;
MessageBox.Show(ex.Message + "\nPlease run the application as Administrator !", "Paste As File", MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

Expand Down
176 changes: 175 additions & 1 deletion PasteIntoFile/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions PasteIntoFile/Properties/Resources.de.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>

<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">

</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="str_save" xml:space="preserve">
<value>Speichern</value>
</data>
<data name="str_message_register_filename_success" xml:space="preserve">
<value>Dateiname-Vorlage wurde registriert</value>
</data>
<data name="str_filename" xml:space="preserve">
<value>Dateiname</value>
</data>
<data name="str_extension" xml:space="preserve">
<value>Erweiterung</value>
</data>
<data name="str_file_saved" xml:space="preserve">
<value>Gespeichert :)</value>
</data>
<data name="str_message_first_time" xml:space="preserve">
<value>Es scheint als würdest du die Anwendung zum ersten Mal starten. Möchtest du einen Eintrag zum Kontextmenu des Explorers hinzufügen?</value>
</data>
<data name="str_location" xml:space="preserve">
<value>Speicherort</value>
</data>
<data name="str_select_folder" xml:space="preserve">
<value>Speicherort auswählen</value>
</data>
<data name="str_type_img" xml:space="preserve">
<value>Bilddatei</value>
</data>
<data name="str_type_txt" xml:space="preserve">
<value>Textdatei</value>
</data>
<data name="str_type_unknown" xml:space="preserve">
<value>Unbekannte Datei</value>
</data>
<data name="str_message_register_context_menu_success" xml:space="preserve">
<value>Eintrag im Kontextmenu wurde hinzugefügt</value>
</data>
<data name="str_message_run_as_admin" xml:space="preserve">
<value>Bitte die Anwendung als Administrator ausführen!</value>
</data>
<data name="str_message_unregister_context_menu_success" xml:space="preserve">
<value>Eintrag im Kontextmenu wurde entfernt</value>
</data>
<data name="explorer_context_entry" xml:space="preserve">
<value>Einfügen als Datei (Paste Into File)</value>
</data>
<data name="str_message_help" xml:space="preserve">
<value>Paste Into File speichert Texte und Bilder aus der Zwischenablage direkt als Datei.

--------------------

Komandozeilen-Argumente:
/reg Fügt den Eintrag dem Kontextmenu hinzu
/unreg Entfernt den Eintrag aus dem Kontextmenu
/filename XXX Stellt den Standard Dateinamen ein,
z.B. yyyy-MM-dd_HHmm

--------------------

https://github.com/EslaMx7/PasteIntoFile
Feedback an: [email protected]
Danke :)</value>
</data>
</root>
Loading