Skip to content

Commit

Permalink
Message documentation and fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexia committed May 8, 2015
1 parent 48be3e9 commit 4c6e647
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 11 deletions.
2 changes: 1 addition & 1 deletion SpriteSheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'save_named_sprite',
'save_named_slice',
'please_enter_sprite_name',
'please_select_sprite',
'please_select_sprite_type',
'show_named_sprites',
'hide_named_sprites',
'click_to_edit',
Expand Down
2 changes: 1 addition & 1 deletion classes/SpriteNameLogFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function getMessageParameters() {
if ($spriteName != false && $parameters[4] > 0) {
$links = $spriteName->getRevisionLinks($parameters[4]);
if ($links !== false) {
$parameters[4] = ['raw' => " (".implode(" | ", $links).")"];
$parameters[4] = ['raw' => "(".implode(" | ", $links).")"];
} else {
//Set this to blank because otherwise sprintf() will later just use the last item in the array anyway.
$parameters[4] = '';
Expand Down
16 changes: 8 additions & 8 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"save_named_slice": "Save Named Slice",
"update_name": "Update Name",
"delete_name": "Delete Name",
"please_enter_sprite_name": "Please enter a name for this custom sprite.",
"please_select_sprite": "Please select a sprite or create a custom slice first.",
"please_enter_sprite_name": "Please enter a name for this custom sprite or slice.",
"please_select_sprite_type": "Please select a sprite or create a custom slice first.",
"ss_api_invalid_sprite_name": "The supplied name for the custom sprite or slice is invalid. Names must be 1 to 255 characters long and contain alphanumeric characters.",
"ss_api_sprite_name_in_use": "That sprite name is already in use on this sheet. Please delete it first.",
"wrong_named_sprite_slice": "A matching named sprite or slice was found, but the incorrect tag was used. Please change the tag to match.",
Expand All @@ -38,12 +38,12 @@
"sprite_log_description": "This is the log of sprite sheets that have been created or saved.",
"sprite_sheet_log": "change log",
"logentry-sprite-sheet": "$1 edited the sprite sheet for $3 ($4)",
"logentry-sprite-sprite": "$1 edited the sprite \"$4\" for $3$5",
"logentry-sprite-sprite-deleted": "$1 deleted the sprite \"$4\" for $3$5",
"logentry-sprite-sprite-rename": "$1 renamed the sprite \"$6\" to \"$4\" for $3$5",
"logentry-sprite-slice": "$1 edited the slice \"$4\" for $3$5",
"logentry-sprite-slice-deleted": "$1 deleted the slice \"$4\" for $3$5",
"logentry-sprite-slice-rename": "$1 renamed the slice \"$6\" to \"$4\" for $3$5",
"logentry-sprite-sprite": "$1 edited the sprite \"$4\" for $3 $5",
"logentry-sprite-sprite-deleted": "$1 deleted the sprite \"$4\" for $3 $5",
"logentry-sprite-sprite-rename": "$1 renamed the sprite \"$6\" to \"$4\" for $3 $5",
"logentry-sprite-slice": "$1 edited the slice \"$4\" for $3 $5",
"logentry-sprite-slice-deleted": "$1 deleted the slice \"$4\" for $3 $5",
"logentry-sprite-slice-rename": "$1 renamed the slice \"$6\" to \"$4\" for $3 $5",
"show_named_sprites": "Show Named Sprites/Slices",
"hide_named_sprites": "Hide Named Sprites/Slices",
"no_results_named_sprites": "No named sprites or slices found.",
Expand Down
58 changes: 58 additions & 0 deletions i18n/qqq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"@metadata": {
"authors": ["Alexia E. Smith"]
},
"spritesheet": "SpriteSheet",
"spritesheet_description": "Defines and displays sprite sheets from uploaded files.",
"sprite_sheet": "Sprite Sheet",
"sprite_columns": "Title cased display for form field columns.",
"sprite_rows": "Title cased display for form field rows.",
"sprite_inset": "Title cased display for form field inset (px).",
"spritesheet_editor": "This is the text that appears above the sprite sheet editor form.",
"ss_api_unknown_error": "API return message indicating that there was an unknown error attempting to process the request.",
"ss_api_must_be_posted": "API return message indicating that the request was not posted and must be posted.",
"ss_api_bad_title": "API return message indicating that the page title sent in the request was not found or could not be loaded.",
"ss_api_fatal_error_sprite_sheet_not_found": "API return message indicating that a sprite sheet was not found for the page title sent in the request.",
"ss_api_fatal_error_deleting_name": "API return message indicating that the operationg to delete the named sprite or slice failed due to mismatching data.",
"ss_api_fatal_error_saving": "API return message indicating that there was an overall error attempting to perform that action.",
"ss_api_invalid_coordinates": "API return message indicating that the coordinates pass back for a slice are invalid or out of bounds. Used by the software, but may be displayed to users as well.",
"ss_api_invalid_percentages": "API return message indicating that the percentages pass back for a slice are invalid or out of bounds. Used by the software, but may be displayed to users as well.",
"ss_api_okay": "API message indicating that all processing completed and there were no errors. This is not shown to users.",
"click_grid_for_preview": "A helper message that displays on the sprite sheet editor form to instruct users on how to use the editor.",
"no_sprite_sheet_defined": "When using the {{#sprite:}} or {{#slice:}} tags this error will be displayed if the article page in $1 does not have an associated sprite sheet.",
"could_not_find_title": "When using the {{#sprite:}} or {{#slice:}} tags this error will be displayed if the article page in $1 was not found.",
"could_not_find_named_sprite": "An error message saying that the named sprite in $2 was not found for the image in $1.",
"could_not_find_named_slice": "An error message saying that the named slice in $2 was not found for the image in $1.",
"save_sheet": "Form button label for \"Save Sheet\"",
"save_named_sprite": "Form button label for \"Save Named Sprite\"",
"save_named_slice": "Form button label for \"Save Named Slice\"",
"update_name": "Form button label for \"Update Name\"",
"delete_name": "Form button label for \"Delete Name\"",
"please_enter_sprite_name": "This error is triggerred by Javascript and displayed to the user when they attempt to save without completing the form.",
"please_select_sprite_type": "This error is triggerred by Javascript and displayed to the user when they attempt to save without selecting a sprite or slice first.",
"ss_api_invalid_sprite_name": "API return message displayed to the user that the sprite or slice name they provided was not in a valid format.",
"ss_api_sprite_name_in_use": "API return message displayed to the user that the sprite or slice name they provided is already in use on this sprite sheet.",
"wrong_named_sprite_slice": "When using the {{#sprite:}} or {{#slice:}} tags this error will be displayed if the user specified a named sprite while using the #slice tag and the reverse.",
"ss_api_no_permission": "API return message displayed to the user that they do not have permissiont to edit sprite sheets.",
"sprite_log_name": "Sprite sheet change log title, displayed on the sprite sheet editor form and on the change log page.",
"sprite_log_description": "Description of the sprite sheet change log.",
"sprite_sheet_log": "Short version of the sprite sheet log title usable in sentenances.",
"logentry-sprite-sheet": "$1 is the user name of the user that perform the action. $3 is the sprite sheet/page title being edited. $4 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-sprite": "$1 is the user name of the user that perform the action. $4 is the name of the sprite being edited. $3 is the sprite sheet/page title being edited. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-sprite-deleted": "$1 is the user name of the user that perform the action. $4 is the name of the sprite being deleted. $3 is the sprite sheet/page title containing the sprite name. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-sprite-rename": "$1 is the user name of the user that perform the action. $6 is the OLD name of the sprite being renamed. $4 is the NEW name of the sprite being renamed. $3 is the sprite sheet/page title containing the sprite name. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-slice": "$1 is the user name of the user that perform the action. $4 is the name of the slice being edited. $3 is the sprite sheet/page title being edited. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-slice-deleted": "$1 is the user name of the user that perform the action. $4 is the name of the slice being deleted. $3 is the sprite sheet/page title containing the slice name. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"logentry-sprite-slice-rename": "$1 is the user name of the user that perform the action. $6 is the OLD name of the slice being renamed. $4 is the NEW name of the slice being renamed. $3 is the sprite sheet/page title containing the slice name. $5 is a standard set of action links(rollback, diff) and generally should be left at the end.",
"show_named_sprites": "Form button label for \"Show Named Sprites/Slices\"",
"hide_named_sprites": "Form button label for \"Hide Named Sprites/Slices\"",
"no_results_named_sprites": "Helper message displayed to users after clicking \"Show Named Sprites/Slices\" when no results were returned.",
"click_to_edit": "Used in Javascript to as a tooltip when hovering over a named sprite or slice in the list of them.",
"visit_remote_repository_to_edit_sprite_sheet": "Helper message displayed to users to let me know that the sprite sheet was pulled from a remote wiki. $1 is the link to the remote page on the wiki and part of a standard Mediawiki external link that is parsed.",
"previous_values": "Label displayed over the previous revision values in the sprite sheet editor form when comparing historical revisions.",
"current_values": "Label displayed over the current revision values in the sprite sheet editor form when comparing historical revisions.",
"spritesheet_error_bad_parameter": "Error message displayed to the user when using the {{#sprite:}} or {{#slice:}} tags that a parameter passed is not recognized. The unrecognized parameter will be displayed in $1.",
"spritesheet_error_parameter_required": "Error message displayed to the user when using the {{#sprite:}} or {{#slice:}} tags that a parameter is required, but was not specified in the tag. The required parameter will be displayed in $1.",
"spritesheet_error_invalid_option": "Error message displayed to the user when using the {{#sprite:}} or {{#slice:}} tags that a parameter passed has an invalid value. The parameter will be displayed in $1 and the invalid value will be display in $2.",
"slice_error_mixed_units": "When using the {{#slice:}} tag this error will be displayed to the user if they mix percentage(%) and pixel(px) units of measurement."
}
2 changes: 1 addition & 1 deletion js/spritesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ mw.spriteSheet = {
var spriteName = $('#sprite_name').val();

if (!this.selectedType) {
alert(mw.message('please_select_sprite').text());
alert(mw.message('please_select_sprite_type').text());
return;
}

Expand Down

0 comments on commit 4c6e647

Please sign in to comment.