Skip to content
Merged
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
36 changes: 36 additions & 0 deletions DistFiles/localization/Bloom.en.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,27 @@
<seg>If you need somewhere to put more information about the book, you can use this page, which is the outside of the back cover.</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.BloomPackInstallation">
<tuv xml:lang="en">
<seg>Bloom Pack Installation</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.BloomPackInstalled">
<tuv xml:lang="en">
<seg>The {0} Collection is now ready to use on this computer.</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.BloomPackInstaller">
<note>Displayed as the message box title</note>
<tuv xml:lang="en">
<seg>BloomPack Installer</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.DoesNotExist">
<tuv xml:lang="en">
<seg>{0} does not exist</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.ErrorInstallingBloomPack">
<tuv xml:lang="en">
<seg>Bloom was not able to install that Bloom Pack</seg>
Expand All @@ -146,11 +162,31 @@
<seg>Bloom is already running, but the contents will not show up until the next time you run Bloom</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.NotInstalled">
<tuv xml:lang="en">
<seg>The Bloom collection will not be installed.</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.Opening">
<tuv xml:lang="en">
<seg>Opening {0}...</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.Replace">
<tuv xml:lang="en">
<seg>This computer already has a Bloom collection named '{0}'. Do you want to replace it with the one from this BloomPack?</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.SingleCollectionFolder">
<tuv xml:lang="en">
<seg>Bloom Packs should have only a single collection folder at the top level of the zip file.</seg>
</tuv>
</tu>
<tu tuid="BloomPackInstallDialog.UnableToReplace">
<tuv xml:lang="en">
<seg>Bloom was not able to remove the existing copy of '{0}'. Quit Bloom if it is running &amp; try again. Otherwise, try again after restarting your computer.</seg>
</tuv>
</tu>
<tu tuid="Book title in {lang}">
<prop type="x-dynamic">true</prop>
<tuv xml:lang="en">
Expand Down

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

38 changes: 20 additions & 18 deletions src/BloomExe/Collection/BloomPack/BloomPackInstallDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ private void BeginInstall()
{
if (!File.Exists(_path))
{
Palaso.Reporting.ErrorReport.NotifyUserOfProblem("{0} does not exist", _path);
string msg = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.DoesNotExist", "{0} does not exist");
ErrorReport.NotifyUserOfProblem(msg, _path);
return;
}
using (var zip = new ZipFile(_path))
Expand All @@ -48,14 +49,15 @@ private void BeginInstall()
if (Directory.Exists(destinationFolder))
{
Logger.WriteEvent("BloomPack already exists, asking...");
var msg =
string.Format(
"This computer already has a Bloom collection named '{0}'. Do you want to replace it with the one from this BloomPack?",
_folderName);
if (DialogResult.OK != MessageBox.Show(msg, "BloomPack Installer", MessageBoxButtons.OKCancel))
string title = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.BloomPackInstaller",
"BloomPack Installer", "Displayed as the message box title");
string msg = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.Replace",
"This computer already has a Bloom collection named '{0}'. Do you want to replace it with the one from this BloomPack?");
msg = string.Format(msg, _folderName);
if (DialogResult.OK != MessageBox.Show(msg, title, MessageBoxButtons.OKCancel))
{
_message.Text = "The Bloom collection will not be installed.";
_okButton.Text = "&Cancel";
_message.Text = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.NotInstalled", "The Bloom collection will not be installed.");
_okButton.Text = L10NSharp.LocalizationManager.GetString("Common.CancelButton", "&Cancel");
return;
}
try
Expand All @@ -65,9 +67,8 @@ private void BeginInstall()
}
catch (Exception error)
{
throw new ApplicationException(string.Format(
"Bloom was not able to remove the existing copy of '{0}'. Quit Bloom if it is running & try again. Otherwise, try again after restarting your computer.",
destinationFolder), error);
string text = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.UnableToReplace", "Bloom was not able to remove the existing copy of '{0}'. Quit Bloom if it is running & try again. Otherwise, try again after restarting your computer.");
throw new ApplicationException(string.Format(text, destinationFolder), error);
}
}
zip.Close();
Expand Down Expand Up @@ -107,10 +108,11 @@ private string GetRootFolderName(ZipFile zip)
var parts = zipEntry.Name.Split(new[] { '/', '\\' });
if (fileName != null && fileName != parts[0])
{
string msg = "Bloom Packs should have only a single collection folder at the top level of the zip file.";
string msg = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.SingleCollectionFolder",
"Bloom Packs should have only a single collection folder at the top level of the zip file.");
_message.Text = msg;
pictureBox1.Image = _errorImage.Image;
_okButton.Text = "&Cancel";
_okButton.Text = L10NSharp.LocalizationManager.GetString("Common.CancelButton", "&Cancel");
return null;
}
fileName = parts[0];
Expand Down Expand Up @@ -196,17 +198,17 @@ private void _backgroundWorker_RunWorkerCompleted(object sender, RunWorkerComple
_errorImage.Visible = true;
_okButton.Text = L10NSharp.LocalizationManager.GetString("Common.CancelButton","&Cancel");
DesktopAnalytics.Analytics.ReportException(e.Error);
Palaso.Reporting.ErrorReport.NotifyUserOfProblem(e.Error, _message.Text);
ErrorReport.NotifyUserOfProblem(e.Error, _message.Text);
return;
}
var allDone = L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.BloomPackInstalled",
"The {0} Collection is now ready to use on this computer.");
"The {0} Collection is now ready to use on this computer.");
_message.Text = string.Format(allDone, _folderName);
if (Process.GetProcesses().Count(p => p.ProcessName.Contains("Bloom")) > 1)
{
_message.Text += System.Environment.NewLine + System.Environment.NewLine
+ L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.MustRestartToSee",
"Bloom is already running, but the contents will not show up until the next time you run Bloom");
_message.Text += Environment.NewLine + Environment.NewLine +
L10NSharp.LocalizationManager.GetString("BloomPackInstallDialog.MustRestartToSee",
"Bloom is already running, but the contents will not show up until the next time you run Bloom");
}
//Analytics.Track("Install BloomPack");
}
Expand Down
3 changes: 3 additions & 0 deletions src/BloomExe/Collection/BloomPack/BloomPackInstallDialog.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="_L10NSharpExtender.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>323, 17</value>
</metadata>
<metadata name="_backgroundWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>141, 21</value>
</metadata>
Expand Down
3 changes: 3 additions & 0 deletions src/BloomExe/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ static void Main(string[] args)
{
if (args.Length == 1 && args[0].ToLower().EndsWith(".bloompack"))
{
SetUpErrorHandling();
_applicationContainer = new ApplicationContainer();
SetUpLocalization();
var path = args[0];
// This allows local links to bloom packs.
if (path.ToLowerInvariant().StartsWith("bloom://"))
Expand Down