Bug 1388789 - fix invalid format in appcacheutils.properties; r?pbro, flod
MozReview-Commit-ID: KvteeshxD9R
--- a/devtools/client/commandline/test/browser_cmd_appcache_invalid.js
+++ b/devtools/client/commandline/test/browser_cmd_appcache_invalid.js
@@ -49,17 +49,17 @@ function* spawnTest() {
"after http://sub1.test1.example.com/browser/devtools/client/" +
"commandline/test/browser_cmd_appcache_invalid_appcache.appcache. Unless " +
"the text in the manifest file is changed the cached version will be used " +
"instead at line 39.",
"browser_cmd_appcache_invalid_page3.html has cache-control set to no-store. " +
"This will prevent the application cache from storing the file at line 39.",
"http://example.com/logo.png points to a resource that is not available at line 40.",
"http://example.com/check.png points to a resource that is not available at line 41.",
- "Spaces in URIs need to be replaced with % at line 42.",
+ "Spaces in URIs need to be replaced with %20 at line 42.",
"http://example.com/cr oss.png points to a resource that is not available at line 42.",
"Asterisk (*) incorrectly used in the CACHE section at line 43. If a line " +
"in the NETWORK section contains only a single asterisk character, then " +
"any URI not listed in the manifest will be treated as if the URI was " +
"listed in the NETWORK section. Otherwise such URIs will be treated as " +
"unavailable. Other uses of the * character are prohibited",
"The SETTINGS section may only contain a single value, \u201cprefer-online\u201d or \u201cfast\u201d at line 47.",
"FALLBACK section line 50 (/section1/ /offline1.html) prevents caching of " +
--- a/devtools/client/locales/en-US/appcacheutils.properties
+++ b/devtools/client/locales/en-US/appcacheutils.properties
@@ -75,20 +75,22 @@ firstLineMustBeCacheManifest=The first line of the manifest must be “CACHE MANIFEST” at line %S.
# Parameters: %S is the line number where "CACHE MANIFEST" appears.
cacheManifestOnlyFirstLine2=“CACHE MANIFEST” is only valid on the first line but was found at line %S.
# LOCALIZATION NOTE (asteriskInWrongSection2): the associated cache manifest
# has an asterisk (*) in a section other than the NETWORK section. Parameters:
# %1$S is the section name, %2$S is the line number.
asteriskInWrongSection2=Asterisk (*) incorrectly used in the %1$S section at line %2$S. If a line in the NETWORK section contains only a single asterisk character, then any URI not listed in the manifest will be treated as if the URI was listed in the NETWORK section. Otherwise such URIs will be treated as unavailable. Other uses of the * character are prohibited.
-# LOCALIZATION NOTE (escapeSpaces): the associated cache manifest has a space
+# LOCALIZATION NOTE (escapeSpaces1): the associated cache manifest has a space
# in a URI. Spaces must be replaced with %20. Parameters: %S is the line
# number where this error occurs.
-escapeSpaces=Spaces in URIs need to be replaced with %20 at line %S.
+# %% will be displayed as a single % character (% is commonly used to define
+# format specifiers, so it needs to be escaped).
+escapeSpaces1=Spaces in URIs need to be replaced with %%20 at line %S.
# LOCALIZATION NOTE (slashDotDotSlashBad): the associated cache manifest has a
# URI containing /../, which is invalid. Parameters: %S is the line number
# where this error occurs.
slashDotDotSlashBad=/../ is not a valid URI prefix at line %S.
# LOCALIZATION NOTE (tooManyDotDotSlashes): the associated cache manifest has
# a URI containing too many ../ operators. Too many of these operators mean
--- a/devtools/client/shared/AppCacheUtils.jsm
+++ b/devtools/client/shared/AppCacheUtils.jsm
@@ -444,17 +444,17 @@ ManifestParser.prototype = {
if (this.currSection != "NETWORK" || text.length != 1) {
this._addError(this.currentLine, "asteriskInWrongSection2",
this.currSection, this.currentLine);
return;
}
}
if (/\s/.test(text)) {
- this._addError(this.currentLine, "escapeSpaces", this.currentLine);
+ this._addError(this.currentLine, "escapeSpaces1", this.currentLine);
text = text.replace(/\s/g, "%20");
}
if (text[0] == "/") {
if (text.substr(0, 4) == "/../") {
this._addError(this.currentLine, "slashDotDotSlashBad", this.currentLine);
} else {
this.uris.push(this._wrapURI(this.origin + text.substring(1)));
@@ -497,17 +497,17 @@ ManifestParser.prototype = {
let [ namespace, fallback ] = split;
if (namespace.indexOf("*") != -1) {
this._addError(this.currentLine, "fallbackAsterisk2", this.currentLine);
}
if (/\s/.test(namespace)) {
- this._addError(this.currentLine, "escapeSpaces", this.currentLine);
+ this._addError(this.currentLine, "escapeSpaces1", this.currentLine);
namespace = namespace.replace(/\s/g, "%20");
}
if (namespace.substr(0, 4) == "/../") {
this._addError(this.currentLine, "slashDotDotSlashBad", this.currentLine);
}
if (namespace.substr(0, 2) == "./") {