{"action":"created","issue":{"url":"https://api.github.com/repos/translate/pootle/issues/4213","labels_url":"https://api.github.com/repos/translate/pootle/issues/4213/labels{/name}","comments_url":"https://api.github.com/repos/translate/pootle/issues/4213/comments","events_url":"https://api.github.com/repos/translate/pootle/issues/4213/events","html_url":"https://github.com/translate/pootle/issues/4213","id":118580036,"number":4213,"title":"Changing language code breaks Pootle","user":{"login":"unho","id":939880,"avatar_url":"https://avatars.githubusercontent.com/u/939880?v=3","gravatar_id":"","url":"https://api.github.com/users/unho","html_url":"https://github.com/unho","followers_url":"https://api.github.com/users/unho/followers","following_url":"https://api.github.com/users/unho/following{/other_user}","gists_url":"https://api.github.com/users/unho/gists{/gist_id}","starred_url":"https://api.github.com/users/unho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unho/subscriptions","organizations_url":"https://api.github.com/users/unho/orgs","repos_url":"https://api.github.com/users/unho/repos","events_url":"https://api.github.com/users/unho/events{/privacy}","received_events_url":"https://api.github.com/users/unho/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/translate/pootle/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/translate/pootle/milestones/23","html_url":"https://github.com/translate/pootle/milestones/2.7.4","labels_url":"https://api.github.com/repos/translate/pootle/milestones/23/labels","id":1404123,"number":23,"title":"2.7.4","description":"","creator":{"login":"dwaynebailey","id":647438,"avatar_url":"https://avatars.githubusercontent.com/u/647438?v=3","gravatar_id":"","url":"https://api.github.com/users/dwaynebailey","html_url":"https://github.com/dwaynebailey","followers_url":"https://api.github.com/users/dwaynebailey/followers","following_url":"https://api.github.com/users/dwaynebailey/following{/other_user}","gists_url":"https://api.github.com/users/dwaynebailey/gists{/gist_id}","starred_url":"https://api.github.com/users/dwaynebailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwaynebailey/subscriptions","organizations_url":"https://api.github.com/users/dwaynebailey/orgs","repos_url":"https://api.github.com/users/dwaynebailey/repos","events_url":"https://api.github.com/users/dwaynebailey/events{/privacy}","received_events_url":"https://api.github.com/users/dwaynebailey/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":0,"state":"open","created_at":"2015-11-10T10:22:22Z","updated_at":"2015-11-24T10:44:45Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-11-24T10:44:45Z","updated_at":"2015-11-24T11:03:05Z","closed_at":null,"body":"The problem is that basically changing a language code doesn't trigger the necessary changes on `pootle_path` for the related TPs and its Directories, Stores and VFolderTreeItems. Thus stats don't work, and other Pootle features don't work as expected (like syncing files to disk). There are two proposed tasks to fix this issue:\r\n\r\n1. Forbid to change the language code for existing languages. This can be landed on its own but 2) is required to avoid losing the ability to alter the language code.\r\n2. Add a management command to alter a given language code that would perform all the required changes:\r\n\r\n- Disable all the language TPs so they don't get updates either from disk or from the UI,\r\n- Sync all language stores to disk to ensure no translations are lost,\r\n- Flush stats and caches related to this language,\r\n- Change the language code,\r\n- Copy files on disk from old locations to new locations (research how this might affect `update_stores` since we would like to avoid triggering any update since we just synced translations),\r\n- Change `pootle_path` for the affected objects so the new language code is used,\r\n- Recreate stats for the whole language (preferably TP by TP),\r\n- Any other relevant change?\r\n- Enable all the language TPs\r\n\r\nThe expected final outcome is that no attributions or permission assignments are lost, the language code is renamed and Pootle is still working."},"comment":{"url":"https://api.github.com/repos/translate/pootle/issues/comments/159230624","html_url":"https://github.com/translate/pootle/issues/4213#issuecomment-159230624","issue_url":"https://api.github.com/repos/translate/pootle/issues/4213","id":159230624,"user":{"login":"dwaynebailey","id":647438,"avatar_url":"https://avatars.githubusercontent.com/u/647438?v=3","gravatar_id":"","url":"https://api.github.com/users/dwaynebailey","html_url":"https://github.com/dwaynebailey","followers_url":"https://api.github.com/users/dwaynebailey/followers","following_url":"https://api.github.com/users/dwaynebailey/following{/other_user}","gists_url":"https://api.github.com/users/dwaynebailey/gists{/gist_id}","starred_url":"https://api.github.com/users/dwaynebailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwaynebailey/subscriptions","organizations_url":"https://api.github.com/users/dwaynebailey/orgs","repos_url":"https://api.github.com/users/dwaynebailey/repos","events_url":"https://api.github.com/users/dwaynebailey/events{/privacy}","received_events_url":"https://api.github.com/users/dwaynebailey/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T11:03:05Z","updated_at":"2015-11-24T11:03:05Z","body":"Disabling is unrelated to syncing."}}