{"action":"created","comment":{"url":"https://api.github.com/repos/firmafon/iye/pulls/comments/45964021","id":45964021,"diff_hunk":"@@ -37,5 +37,25 @@ def nest_hash hash\n       result\n     end\n     module_function :nest_hash\n+\n+    ##\n+    # Replaces from_locale with to_locale in filename of path\n+    # Supports filenames with locale prefix or suffix\n+    #\n+    # @param [String] from_locale\n+    # @param [String] to_locale\n+    # @param [String] path\n+    #\n+    # @example Get path for en locale path from existing dk locale path\n+    #   Transformation.replace_locale_in_path('dk', 'en', '/tmp/dk.foo.yml') #=> \"/tmp/en.foo.yml\"\n+    #   Transformation.replace_locale_in_path('dk', 'en', '/tmp/foo.dk.yml') #=> \"/tmp/foo.en.yml\"\n+    #\n+    # @return [String]\n+    def replace_locale_in_path(from_locale, to_locale, path)\n+      parts = File.basename(path).split('.')\n+      parts[parts.index(from_locale)] = to_locale\n+      File.join(File.dirname(path), parts.join('.'))\n+    end","path":"lib/i18n_yaml_editor/transformation.rb","position":22,"original_position":22,"commit_id":"af0e3349fd4f25e05ec330314e38e2010cb18a0e","original_commit_id":"af0e3349fd4f25e05ec330314e38e2010cb18a0e","user":{"login":"kaspth","id":350807,"avatar_url":"https://avatars.githubusercontent.com/u/350807?v=3","gravatar_id":"","url":"https://api.github.com/users/kaspth","html_url":"https://github.com/kaspth","followers_url":"https://api.github.com/users/kaspth/followers","following_url":"https://api.github.com/users/kaspth/following{/other_user}","gists_url":"https://api.github.com/users/kaspth/gists{/gist_id}","starred_url":"https://api.github.com/users/kaspth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaspth/subscriptions","organizations_url":"https://api.github.com/users/kaspth/orgs","repos_url":"https://api.github.com/users/kaspth/repos","events_url":"https://api.github.com/users/kaspth/events{/privacy}","received_events_url":"https://api.github.com/users/kaspth/received_events","type":"User","site_admin":false},"body":"Method extraction is fine, but what's the use case for making this public API? Would rather it was just a private method in `store.rb`.","created_at":"2015-11-26T10:33:17Z","updated_at":"2015-11-26T10:33:17Z","html_url":"https://github.com/firmafon/iye/pull/22#discussion_r45964021","pull_request_url":"https://api.github.com/repos/firmafon/iye/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/firmafon/iye/pulls/comments/45964021"},"html":{"href":"https://github.com/firmafon/iye/pull/22#discussion_r45964021"},"pull_request":{"href":"https://api.github.com/repos/firmafon/iye/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/firmafon/iye/pulls/22","id":48323877,"html_url":"https://github.com/firmafon/iye/pull/22","diff_url":"https://github.com/firmafon/iye/pull/22.diff","patch_url":"https://github.com/firmafon/iye/pull/22.patch","issue_url":"https://api.github.com/repos/firmafon/iye/issues/22","number":22,"state":"open","locked":false,"title":"Add support for yml filenames where locale is used as prefix","user":{"login":"1st8","id":646693,"avatar_url":"https://avatars.githubusercontent.com/u/646693?v=3","gravatar_id":"","url":"https://api.github.com/users/1st8","html_url":"https://github.com/1st8","followers_url":"https://api.github.com/users/1st8/followers","following_url":"https://api.github.com/users/1st8/following{/other_user}","gists_url":"https://api.github.com/users/1st8/gists{/gist_id}","starred_url":"https://api.github.com/users/1st8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1st8/subscriptions","organizations_url":"https://api.github.com/users/1st8/orgs","repos_url":"https://api.github.com/users/1st8/repos","events_url":"https://api.github.com/users/1st8/events{/privacy}","received_events_url":"https://api.github.com/users/1st8/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-21T12:24:32Z","updated_at":"2015-11-26T10:33:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f6fd05be7a446537018b21203b66d741cfbfc42","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/firmafon/iye/pulls/22/commits","review_comments_url":"https://api.github.com/repos/firmafon/iye/pulls/22/comments","review_comment_url":"https://api.github.com/repos/firmafon/iye/pulls/comments{/number}","comments_url":"https://api.github.com/repos/firmafon/iye/issues/22/comments","statuses_url":"https://api.github.com/repos/firmafon/iye/statuses/af0e3349fd4f25e05ec330314e38e2010cb18a0e","head":{"label":"mixxt:support-different-naming-schema","ref":"support-different-naming-schema","sha":"af0e3349fd4f25e05ec330314e38e2010cb18a0e","user":{"login":"mixxt","id":781719,"avatar_url":"https://avatars.githubusercontent.com/u/781719?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxt","html_url":"https://github.com/mixxt","followers_url":"https://api.github.com/users/mixxt/followers","following_url":"https://api.github.com/users/mixxt/following{/other_user}","gists_url":"https://api.github.com/users/mixxt/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxt/subscriptions","organizations_url":"https://api.github.com/users/mixxt/orgs","repos_url":"https://api.github.com/users/mixxt/repos","events_url":"https://api.github.com/users/mixxt/events{/privacy}","received_events_url":"https://api.github.com/users/mixxt/received_events","type":"Organization","site_admin":false},"repo":{"id":44172338,"name":"iye","full_name":"mixxt/iye","owner":{"login":"mixxt","id":781719,"avatar_url":"https://avatars.githubusercontent.com/u/781719?v=3","gravatar_id":"","url":"https://api.github.com/users/mixxt","html_url":"https://github.com/mixxt","followers_url":"https://api.github.com/users/mixxt/followers","following_url":"https://api.github.com/users/mixxt/following{/other_user}","gists_url":"https://api.github.com/users/mixxt/gists{/gist_id}","starred_url":"https://api.github.com/users/mixxt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mixxt/subscriptions","organizations_url":"https://api.github.com/users/mixxt/orgs","repos_url":"https://api.github.com/users/mixxt/repos","events_url":"https://api.github.com/users/mixxt/events{/privacy}","received_events_url":"https://api.github.com/users/mixxt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mixxt/iye","description":"IYE makes it easy to translate your Rails I18N files and keeps them up to date. Unlike a lot of other tools in this space, IYE works directly on the YAML files instead of keeping a separate database in sync.","fork":true,"url":"https://api.github.com/repos/mixxt/iye","forks_url":"https://api.github.com/repos/mixxt/iye/forks","keys_url":"https://api.github.com/repos/mixxt/iye/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mixxt/iye/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mixxt/iye/teams","hooks_url":"https://api.github.com/repos/mixxt/iye/hooks","issue_events_url":"https://api.github.com/repos/mixxt/iye/issues/events{/number}","events_url":"https://api.github.com/repos/mixxt/iye/events","assignees_url":"https://api.github.com/repos/mixxt/iye/assignees{/user}","branches_url":"https://api.github.com/repos/mixxt/iye/branches{/branch}","tags_url":"https://api.github.com/repos/mixxt/iye/tags","blobs_url":"https://api.github.com/repos/mixxt/iye/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mixxt/iye/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mixxt/iye/git/refs{/sha}","trees_url":"https://api.github.com/repos/mixxt/iye/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mixxt/iye/statuses/{sha}","languages_url":"https://api.github.com/repos/mixxt/iye/languages","stargazers_url":"https://api.github.com/repos/mixxt/iye/stargazers","contributors_url":"https://api.github.com/repos/mixxt/iye/contributors","subscribers_url":"https://api.github.com/repos/mixxt/iye/subscribers","subscription_url":"https://api.github.com/repos/mixxt/iye/subscription","commits_url":"https://api.github.com/repos/mixxt/iye/commits{/sha}","git_commits_url":"https://api.github.com/repos/mixxt/iye/git/commits{/sha}","comments_url":"https://api.github.com/repos/mixxt/iye/comments{/number}","issue_comment_url":"https://api.github.com/repos/mixxt/iye/issues/comments{/number}","contents_url":"https://api.github.com/repos/mixxt/iye/contents/{+path}","compare_url":"https://api.github.com/repos/mixxt/iye/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mixxt/iye/merges","archive_url":"https://api.github.com/repos/mixxt/iye/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mixxt/iye/downloads","issues_url":"https://api.github.com/repos/mixxt/iye/issues{/number}","pulls_url":"https://api.github.com/repos/mixxt/iye/pulls{/number}","milestones_url":"https://api.github.com/repos/mixxt/iye/milestones{/number}","notifications_url":"https://api.github.com/repos/mixxt/iye/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mixxt/iye/labels{/name}","releases_url":"https://api.github.com/repos/mixxt/iye/releases{/id}","created_at":"2015-10-13T11:42:30Z","updated_at":"2015-10-13T11:42:32Z","pushed_at":"2015-11-26T10:14:01Z","git_url":"git://github.com/mixxt/iye.git","ssh_url":"git@github.com:mixxt/iye.git","clone_url":"https://github.com/mixxt/iye.git","svn_url":"https://github.com/mixxt/iye","homepage":"","size":173,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"firmafon:master","ref":"master","sha":"241fb27913c573206969a4e6f076b0eed432859e","user":{"login":"firmafon","id":184951,"avatar_url":"https://avatars.githubusercontent.com/u/184951?v=3","gravatar_id":"","url":"https://api.github.com/users/firmafon","html_url":"https://github.com/firmafon","followers_url":"https://api.github.com/users/firmafon/followers","following_url":"https://api.github.com/users/firmafon/following{/other_user}","gists_url":"https://api.github.com/users/firmafon/gists{/gist_id}","starred_url":"https://api.github.com/users/firmafon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firmafon/subscriptions","organizations_url":"https://api.github.com/users/firmafon/orgs","repos_url":"https://api.github.com/users/firmafon/repos","events_url":"https://api.github.com/users/firmafon/events{/privacy}","received_events_url":"https://api.github.com/users/firmafon/received_events","type":"Organization","site_admin":false},"repo":{"id":5615736,"name":"iye","full_name":"firmafon/iye","owner":{"login":"firmafon","id":184951,"avatar_url":"https://avatars.githubusercontent.com/u/184951?v=3","gravatar_id":"","url":"https://api.github.com/users/firmafon","html_url":"https://github.com/firmafon","followers_url":"https://api.github.com/users/firmafon/followers","following_url":"https://api.github.com/users/firmafon/following{/other_user}","gists_url":"https://api.github.com/users/firmafon/gists{/gist_id}","starred_url":"https://api.github.com/users/firmafon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firmafon/subscriptions","organizations_url":"https://api.github.com/users/firmafon/orgs","repos_url":"https://api.github.com/users/firmafon/repos","events_url":"https://api.github.com/users/firmafon/events{/privacy}","received_events_url":"https://api.github.com/users/firmafon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/firmafon/iye","description":"IYE makes it easy to translate your Rails I18N files and keeps them up to date. Unlike a lot of other tools in this space, IYE works directly on the YAML files instead of keeping a separate database in sync.","fork":false,"url":"https://api.github.com/repos/firmafon/iye","forks_url":"https://api.github.com/repos/firmafon/iye/forks","keys_url":"https://api.github.com/repos/firmafon/iye/keys{/key_id}","collaborators_url":"https://api.github.com/repos/firmafon/iye/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/firmafon/iye/teams","hooks_url":"https://api.github.com/repos/firmafon/iye/hooks","issue_events_url":"https://api.github.com/repos/firmafon/iye/issues/events{/number}","events_url":"https://api.github.com/repos/firmafon/iye/events","assignees_url":"https://api.github.com/repos/firmafon/iye/assignees{/user}","branches_url":"https://api.github.com/repos/firmafon/iye/branches{/branch}","tags_url":"https://api.github.com/repos/firmafon/iye/tags","blobs_url":"https://api.github.com/repos/firmafon/iye/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/firmafon/iye/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/firmafon/iye/git/refs{/sha}","trees_url":"https://api.github.com/repos/firmafon/iye/git/trees{/sha}","statuses_url":"https://api.github.com/repos/firmafon/iye/statuses/{sha}","languages_url":"https://api.github.com/repos/firmafon/iye/languages","stargazers_url":"https://api.github.com/repos/firmafon/iye/stargazers","contributors_url":"https://api.github.com/repos/firmafon/iye/contributors","subscribers_url":"https://api.github.com/repos/firmafon/iye/subscribers","subscription_url":"https://api.github.com/repos/firmafon/iye/subscription","commits_url":"https://api.github.com/repos/firmafon/iye/commits{/sha}","git_commits_url":"https://api.github.com/repos/firmafon/iye/git/commits{/sha}","comments_url":"https://api.github.com/repos/firmafon/iye/comments{/number}","issue_comment_url":"https://api.github.com/repos/firmafon/iye/issues/comments{/number}","contents_url":"https://api.github.com/repos/firmafon/iye/contents/{+path}","compare_url":"https://api.github.com/repos/firmafon/iye/compare/{base}...{head}","merges_url":"https://api.github.com/repos/firmafon/iye/merges","archive_url":"https://api.github.com/repos/firmafon/iye/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/firmafon/iye/downloads","issues_url":"https://api.github.com/repos/firmafon/iye/issues{/number}","pulls_url":"https://api.github.com/repos/firmafon/iye/pulls{/number}","milestones_url":"https://api.github.com/repos/firmafon/iye/milestones{/number}","notifications_url":"https://api.github.com/repos/firmafon/iye/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/firmafon/iye/labels{/name}","releases_url":"https://api.github.com/repos/firmafon/iye/releases{/id}","created_at":"2012-08-30T14:10:19Z","updated_at":"2015-11-23T19:00:51Z","pushed_at":"2015-11-26T10:14:02Z","git_url":"git://github.com/firmafon/iye.git","ssh_url":"git@github.com:firmafon/iye.git","clone_url":"https://github.com/firmafon/iye.git","svn_url":"https://github.com/firmafon/iye","homepage":"","size":524,"stargazers_count":35,"watchers_count":35,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":7,"forks":14,"open_issues":7,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/firmafon/iye/pulls/22"},"html":{"href":"https://github.com/firmafon/iye/pull/22"},"issue":{"href":"https://api.github.com/repos/firmafon/iye/issues/22"},"comments":{"href":"https://api.github.com/repos/firmafon/iye/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/firmafon/iye/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/firmafon/iye/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/firmafon/iye/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/firmafon/iye/statuses/af0e3349fd4f25e05ec330314e38e2010cb18a0e"}}}}