Skip to content

Commit

Permalink
String resource tidy up
Browse files Browse the repository at this point in the history
* Add info about installing KVM to use migrations commands to Database Error Page
* Removing 'refresh the page' <a> which was broken
* Fixing typos (all string run thru spell check - thought I had done this but evidently not)
* Fixing package description for SQL Server package
  • Loading branch information
rowanmiller committed Oct 30, 2014
1 parent b0da857 commit e51d851
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/EntityFramework.SqlServer/project.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "7.0.0-*",
"description": "SQLite data store for Entity Framework.",
"description": "Microsoft SQL Server data store for Entity Framework.",
"compilationOptions": {
"warningsAsErrors": true
},
Expand Down

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

18 changes: 12 additions & 6 deletions src/Microsoft.AspNet.Diagnostics.Entity/Properties/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<value>The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code. Skipping display of the database error page.</value>
</data>
<data name="DatabaseErrorPageMiddleware_Exception" xml:space="preserve">
<value>An exception occured while calculating the database error page content. Skipping display of the database error page.</value>
<value>An exception occurred while calculating the database error page content. Skipping display of the database error page.</value>
</data>
<data name="DatabaseErrorPage_AddMigrationCommand" xml:space="preserve">
<value>&gt; k ef migration add [migration name]</value>
Expand All @@ -142,22 +142,22 @@
<value>Applying Migrations...</value>
</data>
<data name="DatabaseErrorPage_ApplyMigrationsFailed" xml:space="preserve">
<value>An error occured applying migrations, try applying them from the command line</value>
<value>An error occurred applying migrations, try applying them from the command line</value>
</data>
<data name="DatabaseErrorPage_HowToApplyFromCmd" xml:space="preserve">
<value>You can also apply migrations from the command line</value>
<value>You can also apply migrations from the command line:</value>
</data>
<data name="DatabaseErrorPage_MigrationsAppliedRefresh" xml:space="preserve">
<value>Try refreshing the page</value>
</data>
<data name="DatabaseErrorPage_NoDbOrMigrationsInfo" xml:space="preserve">
<value>From the command line, scaffold a new migration and apply it to the database</value>
<value>From the command line, scaffold a new migration and apply it to the database:</value>
</data>
<data name="DatabaseErrorPage_NoDbOrMigrationsTitle" xml:space="preserve">
<value>Use migrations to create the database for {0}</value>
</data>
<data name="DatabaseErrorPage_PendingChangesInfo" xml:space="preserve">
<value>Scaffold a new migration for these changes and apply them to the database from the command line</value>
<value>Scaffold a new migration for these changes and apply them to the database from the command line:</value>
</data>
<data name="DatabaseErrorPage_PendingChangesTitle" xml:space="preserve">
<value>There are pending model changes for {0}</value>
Expand All @@ -184,7 +184,7 @@
<value>The context type '{0}' was not found in services. This usually means the context was not registered in services during startup. You probably want to call AddScoped&lt;{0}&gt;() inside the UseServices(...) call in your application startup code.</value>
</data>
<data name="MigrationsEndPointMiddleware_Exception" xml:space="preserve">
<value>An error occured while applying the migrations for '{0}'. See InnerException for details.</value>
<value>An error occurred while applying the migrations for '{0}'. See InnerException for details.</value>
</data>
<data name="MigrationsEndPointMiddleware_InvalidContextType" xml:space="preserve">
<value>The context type '{0}' could not be loaded. Ensure this is the correct type name for the context you are trying to apply migrations for.</value>
Expand All @@ -195,4 +195,10 @@
<data name="MigrationsEndPointMiddleware_RequestPathMatched" xml:space="preserve">
<value>Request path matched the path configured for this migrations endpoint ({0}). Attempting to process the migrations request.</value>
</data>
<data name="DatabaseErrorPage_Title" xml:space="preserve">
<value>A database operation failed while processing the request.</value>
</data>
<data name="DatabaseErrorPage_EnableMigrationsCommandsInfo" xml:space="preserve">
<value>To use migrations from a command prompt you will need to &lt;a href='http://go.microsoft.com/fwlink/?LinkId=518242'&gt;install K Version Manager (KVM)&lt;/a&gt;. Once installed, you can run migration commands from a standard command prompt in the project directory.</value>
</data>
</root>
96 changes: 59 additions & 37 deletions src/Microsoft.AspNet.Diagnostics.Entity/Views/DatabaseErrorPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ public override async Task ExecuteAsync()

