{"action":"created","issue":{"url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/1","labels_url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/1/comments","events_url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/1/events","html_url":"https://github.com/simonwheatley/wp-post-term-locale/issues/1","id":119913290,"number":1,"title":"Add data structure to store locale on posts and terms","user":{"login":"simonwheatley","id":233434,"avatar_url":"https://avatars.githubusercontent.com/u/233434?v=3","gravatar_id":"","url":"https://api.github.com/users/simonwheatley","html_url":"https://github.com/simonwheatley","followers_url":"https://api.github.com/users/simonwheatley/followers","following_url":"https://api.github.com/users/simonwheatley/following{/other_user}","gists_url":"https://api.github.com/users/simonwheatley/gists{/gist_id}","starred_url":"https://api.github.com/users/simonwheatley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonwheatley/subscriptions","organizations_url":"https://api.github.com/users/simonwheatley/orgs","repos_url":"https://api.github.com/users/simonwheatley/repos","events_url":"https://api.github.com/users/simonwheatley/events{/privacy}","received_events_url":"https://api.github.com/users/simonwheatley/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/labels/enhancement","name":"enhancement","color":"009800"},{"url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/labels/feedback%20wanted","name":"feedback wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/milestones/1","html_url":"https://github.com/simonwheatley/wp-post-term-locale/milestones/Proof%20of%20Concept","labels_url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/milestones/1/labels","id":1439268,"number":1,"title":"Proof of Concept","description":"See: https://multilingualwp.wordpress.com/2015/11/30/roadmap-for-the-post-and-term-locales-proposal/","creator":{"login":"simonwheatley","id":233434,"avatar_url":"https://avatars.githubusercontent.com/u/233434?v=3","gravatar_id":"","url":"https://api.github.com/users/simonwheatley","html_url":"https://github.com/simonwheatley","followers_url":"https://api.github.com/users/simonwheatley/followers","following_url":"https://api.github.com/users/simonwheatley/following{/other_user}","gists_url":"https://api.github.com/users/simonwheatley/gists{/gist_id}","starred_url":"https://api.github.com/users/simonwheatley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonwheatley/subscriptions","organizations_url":"https://api.github.com/users/simonwheatley/orgs","repos_url":"https://api.github.com/users/simonwheatley/repos","events_url":"https://api.github.com/users/simonwheatley/events{/privacy}","received_events_url":"https://api.github.com/users/simonwheatley/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2015-12-02T10:17:50Z","updated_at":"2015-12-02T10:50:30Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2015-12-02T10:35:28Z","updated_at":"2015-12-02T14:34:21Z","closed_at":null,"body":"What do we need to bear in mind with storing this data? Off the top of my head:\r\n\r\n* An additional column `post_locale` and `term_locale` on `wp_posts` and `wp_terms`\r\n* An index on the locale columns… just a standard `INDEX`/`KEY`?\r\n* The locale column should support [at least 35 characters](https://core.trac.wordpress.org/ticket/28303#comment:18)… `varchar(100)`?"},"comment":{"url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/comments/161317026","html_url":"https://github.com/simonwheatley/wp-post-term-locale/issues/1#issuecomment-161317026","issue_url":"https://api.github.com/repos/simonwheatley/wp-post-term-locale/issues/1","id":161317026,"user":{"login":"lloc","id":1012205,"avatar_url":"https://avatars.githubusercontent.com/u/1012205?v=3","gravatar_id":"","url":"https://api.github.com/users/lloc","html_url":"https://github.com/lloc","followers_url":"https://api.github.com/users/lloc/followers","following_url":"https://api.github.com/users/lloc/following{/other_user}","gists_url":"https://api.github.com/users/lloc/gists{/gist_id}","starred_url":"https://api.github.com/users/lloc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloc/subscriptions","organizations_url":"https://api.github.com/users/lloc/orgs","repos_url":"https://api.github.com/users/lloc/repos","events_url":"https://api.github.com/users/lloc/events{/privacy}","received_events_url":"https://api.github.com/users/lloc/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T14:34:21Z","updated_at":"2015-12-02T14:34:21Z","body":"I think that using a locale column in `wp_posts` and `wp_terms` with a numeric key and a separate language table is the right direction. \r\n\r\nIt's not _only_ for performance reasons but this could be big deal if you just think of language codes like the one for the formal de_DE translation for example. Without such a table what would we save in a locale column? The complete string? What about custom translation codes that we want to support?\r\n\r\nI don't agree that removing a language should lead to remove the corresponding row from the table. Instead I would update a column status to mark that language as disabled. So the layout should have at least a layout like this:\r\n\r\nlocale_ID|locale_code|locale_status\r\n---------|-----------|-------------\r\n1|en|1\r\n2|fr|0\r\n3|it|1\r\n4|de|1\r\n\r\nThis is like the column in `wp_users` or we think about additional columns like in `wp_blogs`."}}