{"action":"opened","issue":{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1524","repository_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine","labels_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1524/labels{/name}","comments_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1524/comments","events_url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/issues/1524/events","html_url":"https://github.com/TeamPorcupine/ProjectPorcupine/issues/1524","id":182012539,"number":1524,"title":"RTL and lang attributes in the localization system","user":{"login":"bjubes","id":7608114,"avatar_url":"https://avatars.githubusercontent.com/u/7608114?v=3","gravatar_id":"","url":"https://api.github.com/users/bjubes","html_url":"https://github.com/bjubes","followers_url":"https://api.github.com/users/bjubes/followers","following_url":"https://api.github.com/users/bjubes/following{/other_user}","gists_url":"https://api.github.com/users/bjubes/gists{/gist_id}","starred_url":"https://api.github.com/users/bjubes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjubes/subscriptions","organizations_url":"https://api.github.com/users/bjubes/orgs","repos_url":"https://api.github.com/users/bjubes/repos","events_url":"https://api.github.com/users/bjubes/events{/privacy}","received_events_url":"https://api.github.com/users/bjubes/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/labels/discussion","name":"discussion","color":"e99695"},{"url":"https://api.github.com/repos/TeamPorcupine/ProjectPorcupine/labels/localization","name":"localization","color":"006b75"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-10T13:18:40Z","updated_at":"2016-10-10T13:18:40Z","closed_at":null,"body":"Currently in order for a language to support RTL (hebrew and arabic), they must have `rtl=true` as their first line in the lang file. The `lang=` must come next if a language has a \"localized localization\", meaning that English (US) comes up in the language dropdown instead of en_US.\r\n\r\nIn #1475 there was discussion of redesigning the system so that the rtl and lang attributes could appear anywhere in a file. I think this is a much better design considering order doesn't matter in the rest of the file, so it makes sense for the entire file to act as an unordered dictionary.\r\n\r\nHowever, this new approach has a flaw. the localization system will have to read the entirity of every file on start, as opposed to just english and the one selected in settings. Currently we have over 50 languages, so the increase of processing time will be immense.\r\n\r\nso here are the possible solutions off the top of my head. Please comment on which one you think is best.\r\n\r\n- Keep the system as is, just make it arbirary that the lang and rtl attriubtes must appear first. I will fix up the code in localization table to do this more cleanly, right now its kinda a mess.\r\n\r\n- Scan every file on start, but on a seperate thread. This will be similar to how world is loaded, using a Thread object and couroutine which yeilds to it. I don't know how long scanning through 50 files which contain potentially hundreds of strings, but I can make it prioritize english (default) and the langauge chosen in settings first, and the rest will load in the background as the game runs.\r\n\r\n- Keep rtl as the first attribute if required and move \"localization localization\" to a separate file (say lang_codes.lang?) where it maps every code to its name e.g. `en_US=English (US)`"}}
{"actor":{"display_login":"bjubes"}}