Updating built in COSES strings to match the new semantics (no 'data.' prefix required on variables)

This commit is contained in:
ian%hixie.ch 2002-04-06 19:29:13 +00:00
parent 31aa087dbd
commit 111c3af7cc
6 changed files with 17 additions and 17 deletions

View File

@ -223,7 +223,7 @@ sub getDefaultString {
my($app, $protocol, $string) = @_;
if ($protocol eq 'stdout') {
if ($string eq 'setup.newStringsReport') {
return ('COSES', '1', '<text>Note: The following strings have had their defaults updated since you last customised them:<br/><set variable="string" value="(data.oldStrings)" source="values" order="lexical"><text value="string (string.3) in variant (string.1)"/> (<text value="protocol (string.2)"/>): yours=<text value="(string.4)"/>, new=<text value="(string.5)"/><br/></set></text>')
return ('COSES', '1', '<text>Note: The following strings have had their defaults updated since you last customised them:<br/><set variable="string" value="(oldStrings)" source="values" order="lexical"><text value="string (string.3) in variant (string.1)"/> (<text value="protocol (string.2)"/>): yours=<text value="(string.4)"/>, new=<text value="(string.5)"/><br/></set></text>')
}
}
return; # nope, sorry

View File

@ -126,8 +126,8 @@ sub outputSetupProgress {
# dispatcher.output
sub strings {
return (
'setup' => 'The message given at the end of the setup command (only required for stdout, since it is the only way to trigger setup); data.failed is a boolean, data.result is the error message if any',
'setup.progress' => 'Progress messages given during setup (only required for stdout); data.component is a dotted hierarchical string giving progressively more detail about what is being set up. e.g., \'database\', \'database.default.settings\', \'database.default.settings.connection.port\'. If outputters are interpreting data.component then any trailing unknown levels of detail should be ignored.',
'setup' => 'The message given at the end of the setup command (only required for stdout, since it is the only way to trigger setup); failed is a boolean, result is the error message if any',
'setup.progress' => 'Progress messages given during setup (only required for stdout); component is a dotted hierarchical string giving progressively more detail about what is being set up. e.g., \'database\', \'database.default.settings\', \'database.default.settings.connection.port\'. If outputters are interpreting component then any trailing unknown levels of detail should be ignored.',
);
}
@ -137,9 +137,9 @@ sub getDefaultString {
my($app, $protocol, $string) = @_;
if ($protocol eq 'stdout') {
if ($string eq 'setup') {
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses"><if lvalue="(data.failed)" condition="=" rvalue="1">Can\'t continue: argument <text value="(data.result)"/> is missing.</if><else>Succeeded!</else><br/></text>');
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses"><if lvalue="(failed)" condition="=" rvalue="1">Can\'t continue: argument <text value="(result)"/> is missing.</if><else>Succeeded!</else><br/></text>');
} elsif ($string eq 'setup.progress') {
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">Setup: configuring <text value="(data.component)"/>...<br/></text>');
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">Setup: <text value="(component)"/>...<br/></text>');
}
}
return; # nope, sorry

View File

@ -340,10 +340,10 @@ sub outputCosesEditorExport {
# dispatcher.output
sub strings {
return (
'cosesEditor.index' => 'The COSES editor index. The data.variants hash (variant ID => hash with keys name, protocol, quality, type, encoding, charset, language, description, and translator) should be sorted by the data.variantsSortColumn, and the data.strings hash (name=>description) should be sorted by the data.stringsSortColumn (these are typically set by the cosesEditor.variantsSortColumn and cosesEditor.stringsSortColumn arguments). Typical commands that this should lead to: cosesVariantAdd (optional cosesEditor.variantProtocol), cosesVariantEdit (cosesEditor.variantID), cosesStringEdit (cosesEditor.stringID), cosesVariantExport (cosesEditor.variantID), cosesVariantImport (cosesEditor.importData, the contents of an XML file)',
'cosesEditor.index' => 'The COSES editor index. The variants hash (variant ID => hash with keys name, protocol, quality, type, encoding, charset, language, description, and translator) should be sorted by the variantsSortColumn, and the strings hash (name=>description) should be sorted by the stringsSortColumn (these are typically set by the cosesEditor.variantsSortColumn and cosesEditor.stringsSortColumn arguments). Typical commands that this should lead to: cosesVariantAdd (optional cosesEditor.variantProtocol), cosesVariantEdit (cosesEditor.variantID), cosesStringEdit (cosesEditor.stringID), cosesVariantExport (cosesEditor.variantID), cosesVariantImport (cosesEditor.importData, the contents of an XML file)',
'cosesEditor.variant' => 'The COSES variant editor. The data hash contains: protocol, quality, type, encoding, charset, language, description and translator (hereon "the variant data"), variant, an expectedStrings hash (name=>description), and a variantStrings hash (name=>[type,version,value]). The two hashes are likely to overlap. Typical commands that this should lead to: cosesVariantCommit and cosesVariantAddString (cosesEditor.variantID, cosesEditor.variantX where X is each of the variant data, cosesEditor.variantString.N.name, cosesEditor.variantString.N.type, cosesEditor.variantString.N.version, and cosesEditor.variantString.N.value where N is a number from 0 to as high as required, and cosesEditor.string.new.name, cosesEditor.string.new.type, cosesEditor.string.new.version and cosesEditor.variantString.new.value)',
'cosesEditor.string' => 'The COSES string editor. The name of the string being edited and its description are in data.string and data.description. The data.expectedVariants contains a list of all variants (variant ID => hash with keys name, protocol, quality, type, encoding, charset, language, description, and translator), and data.stringVariants hosts the currently set strings (variant=>value). The main command that this should lead to is: cosesStringCommit (cosesEditor.stringID, cosesEditor.stringVariant.N.name, cosesEditor.stringVariant.N.type, cosesEditor.stringVariant.N.version and cosesEditor.stringVariant.N.value where N is a number from 0 to as high as required)',
'cosesEditor.export' => 'The COSES variant export feature. data.variant holds the id of the variant, and data.output holds the XML representation of the variant.',
'cosesEditor.string' => 'The COSES string editor. The name of the string being edited and its description are in string and description. The expectedVariants contains a list of all variants (variant ID => hash with keys name, protocol, quality, type, encoding, charset, language, description, and translator), and stringVariants hosts the currently set strings (variant=>value). The main command that this should lead to is: cosesStringCommit (cosesEditor.stringID, cosesEditor.stringVariant.N.name, cosesEditor.stringVariant.N.type, cosesEditor.stringVariant.N.version and cosesEditor.stringVariant.N.value where N is a number from 0 to as high as required)',
'cosesEditor.export' => 'The COSES variant export feature. variant holds the id of the variant, and output holds the XML representation of the variant.',
);
}

View File

@ -243,11 +243,11 @@ sub outputLoginDetails {
# dispatcher.output
sub strings {
return (
'login.accessDenied' => 'Displayed when the user does not have the requisite right (namely, data.right).',
'login.failed' => 'Displayed when the user has not logged in (data.tried is false) or when the credentials were wrong (data.tried is true). A message may be given in data.message.',
'login.accessDenied' => 'Displayed when the user does not have the requisite right (namely, right).',
'login.failed' => 'Displayed when the user has not logged in (tried is false) or when the credentials were wrong (tried is true). A message may be given in message.',
'login.requestAccount' => 'Displayed when the user requests the form to enter a new account (should display the same form as login.failed, basically).',
'login.detailsSent' => 'The password was sent to data.address using data.protocol.',
'login.details' => 'The message containing the data.username and data.password of a new account or when the user has forgotten his password (only required for contact protocols, e.g. e-mail).',
'login.detailsSent' => 'The password was sent to address using protocol.',
'login.details' => 'The message containing the username and password of a new account or when the user has forgotten his password (only required for contact protocols, e.g. e-mail).',
);
}

View File

@ -496,8 +496,8 @@ sub outputUserPrefsChangeDetails {
# dispatcher.output
sub strings {
return (
'userPrefs.index' => 'The user preferences editor. This will be passed a stack of user profiles in a multi-level hash called data.userData, the array of userIDs in data.userIDs, and the details of each field in another multi-level hash as data.metaData.',
'userPrefs.notification' => 'If anything needs to be reported after the prefs are submitted then this will be called. Things to notify are reported in data.notifications, which is an array of arrays containing the userID relatd to the notification, the field related to the notification, and the notification type, which will be one of: contact.confirmationSent (no error occured), contact.cannotRemoveLastContactMethod (user error), password.mismatch.new (user error), password.mismatch.old *user error), user.noSuchUser (internal error), invalid (internal error), field.unknownCategory (internal error), accessDenied (internal error). The internal errors could also be caused by a user attempting to circumvent the security system.',
'userPrefs.index' => 'The user preferences editor. This will be passed a stack of user profiles in a multi-level hash called userData, the array of userIDs in userIDs, and the details of each field in another multi-level hash as meta',
'userPrefs.notification' => 'If anything needs to be reported after the prefs are submitted then this will be called. Things to notify are reported in notifications, which is an array of arrays containing the userID relatd to the notification, the field related to the notification, and the notification type, which will be one of: contact.confirmationSent (no error occured), contact.cannotRemoveLastContactMethod (user error), password.mismatch.new (user error), password.mismatch.old *user error), user.noSuchUser (internal error), invalid (internal error), field.unknownCategory (internal error), accessDenied (internal error). The internal errors could also be caused by a user attempting to circumvent the security system.',
'userPrefs.success' => 'If the user preferences are successfully submitted, this will be used. Typically this will simply be the main application command index.',
'userPrefs.change.overrideDetails' => 'The message that is sent containing the token and password required to override a change of address.',
'userPrefs.change.changeDetails' => 'The message that is sent containing the token and password required to confirm a change of address.',

View File

@ -80,13 +80,13 @@ sub getDefaultString {
}
if ($protocol eq 'stdout') {
if ($string eq 'request') {
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">\'<text value="(data.argument)"/>\'<if lvalue="(data.defaults.length)" condition=">" rvalue="0"> (default: \'<set variable="default" value="(data.defaults)" source="keys" order="default"><text value="(data.defaults.(default))"/><if lvalue="(default)" condition="!=" rvalue="0">\', \'</if></set>\')</if>? </text>');
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">\'<text value="(argument)"/>\'<if lvalue="(defaults.length)" condition=">" rvalue="0"> (default: \'<set variable="default" value="(defaults)" source="keys" order="default"><text value="(defaults.(default))"/><if lvalue="(default)" condition="!=" rvalue="0">\', \'</if></set>\')</if>? </text>');
} elsif ($string eq 'error') {
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">Error:<br/><text value="(data.error)"/><br/></text>');
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">Error:<br/><text value="(error)"/><br/></text>');
}
} elsif ($protocol eq 'http') {
if ($string eq 'error') {
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">HTTP/1.1 500 Internal Error<br/>Content-Type: text/plain<br/><br/>Error:<br/><text value="(data.error)"/></text>');
return ('COSES', '1', '<text xmlns="http://bugzilla.mozilla.org/coses">HTTP/1.1 500 Internal Error<br/>Content-Type: text/plain<br/><br/>Error:<br/><text value="(error)"/></text>');
}
}
return; # nope, sorry