Permalink
Browse files

* configure.in, Monsoon/Defines.cs, Monsoon/Defines.cs.in: Generate

  Defines.cs for prefix path required for gettext initialization.
* Monsoon/Main.cs: Initialize gettext with locales in application
  directory and a fallback to system locales.
* Monsoon/UnhandledExceptionDialog.cs, Monsoon/CreateTorrentDialog.cs,
  Monsoon/PeerTreeView.cs, Monsoon/PiecesTreeView.cs,
  Monsoon/FileTreeView.cs, Monsoon/RssManager/RssManagerDialog.cs,
  Monsoon/EditColumnsDialog.cs, Monsoon/TorrentTreeView.cs: Wrap
  messages with gettext calls.
* Monsoon/AboutDialog.cs: Fixed whitespace.

  Use Defines.ApplicatioName instead of hardcoded string.

  Added myself to authors.
* Monsoon/Monsoon.mdp: Synced project file.
* intltool-merge.in: Added missing file for I18N.
* po/de.po: Updated german translation.
* po/POTFILES.in: Added all source files that contain message strings.

svn path=/trunk/monsoon/; revision=99952
  • Loading branch information...
1 parent b6d827f commit e7858018fe2d913b5abba0bfe095022579d1f68e @meebey meebey committed Apr 6, 2008
View
@@ -1,3 +1,11 @@
+2008-04-06 Mirco Bauer <meebey@meebey.net>
+
+ * configure.in: Generate Defines.cs for prefix path required for gettext
+ initialization.
+ * intltool-merge.in: Added missing file for I18N.
+ * po/de.po: Updated german translation.
+ * po/POTFILES.in: Added all source files that contain message strings.
+
2008-04-05 Mario Sopena <mario.sopena@gmail.com>
* po/es.po, configure.in: Added spanish translation
View
@@ -3,21 +3,21 @@
namespace Monsoon
{
-
-
public class AboutDialog : Gtk.AboutDialog
{
-
public AboutDialog() : base()
{
- Name = "Monsoon";
- Authors = new String[]{"Alan McGovern (Library)",
- "Jared Hendry (Interface)"};
+ Name = Defines.ApplicationName;
+ Authors = new String[] {
+ "Alan McGovern (Library)",
+ "Jared Hendry (Interface)",
+ "Mirco Bauer (I18N integration)"
+ };
Version = Defines.Version;
this.TranslatorCredits = string.Format("{1}{0}{2}{0}{3}", Environment.NewLine,
_("French - Olivier Dufour"),
- _("German - Mirco Bauer"),
+ _("German - Mirco Bauer <meebey@meebey.net>"),
_("Spanish - Mario Sopena"));
this.WrapLicense = true;
License = @"Copyright (C) 2006-2008 Alan McGovern, Jared Hendry
View
@@ -1,3 +1,20 @@
+2008-04-06 Mirco Bauer <meebey@meebey.net>
+
+ * Defines.cs, Defines.cs.in: Generate Defines.cs for prefix path required
+ for gettext initialization.
+ * Main.cs: Initialize gettext with locales in application directory and a
+ fallback to system locales.
+ * UnhandledExceptionDialog.cs, CreateTorrentDialog.cs, PeerTreeView.cs,
+ PiecesTreeView.cs, FileTreeView.cs, RssManager/RssManagerDialog.cs,
+ EditColumnsDialog.cs, TorrentTreeView.cs: Wrap messages with gettext
+ calls.
+ * AboutDialog.cs: Fixed whitespace.
+
+ Use Defines.ApplicatioName instead of hardcoded string.
+
+ Added myself to authors.
+ * Monsoon.mdp: Synced project file.
+
2008-04-06 Jared Hendry <hendry.jared@gmail.com>
* MainWindow.cs: Move serialization out to Xml*Controllers
@@ -90,7 +90,7 @@ private void BuildTrackerWidgets()
trackerTreeView.Model = trackerListStore;
TreeViewColumn trackerColumn = new TreeViewColumn ();
- trackerColumn.Title = "Trackers";
+ trackerColumn.Title = _("Trackers");
CellRendererText trackerTextCell = new CellRendererText ();
trackerColumn.PackStart(trackerTextCell, true);
@@ -200,7 +200,7 @@ private void createTorrent()
creator.Announces[0].Add(s);
creator.Comment = Comment;
- creator.CreatedBy = "Monsoon";
+ creator.CreatedBy = Defines.ApplicationName;
creator.Path = SavePath;
@@ -260,6 +260,10 @@ protected virtual void OnFolderRadioButtonToggled (object sender, System.EventAr
protected virtual void OnFileRadioButtonToggled (object sender, System.EventArgs e)
{
}
-
+
+ private static string _(string s)
+ {
+ return Mono.Unix.Catalog.GetString(s);
+ }
}
}
View
@@ -1,79 +0,0 @@
-// Defines.cs created with MonoDevelop
-// User: buchan at 01:23 03/28/2008
-//
-// To change standard headers go to Edit->Preferences->Coding->Standard Headers
-//
-
-using System;
-using System.IO;
-
-namespace Monsoon
-{
- public class Defines
- {
- private static string BaseDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
- private static string AppSettingsPath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "monsoon");
-
- public static string ApplicationName
- {
- get { return "Monsoon"; }
- }
-
- public static string LogFile
- {
- get { return Path.Combine(AppSettingsPath, "monsoon.log"); }
- }
-
- public static string ConfigDirectory
- {
- get { return AppSettingsPath; }
- }
-
- public static string IconPath
- {
- get { return Path.Combine(BaseDirectory, "icons"); }
- }
-
- public static string SerializedTorrentSettings
- {
- get { return Path.Combine (AppSettingsPath, "torrents.xml"); }
- }
-
- public static string SerializedFastResume
- {
- get { return Path.Combine (AppSettingsPath, "fastresume.benc"); }
- }
-
- public static string SerializedLabels
- {
- get { return Path.Combine(AppSettingsPath, "labels.xml"); }
- }
-
- public static string SerializedRssFeeds
- {
- get { return Path.Combine (AppSettingsPath, "rssfeeds.xml"); }
- }
-
- public static string SerializedRssHistroy
- {
- get { return Path.Combine (AppSettingsPath, "rsshistory.xml"); }
- }
-
- public static string SerializedRssFilters
- {
- get { return Path.Combine (AppSettingsPath, "rssfilters.xml"); }
- }
-
- public static string TorrentFolder
- {
- get { return Path.Combine(AppSettingsPath, "torrents"); }
- }
-
- static Defines()
- {
- string[] parts = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString().Split('.');
- Version = parts[0] + '.' + parts[1];
- }
- public static readonly string Version;
- }
-}
View
@@ -0,0 +1,106 @@
+// Defines.cs created with MonoDevelop
+// User: buchan at 01:23 03/28/2008
+//
+// To change standard headers go to Edit->Preferences->Coding->Standard Headers
+//
+
+using System;
+using System.IO;
+
+namespace Monsoon
+{
+ public class Defines
+ {
+ private static string applicationDirectory;
+ private static string applicationDataDirectory;
+ private static string version;
+
+ public static string InstallPrefix {
+ get {
+ return "@PREFIX@";
+ }
+ }
+
+ public static string ApplicationName
+ {
+ get { return "Monsoon"; }
+ }
+
+ public static string LogFile
+ {
+ get { return Path.Combine(ApplicationDataDirectory, "monsoon.log"); }
+ }
+
+ public static string ConfigDirectory
+ {
+ get { return ApplicationDataDirectory; }
+ }
+
+ public static string IconPath
+ {
+ get { return Path.Combine(ApplicationDirectory, "icons"); }
+ }
+
+ public static string SerializedTorrentSettings
+ {
+ get { return Path.Combine (ApplicationDataDirectory, "torrents.xml"); }
+ }
+
+ public static string SerializedFastResume
+ {
+ get { return Path.Combine (ApplicationDataDirectory, "fastresume.benc"); }
+ }
+
+ public static string SerializedLabels
+ {
+ get { return Path.Combine(ApplicationDataDirectory, "labels.xml"); }
+ }
+
+ public static string SerializedRssFeeds
+ {
+ get { return Path.Combine (ApplicationDataDirectory, "rssfeeds.xml"); }
+ }
+
+ public static string SerializedRssHistroy
+ {
+ get { return Path.Combine (ApplicationDataDirectory, "rsshistory.xml"); }
+ }
+
+ public static string SerializedRssFilters
+ {
+ get { return Path.Combine (ApplicationDataDirectory, "rssfilters.xml"); }
+ }
+
+ public static string TorrentFolder
+ {
+ get { return Path.Combine(ApplicationDataDirectory, "torrents"); }
+ }
+
+ public static string ApplicationDirectory {
+ get {
+ return applicationDirectory;
+ }
+ }
+
+ public static string ApplicationDataDirectory {
+ get {
+ return applicationDataDirectory;
+ }
+ }
+
+ public static string Version {
+ get {
+ return version;
+ }
+ }
+
+ static Defines()
+ {
+ applicationDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);
+ applicationDataDirectory = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "monsoon");
+
+ Version ver = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
+ version = String.Format("{0}.{1}", ver.Major, ver.Minor);
+ }
+ }
+}
@@ -19,7 +19,7 @@ public EditColumnsDialog(TorrentTreeView torrentTreeView)
this.torrentTreeView = torrentTreeView;
- Title = "Edit columns";
+ Title = _("Edit columns");
Modal = true;
nameVisibleCheckButton.Active = torrentTreeView.nameColumn.Visible;
@@ -88,5 +88,9 @@ private void OnSizeVisibleToggled(object sender, EventArgs args)
torrentTreeView.sizeColumn.Visible = sizeVisibleCheckButton.Active;
}
+ private static string _(string s)
+ {
+ return Mono.Unix.Catalog.GetString(s);
+ }
}
}
View
@@ -97,8 +97,8 @@ private void BuildColumns ()
filenameColumn.Resizable = true;
priorityColumn.Title = "";
- filenameColumn.Title = "Filename";
- progressColumn.Title = "Progress";
+ filenameColumn.Title = _("Filename");
+ progressColumn.Title = _("Progress");
Gtk.CellRendererPixbuf priorityCell = new CellRendererPixbuf ();
Gtk.CellRendererText filenameCell = new CellRendererText ();
@@ -225,5 +225,10 @@ private void RenderProgress (Gtk.TreeViewColumn column, Gtk.CellRenderer cell, G
(cell as Gtk.CellRendererProgress).Value = 0;
(cell as Gtk.CellRendererProgress).Value = (int)torrentFile.BitField.PercentComplete;
}
+
+ private static string _(string s)
+ {
+ return Mono.Unix.Catalog.GetString(s);
+ }
}
}
View
@@ -31,6 +31,7 @@
using System;
using System.IO;
using System.Text;
+using System.Reflection;
using System.Runtime.InteropServices;
using Gtk;
@@ -95,7 +96,13 @@ public MainClass(string [] args)
GLib.Thread.Init();
}
- Mono.Unix.Catalog.Init("monsoon", "locale");
+ string localeDir = Path.Combine(Defines.ApplicationDirectory, "locale");
+ if (!Directory.Exists(localeDir)) {
+ localeDir = Path.Combine(Defines.InstallPrefix, "share");
+ localeDir = Path.Combine(localeDir, "locale");
+ }
+ Mono.Unix.Catalog.Init("monsoon", localeDir);
+ logger.Debug("Using locale data from: {0}", localeDir);
Console.WriteLine(_("Starting Monsoon"));
Application.Init("monsoon", ref args);
View
@@ -63,12 +63,9 @@
<File name="gtk-gui/Monsoon.EditColumnsDialog.cs" subtype="Code" buildaction="Compile" />
<File name="gtk-gui/Monsoon.CreateTorrentProgressDialog.cs" subtype="Code" buildaction="Compile" />
<File name="Menus/SpeedLimitMenu.cs" subtype="Code" buildaction="Compile" />
- <File name="Defines.cs" subtype="Code" buildaction="Compile" />
+ <File name="Defines.cs.in" subtype="Code" buildaction="Compile" />
<File name="monsoon.desktop" subtype="Code" buildaction="FileCopy" DeployService.TargetDirectoryId="Linux.DesktopApplications" />
<File name="Monsoon.exe.config" subtype="Code" buildaction="FileCopy" />
- <File name="TorrentSettingsModel.cs" subtype="Code" buildaction="Compile" />
- <File name="TorrentSettingsController.cs" subtype="Code" buildaction="Compile" />
- <File name="TorrentFileSettingsController.cs" subtype="Code" buildaction="Compile" />
<File name="TorrentFileSettingsModel.cs" subtype="Code" buildaction="Compile" />
<File name="Menus/SpeedMenuItem.cs" subtype="Code" buildaction="Compile" />
<File name="Settings/GconfSettingsStorage.cs" subtype="Code" buildaction="Compile" />
@@ -123,4 +120,4 @@
<AsmRefVar Name="REFERENCES" />
<ProjectRefVar Name="REFERENCES" />
</MonoDevelop.Autotools.MakefileInfo>
-</Project>
+</Project>
View
@@ -61,12 +61,12 @@ private void buildColumns()
seedingColumn = new TreeViewColumn();
interestedColumn = new TreeViewColumn();
- addressColumn.Title = "IP Address";
- clientColumn.Title = "Client";
- downColumn.Title = "DL Speed";
- upColumn.Title = "UP Speed";
- seedingColumn.Title = "Seeding";
- interestedColumn.Title = "Interested";
+ addressColumn.Title = _("IP Address");
+ clientColumn.Title = _("Client");
+ downColumn.Title = _("DL Speed");
+ upColumn.Title = _("UP Speed");
+ seedingColumn.Title = _("Seeding");
+ interestedColumn.Title = _("Interested");
addressColumn.Expand = true;
clientColumn.Expand = true;
@@ -149,6 +149,9 @@ private void RenderInterested (Gtk.TreeViewColumn column, Gtk.CellRenderer cell,
(cell as Gtk.CellRendererToggle).Active = peer.AmInterested;
}
-
+ private static string _(string s)
+ {
+ return Mono.Unix.Catalog.GetString(s);
+ }
}
}
Oops, something went wrong.

0 comments on commit e785801

Please sign in to comment.