Move translations initialization to SparkleUI and add translations to Mac UI

This commit is contained in:
Hylke Bons 2011-06-26 02:00:53 +01:00
parent d194415430
commit c9b56efb3a
5 changed files with 86 additions and 7 deletions

View file

@ -105,7 +105,7 @@ namespace SparkleLib {
config = config.Replace ("fetch = +refs/heads/*:refs/remotes/origin/*",
"fetch = +refs/heads/*:refs/remotes/origin/*" + Environment.NewLine +
"\tfetch = +refs/notes/*:refs/notes/*");
Console.WriteLine (">>>>>>>>>>>>>>>" + config);
// Add user info
string n = Environment.NewLine;
XmlDocument xml = new XmlDocument();

View file

@ -96,6 +96,81 @@
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="..\..\po\ar.po">
<Link>Translations\ar.po</Link>
</None>
<None Include="..\..\po\bg.po">
<Link>Translations\bg.po</Link>
</None>
<None Include="..\..\po\ca.po">
<Link>Translations\ca.po</Link>
</None>
<None Include="..\..\po\cs_CZ.po">
<Link>Translations\cs_CZ.po</Link>
</None>
<None Include="..\..\po\da.po">
<Link>Translations\da.po</Link>
</None>
<None Include="..\..\po\de.po">
<Link>Translations\de.po</Link>
</None>
<None Include="..\..\po\el.po">
<Link>Translations\el.po</Link>
</None>
<None Include="..\..\po\eo.po">
<Link>Translations\eo.po</Link>
</None>
<None Include="..\..\po\es.po">
<Link>Translations\es.po</Link>
</None>
<None Include="..\..\po\fi.po">
<Link>Translations\fi.po</Link>
</None>
<None Include="..\..\po\fr.po">
<Link>Translations\fr.po</Link>
</None>
<None Include="..\..\po\he.po">
<Link>Translations\he.po</Link>
</None>
<None Include="..\..\po\hu.po">
<Link>Translations\hu.po</Link>
</None>
<None Include="..\..\po\it.po">
<Link>Translations\it.po</Link>
</None>
<None Include="..\..\po\ja.po">
<Link>Translations\ja.po</Link>
</None>
<None Include="..\..\po\nl.po">
<Link>Translations\nl.po</Link>
</None>
<None Include="..\..\po\no_NO.po">
<Link>Translations\no_NO.po</Link>
</None>
<None Include="..\..\po\pl.po">
<Link>Translations\pl.po</Link>
</None>
<None Include="..\..\po\pt_BR.po">
<Link>Translations\pt_BR.po</Link>
</None>
<None Include="..\..\po\ru.po">
<Link>Translations\ru.po</Link>
</None>
<None Include="..\..\po\sv.po">
<Link>Translations\sv.po</Link>
</None>
<None Include="..\..\po\te.po">
<Link>Translations\te.po</Link>
</None>
<None Include="..\..\po\uk.po">
<Link>Translations\uk.po</Link>
</None>
<None Include="..\..\po\zh_CN.po">
<Link>Translations\zh_CN.po</Link>
</None>
<None Include="..\..\po\zh_TW.po">
<Link>Translations\zh_TW.po</Link>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
@ -170,12 +245,10 @@
<Content Include="..\..\data\icons\document-moved-12.png">
<Link>Pixmaps\document-moved-12.png</Link>
</Content>
<Content Include="..\..\data\html\jquery.js">
<Link>HTML\jquery.js</Link>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Pixmaps\" />
<Folder Include="HTML\" />
<Folder Include="Translations\" />
</ItemGroup>
</Project>

View file

@ -21,6 +21,7 @@ using System.Drawing;
using System.IO;
using System.Timers;
using Mono.Unix;
using MonoMac.Foundation;
using MonoMac.AppKit;
using MonoMac.ObjCRuntime;
@ -71,6 +72,11 @@ namespace SparkleShare {
Dlfcn.dlopen (growl_path, 0);
NSApplication.Init ();
// Use translations
Catalog.Init ("sparkleshare",
Path.Combine (NSBundle.MainBundle.ResourcePath, "Translations"));
using (NSAutoreleasePool pool = new NSAutoreleasePool ()) {
// Needed for Growl

View file

@ -45,9 +45,6 @@ namespace SparkleShare {
public static void Main (string [] args)
{
// Use translations
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
// Don't allow running as root on Linux or Mac
if ((SparkleBackend.Platform == PlatformID.Unix ||
SparkleBackend.Platform == PlatformID.MacOSX) &&

View file

@ -49,6 +49,9 @@ namespace SparkleShare {
// Initialize the application
Application.Init ();
// Use translations
Catalog.Init (Defines.GETTEXT_PACKAGE, Defines.LOCALE_DIR);
// Create the statusicon
StatusIcon = new SparkleStatusIcon ();