{"action":"created","issue":{"url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/100","repository_url":"https://api.github.com/repos/Ellypse/Total-RP-3","labels_url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/100/labels{/name}","comments_url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/100/comments","events_url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/100/events","html_url":"https://github.com/Ellypse/Total-RP-3/pull/100","id":302890259,"number":100,"title":"Build credits from addon-global tables","user":{"login":"Meorawr","id":287102,"avatar_url":"https://avatars3.githubusercontent.com/u/287102?v=4","gravatar_id":"","url":"https://api.github.com/users/Meorawr","html_url":"https://github.com/Meorawr","followers_url":"https://api.github.com/users/Meorawr/followers","following_url":"https://api.github.com/users/Meorawr/following{/other_user}","gists_url":"https://api.github.com/users/Meorawr/gists{/gist_id}","starred_url":"https://api.github.com/users/Meorawr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meorawr/subscriptions","organizations_url":"https://api.github.com/users/Meorawr/orgs","repos_url":"https://api.github.com/users/Meorawr/repos","events_url":"https://api.github.com/users/Meorawr/events{/privacy}","received_events_url":"https://api.github.com/users/Meorawr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-03-06T22:20:58Z","updated_at":"2018-03-09T08:57:43Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/Ellypse/Total-RP-3/pulls/100","html_url":"https://github.com/Ellypse/Total-RP-3/pull/100","diff_url":"https://github.com/Ellypse/Total-RP-3/pull/100.diff","patch_url":"https://github.com/Ellypse/Total-RP-3/pull/100.patch"},"body":"Fixes #99.\r\n\r\nThis requires manual changes to the non-English locales that are outlined below.\r\n\r\nCredits are defined in an ADDON_CREDITS table in the globals file. This table has a subtable per-role which contains a flat pre-ordered list for display in the appropriate sections.\r\n\r\n```lua\r\nlocal ADDON_CREDITS = {\r\n\t[ADDON_CREDITS_ROLES.AUTHORS] = {\r\n\t\t[[Renaud \"{twitter*EllypseCelwe*Ellypse}\" Parize]],\r\n\t\t[[Sylvain \"{twitter*Telkostrasz*Telkostrasz}\" Cossement]],\r\n\t},\r\n        ...\r\n};\r\n```\r\n\r\nThe ADDON_CREDITS_ROLES table defines the available roles.\r\n\r\n```lua\r\nlocal ADDON_CREDITS_ROLES = {\r\n\tAUTHORS = \"AUTHORS\",\r\n\tCONTRIBUTORS = \"CONTRIBUTORS\",\r\n\tCOMMUNITY_MANAGERS = \"COMMUNITY_MANAGERS\",\r\n\tTESTERS = \"TESTERS\",\r\n\tGUILD_MEMBERS = \"GUILD_MEMBERS\",\r\n};\r\n```\r\n\r\nThe ADDON_CREDITS_ROLE_GROUPS table forms a logical mapping between the individual roles and the sections in the About text. The current about text has four sections - the contributors and community managers are merged - so we use this logical mapping to do exactly that.\r\n\r\n```lua\r\nlocal ADDON_CREDITS_ROLE_GROUPS = {\r\n        -- When %{CONTRIBUTORS} is replaced in the About text format string, both of the roles inside\r\n        -- this group will be inserted into that section in-order.\r\n\t[ADDON_CREDITS_ROLES.CONTRIBUTORS] = {\r\n\t\tADDON_CREDITS_ROLES.CONTRIBUTORS,\r\n\t\tADDON_CREDITS_ROLES.COMMUNITY_MANAGERS,\r\n\t},\r\n        ...\r\n};\r\n```\r\n\r\nThis design allows us in the future to add more roles if needed and assign them to an existing logical group without needing to then update each localisation string; you can just add the new roles to a pre-existing group.\r\n\r\nThis is backwards compatible with existing locales however they won't display the new data unless they include a set of **named** replacements in the form `%{ROLE_GROUP}`. For example, `%{AUTHORS}` would be replaced with all of the members of the `AUTHORS` group and its associated role(s).\r\n\r\nThis decision was made because replacements like `%s` are positional; if one day we were to add another logical group to display before the QA Testers section, we'd need to update the `string.format()` call to account for the argument order change as well as every localisation to include the new `%s`. Named replacements let us do these sorts of things progressively by not tying the presentation of the text to the actual implementation of the formatting code."},"comment":{"url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/comments/371752783","html_url":"https://github.com/Ellypse/Total-RP-3/pull/100#issuecomment-371752783","issue_url":"https://api.github.com/repos/Ellypse/Total-RP-3/issues/100","id":371752783,"user":{"login":"Meorawr","id":287102,"avatar_url":"https://avatars3.githubusercontent.com/u/287102?v=4","gravatar_id":"","url":"https://api.github.com/users/Meorawr","html_url":"https://github.com/Meorawr","followers_url":"https://api.github.com/users/Meorawr/followers","following_url":"https://api.github.com/users/Meorawr/following{/other_user}","gists_url":"https://api.github.com/users/Meorawr/gists{/gist_id}","starred_url":"https://api.github.com/users/Meorawr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Meorawr/subscriptions","organizations_url":"https://api.github.com/users/Meorawr/orgs","repos_url":"https://api.github.com/users/Meorawr/repos","events_url":"https://api.github.com/users/Meorawr/events{/privacy}","received_events_url":"https://api.github.com/users/Meorawr/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T08:57:43Z","updated_at":"2018-03-09T08:57:43Z","author_association":"COLLABORATOR","body":"Decision made to cull the memoizer (can't say I'll miss it :smile:). I'll get that done today."}}
{"actor":{"display_login":"Meorawr"}}