{"action":"created","issue":{"url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/91","repository_url":"https://api.github.com/repos/Flinesoft/BartyCrouch","labels_url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/91/comments","events_url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/91/events","html_url":"https://github.com/Flinesoft/BartyCrouch/issues/91","id":305842208,"number":91,"title":"Base language detection","user":{"login":"AlmightyCZ","id":13013656,"avatar_url":"https://avatars3.githubusercontent.com/u/13013656?v=4","gravatar_id":"","url":"https://api.github.com/users/AlmightyCZ","html_url":"https://github.com/AlmightyCZ","followers_url":"https://api.github.com/users/AlmightyCZ/followers","following_url":"https://api.github.com/users/AlmightyCZ/following{/other_user}","gists_url":"https://api.github.com/users/AlmightyCZ/gists{/gist_id}","starred_url":"https://api.github.com/users/AlmightyCZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlmightyCZ/subscriptions","organizations_url":"https://api.github.com/users/AlmightyCZ/orgs","repos_url":"https://api.github.com/users/AlmightyCZ/repos","events_url":"https://api.github.com/users/AlmightyCZ/events{/privacy}","received_events_url":"https://api.github.com/users/AlmightyCZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-03-16T08:36:59Z","updated_at":"2018-05-11T13:08:51Z","closed_at":null,"author_association":"NONE","body":"I have a project, with following language-related properties in project.pbxproj\r\n`developmentRegion = English;`\r\n`knownRegions = (\t\t\t\ten,\t\t\t\tBase,\t\t\t\tsk,\t\t\t\tcs,\r\n\t\t\t);` \r\nAlso the Info.plist has `<key>CFBundleDevelopmentRegion</key>` set to `<string>en</string>`.\r\nAll the designer files (storyboard, views etc.) are designed in English.\r\n\r\n\r\nWhenever I run `bartycrouch interfaces -p \".\"` in the project root folder, I get all the *.strings files updated, however all the strings from the designer files are written into files in the cs.lproj folder (where the Czech language is supposed to be) instead of the en.proj folder. \r\n\r\nIs there something wrong with my project? Or is there a way (parameter?) to specify my base language for bartycrouch?\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/comments/388358442","html_url":"https://github.com/Flinesoft/BartyCrouch/issues/91#issuecomment-388358442","issue_url":"https://api.github.com/repos/Flinesoft/BartyCrouch/issues/91","id":388358442,"user":{"login":"Dschee","id":6942160,"avatar_url":"https://avatars2.githubusercontent.com/u/6942160?v=4","gravatar_id":"","url":"https://api.github.com/users/Dschee","html_url":"https://github.com/Dschee","followers_url":"https://api.github.com/users/Dschee/followers","following_url":"https://api.github.com/users/Dschee/following{/other_user}","gists_url":"https://api.github.com/users/Dschee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dschee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dschee/subscriptions","organizations_url":"https://api.github.com/users/Dschee/orgs","repos_url":"https://api.github.com/users/Dschee/repos","events_url":"https://api.github.com/users/Dschee/events{/privacy}","received_events_url":"https://api.github.com/users/Dschee/received_events","type":"User","site_admin":false},"created_at":"2018-05-11T13:08:51Z","updated_at":"2018-05-11T13:08:51Z","author_association":"OWNER","body":"I found the problem. It's actually a feature so I'm not sure what to do about it, but let me explain it first.\r\n\r\n## Problem explanation\r\n\r\nHere's an extract of the changes happening in `cs.lproj` when BartyCrouch runs in your project:\r\n<img width=\"533\" alt=\"bildschirmfoto 2018-05-11 um 14 48 07\" src=\"https://user-images.githubusercontent.com/6942160/39925048-7cd4cf16-552a-11e8-920b-77aaf340eff9.png\">\r\n\r\nLet's also have a look at the same entry in the language `sk.lproj`:\r\n<img width=\"522\" alt=\"bildschirmfoto 2018-05-11 um 14 50 59\" src=\"https://user-images.githubusercontent.com/6942160/39925146-d3dc8056-552a-11e8-8705-6b86732ae599.png\">\r\n\r\nAt first sight one might think, why is BartyCrouch replacing the correct Czech translation with the English one? And why isn't it doing so in the Slovak language?\r\n\r\nHere's what's happening: If you take a look at the comment, you'll notice that it's the same for both languages. As a matter of fact, when creating the Strings files the first time in Xcode, Xcode will automatically take the values from the XIB or Storyboard and put them into the comments. It will also never change the comment value, even if you make changes in the XIB or Storyboard file, leaving you to have three different values for every entry: The actual value, the comment value and the XIB/Storyboard value. At the beginning the latter two are the same, but since Xcode doesn't update them, they tend to be different over time.\r\n\r\nSince we can see that in the comment the value is of Czech language, I can assume that at the time where you first let Xcode generate the Strings files, your XIB or Storyboard had values in Czech language. It seems you later have changed this and made every value within the XIB or Storyboard be of English language. BartyCrouch has a feature built-in that will automatically update the comment value for you. So that's why we are seeing a change in the comment line for both example languages above. An additional feature of BartyCrouch is to – in case the comment value matches the real value exactly – to also update the real value. Since the actual value of the Czech translation is the same as the comment value, this is what happened here and what made BartyCrouch also update the value and replace it with the new English value which it found in the XIB or Storyboard file.\r\n\r\n## Solution\r\n\r\nNow that we know what the problem is, let's examine what can be done to solve this problem and/or to prevent it in the future:\r\n\r\n1. To prevent this issue from happening again is to use English (or whatever language) in the XIB or Storyboard file from the beginning and never changing the language.\r\n2. When the language is changed though, one manual way to fix it is to update the comment values to the new language manually. For example:\r\n\r\n```\r\n/* Class = \"UILabel\"; text = \"Proveďte synchronizaci.\"; ObjectID = \"RvR-Nz-aYE\"; */\r\n```\r\nwould need to be manually changed to\r\n```\r\n/* Class = \"UILabel\"; text = \"Sync to get data.\"; ObjectID = \"RvR-Nz-aYE\"; */\r\n```\r\n3. Alternatively, you can also let BartyCrouch do its work and revert the wrong changes manually once. From then on (as long as you don't change the language again) the issue shouldn't happen again. This is the way I recommend you to fix this issue – with the help of a Git GUI tool (like [SourceTree](https://www.sourcetreeapp.com)) this shouldn't be a problem."}}
{"actor":{"display_login":"Dschee"}}