#line default
#line hidden
WriteLiteral("\r\n </style>\r\n</head>\r\n<body>\r\n <h1>A database operartion failed while proce" +
"ssing the request.</h1>\r\n");
WriteLiteral("\r\n </style>\r\n</head>\r\n<body>\r\n <h1>");
#line 41 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_Title);

#line default
#line hidden
WriteLiteral("</h1>\r\n");
#line 42 "DatabaseErrorPage.cshtml"


Expand Down Expand Up @@ -176,8 +181,14 @@ public override async Task ExecuteAsync()

#line default
#line hidden
WriteLiteral(" </code>\r\n <hr />\r\n");
#line 62 "DatabaseErrorPage.cshtml"
WriteLiteral(" </code>\r\n <p><strong>");
#line 61 "DatabaseErrorPage.cshtml"
WriteLiteral(Strings.DatabaseErrorPage_EnableMigrationsCommandsInfo);

#line default
#line hidden
WriteLiteral("</strong></p>\r\n <hr />\r\n");
#line 63 "DatabaseErrorPage.cshtml"
}
else if (Model.PendingMigrations.Any())
{
Expand All @@ -186,73 +197,73 @@ public override async Task ExecuteAsync()
#line hidden

WriteLiteral(" <div>\r\n <h2>");
#line 66 "DatabaseErrorPage.cshtml"
#line 67 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name));

#line default
#line hidden
WriteLiteral("</h2>\r\n <p>");
#line 67 "DatabaseErrorPage.cshtml"
#line 68 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name));

#line default
#line hidden
WriteLiteral("</p>\r\n\r\n");
#line 69 "DatabaseErrorPage.cshtml"
#line 70 "DatabaseErrorPage.cshtml"


#line default
#line hidden

#line 69 "DatabaseErrorPage.cshtml"
#line 70 "DatabaseErrorPage.cshtml"
if (Model.Options.ListMigrations)
{

#line default
#line hidden

WriteLiteral(" <ul>\r\n");
#line 72 "DatabaseErrorPage.cshtml"
#line 73 "DatabaseErrorPage.cshtml"


#line default
#line hidden

#line 72 "DatabaseErrorPage.cshtml"
#line 73 "DatabaseErrorPage.cshtml"
foreach (var migration in Model.PendingMigrations)
{

#line default
#line hidden

WriteLiteral(" <li>");
#line 74 "DatabaseErrorPage.cshtml"
#line 75 "DatabaseErrorPage.cshtml"
Write(migration);

#line default
#line hidden
WriteLiteral("</li>\r\n");
#line 75 "DatabaseErrorPage.cshtml"
#line 76 "DatabaseErrorPage.cshtml"
}

#line default
#line hidden

WriteLiteral(" </ul>\r\n");
#line 77 "DatabaseErrorPage.cshtml"
#line 78 "DatabaseErrorPage.cshtml"
}

#line default
#line hidden

WriteLiteral("\r\n");
#line 79 "DatabaseErrorPage.cshtml"
#line 80 "DatabaseErrorPage.cshtml"


#line default
#line hidden

#line 79 "DatabaseErrorPage.cshtml"
#line 80 "DatabaseErrorPage.cshtml"
if (Model.Options.EnableMigrationCommands)
{

Expand All @@ -261,7 +272,7 @@ public override async Task ExecuteAsync()

WriteLiteral(" <p>\r\n <button id=\"applyMigrations\" onclick=\" A" +
"pplyMigrations() \">");
#line 82 "DatabaseErrorPage.cshtml"
#line 83 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsButton);

#line default
Expand All @@ -275,21 +286,21 @@ public override async Task ExecuteAsync()
applyMigrations.disabled = true;
applyMigrationsError.innerHTML = """";
applyMigrations.innerHTML = """);
#line 90 "DatabaseErrorPage.cshtml"
#line 91 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsButtonRunning);

#line default
#line hidden
WriteLiteral("\";\r\n\r\n var req = new XMLHttpRequest();\r\n " +
" req.open(\"POST\", \"");
#line 93 "DatabaseErrorPage.cshtml"
#line 94 "DatabaseErrorPage.cshtml"
Write(Model.Options.MigrationsEndPointPath.Value);

#line default
#line hidden
WriteLiteral("\", true);\r\n var params = \"context=\" + encodeURIComponent(\"" +
"");
#line 94 "DatabaseErrorPage.cshtml"
#line 95 "DatabaseErrorPage.cshtml"
Write(Model.ContextType.AssemblyQualifiedName);

#line default
Expand All @@ -302,19 +313,18 @@ public override async Task ExecuteAsync()
req.onload = function (e) {
if (req.status == 204) {
applyMigrations.innerHTML = """);
#line 101 "DatabaseErrorPage.cshtml"
#line 102 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsButtonDone);

#line default
#line hidden
WriteLiteral("\";\r\n applyMigrationsSuccess.innerHTML = \"<a href=\'" +
".\'>");
#line 102 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_MigrationsAppliedRefresh);
WriteLiteral("\";\r\n applyMigrationsSuccess.innerHTML = \"");
#line 103 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_MigrationsAppliedRefresh);

#line default
#line hidden
WriteLiteral(@"</a>"";
WriteLiteral(@""";
} else {
ErrorApplyingMigrations();
}
Expand All @@ -329,39 +339,45 @@ public override async Task ExecuteAsync()
function ErrorApplyingMigrations() {
applyMigrations.innerHTML = """);
#line 116 "DatabaseErrorPage.cshtml"
#line 117 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsButton);

#line default
#line hidden
WriteLiteral("\";\r\n applyMigrationsError.innerHTML = \"");
#line 117 "DatabaseErrorPage.cshtml"
#line 118 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsFailed);

#line default
#line hidden
WriteLiteral("\";\r\n applyMigrations.disabled = false;\r\n " +
" }\r\n </script>\r\n");
#line 121 "DatabaseErrorPage.cshtml"
#line 122 "DatabaseErrorPage.cshtml"
}

#line default
#line hidden

WriteLiteral("\r\n <p>");
#line 123 "DatabaseErrorPage.cshtml"
#line 124 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_HowToApplyFromCmd);

#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 124 "DatabaseErrorPage.cshtml"
#line 125 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommand);

#line default
#line hidden
WriteLiteral("</code>\r\n <hr />\r\n </div>\r\n");
#line 127 "DatabaseErrorPage.cshtml"
WriteLiteral("</code>\r\n <p><strong>");
#line 126 "DatabaseErrorPage.cshtml"
WriteLiteral(Strings.DatabaseErrorPage_EnableMigrationsCommandsInfo);

#line default
#line hidden
WriteLiteral("</strong></p>\r\n <hr />\r\n </div>\r\n");
#line 129 "DatabaseErrorPage.cshtml"
}
else if (Model.PendingModelChanges)
{
Expand All @@ -370,31 +386,37 @@ public override async Task ExecuteAsync()
#line hidden

WriteLiteral(" <div>\r\n <h2>");
#line 131 "DatabaseErrorPage.cshtml"
#line 133 "DatabaseErrorPage.cshtml"
Write(Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name));

#line default
#line hidden
WriteLiteral("</h2>\r\n <p>");
#line 132 "DatabaseErrorPage.cshtml"
#line 134 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_PendingChangesInfo);

#line default
#line hidden
WriteLiteral("</p>\r\n <code>");
#line 133 "DatabaseErrorPage.cshtml"
#line 135 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_AddMigrationCommand);

#line default
#line hidden
WriteLiteral("</code>\r\n <br />\r\n <code>");
#line 135 "DatabaseErrorPage.cshtml"
#line 137 "DatabaseErrorPage.cshtml"
Write(Strings.DatabaseErrorPage_ApplyMigrationsCommand);

#line default
#line hidden
WriteLiteral("</code>\r\n <hr />\r\n </div>\r\n");
WriteLiteral("</code>\r\n <p><strong>");
#line 138 "DatabaseErrorPage.cshtml"
WriteLiteral(Strings.DatabaseErrorPage_EnableMigrationsCommandsInfo);

#line default
#line hidden
WriteLiteral("</strong></p>\r\n <hr />\r\n </div>\r\n");
#line 141 "DatabaseErrorPage.cshtml"
}

#line default
Expand Down
Loading

0 comments on commit e51d851

Please sign in to comment.