From 69e7008b6c0906f3560a791ac7bc9ee7406cbad3 Mon Sep 17 00:00:00 2001 From: elifoster Date: Fri, 13 Oct 2017 10:50:51 -0700 Subject: [PATCH] API help messages are now internationalized for #47 --- api/TilesheetsAddSheetApi.php | 13 -------- api/TilesheetsAddTilesApi.php | 13 -------- api/TilesheetsDeleteSheetApi.php | 12 ------- api/TilesheetsDeleteTilesApi.php | 12 ------- api/TilesheetsDeleteTranslationApi.php | 12 ------- api/TilesheetsEditSheetApi.php | 14 -------- api/TilesheetsEditTileApi.php | 16 --------- api/TilesheetsQuerySheetsApi.php | 11 ------ api/TilesheetsQueryTilesApi.php | 12 ------- api/TilesheetsQueryTranslationsApi.php | 11 ------ api/TilesheetsTranslateTileApi.php | 14 -------- i18n/en.json | 46 +++++++++++++++++++++++++- 12 files changed, 45 insertions(+), 141 deletions(-) diff --git a/api/TilesheetsAddSheetApi.php b/api/TilesheetsAddSheetApi.php index ea973b9..911d3d9 100644 --- a/api/TilesheetsAddSheetApi.php +++ b/api/TilesheetsAddSheetApi.php @@ -37,19 +37,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'mod' => 'The mod abbreviation', - 'sizes' => 'Pipe separated list of tile sizes', - ); - } - - public function getDescription() { - return 'Creates a new tilesheet with the given mod abbreviation and sizes'; - } - public function getExamples() { return array( 'api.php?action=createsheet&tssummary=This mod rocks&tsmod=MOD&tssizes=16|32|64', diff --git a/api/TilesheetsAddTilesApi.php b/api/TilesheetsAddTilesApi.php index f04cbda..727b50e 100644 --- a/api/TilesheetsAddTilesApi.php +++ b/api/TilesheetsAddTilesApi.php @@ -38,19 +38,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'mod' => 'The mod abbreviation', - 'import' => 'A pipe separated list of entries. Format each entry as `X Y Item Name`.', - ); - } - - public function getDescription() { - return 'Adds a single tile to a given tilesheet'; - } - public function getExamples() { return array( 'api.php?action=addtiles&tssummary=Adding many tiles&tsmod=V&tsimport=0 0 Item|0 1 Other Item' diff --git a/api/TilesheetsDeleteSheetApi.php b/api/TilesheetsDeleteSheetApi.php index 85dfef3..a3a2b7e 100644 --- a/api/TilesheetsDeleteSheetApi.php +++ b/api/TilesheetsDeleteSheetApi.php @@ -34,18 +34,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'mods' => 'The mod abbreviations to delete', - ); - } - - public function getDescription() { - return 'Deletes tilesheets by the mod abbreviations specified'; - } - public function getExamples() { return array( 'api.php?action=deletesheet&tsmods=A|B|C&tssummary=Because I don\'t know my ABCs.', diff --git a/api/TilesheetsDeleteTilesApi.php b/api/TilesheetsDeleteTilesApi.php index a1ae600..87207be 100644 --- a/api/TilesheetsDeleteTilesApi.php +++ b/api/TilesheetsDeleteTilesApi.php @@ -34,18 +34,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'ids' => 'A list of entry IDs to delete', - ); - } - - public function getDescription() { - return 'Deletes individual tile entries from the database'; - } - public function getExamples() { return array( 'api.php?action=deletetiles&tsids=1|2|3', diff --git a/api/TilesheetsDeleteTranslationApi.php b/api/TilesheetsDeleteTranslationApi.php index 3aad90c..1ad1805 100644 --- a/api/TilesheetsDeleteTranslationApi.php +++ b/api/TilesheetsDeleteTranslationApi.php @@ -36,18 +36,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'id' => 'The entry ID to delete', - 'lang' => 'The language of the entry to delete' - ); - } - - public function getDescription() { - return 'Deletes a translation for an entry ID.'; - } - public function getExamples() { return array( 'api.php?action=deletetranslation&tsid=6&tslang=es', diff --git a/api/TilesheetsEditSheetApi.php b/api/TilesheetsEditSheetApi.php index 0bb241a..0b2f950 100644 --- a/api/TilesheetsEditSheetApi.php +++ b/api/TilesheetsEditSheetApi.php @@ -39,20 +39,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'mod' => 'The current mod abbreviation', - 'tomod' => 'The new mod abbreviation', - 'tosizes' => 'A pipe separated list of new sizes', - ); - } - - public function getDescription() { - return 'Edits a sheet\'s data'; - } - public function getExamples() { return array( 'api.php?action=editsheet&mod=A&tomod=B&tosizes=32|64', diff --git a/api/TilesheetsEditTileApi.php b/api/TilesheetsEditTileApi.php index 737a46b..e1e44bd 100644 --- a/api/TilesheetsEditTileApi.php +++ b/api/TilesheetsEditTileApi.php @@ -44,22 +44,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'summary' => 'An optional edit summary', - 'id' => 'The entry ID for the tile', - 'tomod' => 'The new mod abbreviation', - 'toname' => 'The new item name', - 'tox' => 'The new X coordinate', - 'toy' => 'The new Y coordinate', - ); - } - - public function getDescription() { - return 'Edits a tile entry\'s data'; - } - public function getExamples() { return array( 'api.php?action=edittile&id=1&tomod=V&toname=Log&tox=1&toy=1', diff --git a/api/TilesheetsQuerySheetsApi.php b/api/TilesheetsQuerySheetsApi.php index 12ba50b..737d8f9 100644 --- a/api/TilesheetsQuerySheetsApi.php +++ b/api/TilesheetsQuerySheetsApi.php @@ -21,17 +21,6 @@ public function getAllowedParams() { ); } - public function getParamDescription() { - return array( - 'limit' => 'The maximum number of sheets to list', - 'from' => 'The abbreviation to start listing at' - ); - } - - public function getDescription() { - return 'Get all of the sheets.'; - } - public function getExamples() { return array( 'api.php?action=query&list=tilesheets&tslimit=50', diff --git a/api/TilesheetsQueryTilesApi.php b/api/TilesheetsQueryTilesApi.php index e5ab4c8..854c8be 100644 --- a/api/TilesheetsQueryTilesApi.php +++ b/api/TilesheetsQueryTilesApi.php @@ -25,18 +25,6 @@ public function getAllowedParams() { ); } - public function getParamDescription() { - return array( - 'limit' => 'The maximum number of tiles to list', - 'from' => 'The tile ID to start listing at', - 'mod' => 'The mod to filter by', - ); - } - - public function getDescription() { - return 'Get all of the tiles filtered by mod.'; - } - public function getExamples() { return array( 'api.php?action=query&list=tiles&tslimit=50&tsmod=W', diff --git a/api/TilesheetsQueryTranslationsApi.php b/api/TilesheetsQueryTranslationsApi.php index 6943e62..0acc94e 100644 --- a/api/TilesheetsQueryTranslationsApi.php +++ b/api/TilesheetsQueryTranslationsApi.php @@ -19,17 +19,6 @@ public function getAllowedParams() { ); } - public function getParamDescription() { - return array( - 'id' => 'The entry ID to get translations for', - 'lang' => 'The language to get translations for', - ); - } - - public function getDescription() { - return 'Get all of the translations for the given entry ID and/or language.'; - } - public function getExamples() { return array( 'api.php?action=query&list=tiletranslations&tsid=6', diff --git a/api/TilesheetsTranslateTileApi.php b/api/TilesheetsTranslateTileApi.php index c139490..a08b845 100644 --- a/api/TilesheetsTranslateTileApi.php +++ b/api/TilesheetsTranslateTileApi.php @@ -42,20 +42,6 @@ public function isWriteMode() { return true; } - public function getParamDescription() { - return array( - 'token' => 'The edit token', - 'id' => 'The tile entry ID', - 'lang' => 'The language code to translate to', - 'name' => 'The localized name', - 'description' => 'The localized description', - ); - } - - public function getDescription() { - return 'Translates the given tile data, either updating or creating a new entry.'; - } - public function getExamples() { return array( 'api.php?action=translatetile&tsid=6&tslang=es-ni&tsname=Esmeralda', diff --git a/i18n/en.json b/i18n/en.json index bd71e80..75cc88a 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -105,5 +105,49 @@ "tilesheet-missing-item-category": "Pages with a missing tile name", "tilesheet-no-mod-provided-category": "Pages with a missing mod parameter", "tilesheet-no-mod-provided-easy-category": "Pages with an easily fixable missing mod parameter", - "grant-tilesheets": "Edit, import, or translate tilesheets" + "grant-tilesheets": "Edit, import, or translate tilesheets", + "apihelp-addtiles-description": "Adds a single tile to a given tilesheet.", + "apihelp-addtiles-param-summary": "An optional edit summary.", + "apihelp-addtiles-param-mod": "The mod abbreviation.", + "apihelp-addtiles-param-import": "A pipe separated list of entries. Format each entry as `X Y Item Name`.", + "apihelp-deletesheet-description": "Deletes tilesheets by the mod abbreviations specified.", + "apihelp-deletesheet-param-summary": "An optional edit summary.", + "apihelp-deletesheet-param-mods": "The mod abbreviations to delete.", + "apihelp-createsheet-description": "Creates a new tilesheet with the given mod abbreviation and sizes.", + "apihelp-createsheet-param-summary": "An optional edit summary.", + "apihelp-createsheet-param-mod": "The mod abbreviation.", + "apihelp-createsheet-param-sizes": "Pipe separated list of tile sizes.", + "apihelp-deletetiles-description": "Deletes individual tile entries from the database.", + "apihelp-deletetiles-param-summary": "An optional edit summary.", + "apihelp-deletetiles-param-ids": "A list of entry IDs to delete.", + "apihelp-edittile-description": "Edits a tile entry's data.", + "apihelp-edittile-param-summary": "An optional edit summary.", + "apihelp-edittile-param-id": "The entry ID for the tile.", + "apihelp-edittile-param-tomod": "The new mod abbreviation.", + "apihelp-edittile-param-toname": "The new item name.", + "apihelp-edittile-param-tox": "The new X coordinate.", + "apihelp-edittile-param-toy": "The new Y coordinate.", + "apihelp-editsheet-description": "Edits a sheet's data.", + "apihelp-editsheet-param-summary": "An optional edit summary.", + "apihelp-editsheet-param-mod": "The current mod abbreviation.", + "apihelp-editsheet-param-tomod": "The new mod abbreviation.", + "apihelp-editsheet-param-tosizes": "A pipe separated list of new sizes.", + "apihelp-deletetranslation-description": "Deletes a translation for an entry ID.", + "apihelp-deletetranslation-param-id": "The entry ID to delete from.", + "apihelp-deletetranslation-param-lang": "The language of the entry to delete.", + "apihelp-translatetile-description": "Translates the given tile data, either updating or creating a new entry.", + "apihelp-translatetile-param-id": "The tile entry ID.", + "apihelp-translatetile-param-lang": "The language code to translate to.", + "apihelp-translatetile-param-name": "The localized name.", + "apihelp-translatetile-param-description": "The localized description.", + "apihelp-query+tilesheets-description": "Get all of the sheets.", + "apihelp-query+tilesheets-param-limit": "The maximum number of sheets to list.", + "apihelp-query+tilesheets-param-from": "The abbreviation to start listing at.", + "apihelp-query+tiles-description": "Get all of the tiles filtered by mod.", + "apihelp-query+tiles-param-limit": "The maximum number of tiles to list.", + "apihelp-query+tiles-param-from": "The tile ID to start listing at.", + "apihelp-query+tiles-param-mod": "The mod to filter by.", + "apihelp-query+tiletranslations-description": "Get all of the translations for the given entry ID and/or language.", + "apihelp-query+tiletranslations-param-id": "The entry ID to get translations for.", + "apihelp-query+tiletranslations-param-lang": "The language to get translations for." }