BartyCrouch | Incrementally update/translate your Strings files | Internationalization library
kandi X-RAY | BartyCrouch Summary
kandi X-RAY | BartyCrouch Summary
BartyCrouch incrementally updates your Strings files from your Code and from Interface Builder files. "Incrementally" means that BartyCrouch will by default keep both your already translated values and even your altered comments. Additionally you can also use BartyCrouch for machine translating from one language to 60+ other languages. Using BartyCrouch is as easy as running a few simple commands from the command line what can even be automated using a build script within your project. Checkout this blog post to learn how you can effectively use BartyCrouch in your projects.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of BartyCrouch
BartyCrouch Key Features
BartyCrouch Examples and Code Snippets
Community Discussions
Trending Discussions on BartyCrouch
QUESTION
I have a Xcode ObjC project, with following language-related properties in project.pbxproj
...ANSWER
Answered 2019-Feb-04 at 15:39I already answered this question on the related GitHub issue, but let me explain it here, too for purposes of completeness:
Problem explanationHere's an extract of the changes happening in cs.lproj
when BartyCrouch runs in your project:
Let's also have a look at the same entry in the language sk.lproj
:
At 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?
Here'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.
Since 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.
SolutionNow 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:
- 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.
- 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:
QUESTION
I'm using BartyCrouch to maintain an up-to-date localized project. My project is currently translated in 4 different languages, and I'm going to add some new languages. My issue is that my base Localizable.strings file has about 200-300 resources, even though there are probably less than 100 currently used in the project.
I'm looking for the best way to remove the un-referenced localized strings in the project, all while keeping the currently localized values. Is there any native solution or do I have to use a third party? And if so, is there anything automatic?
...ANSWER
Answered 2017-Aug-01 at 09:09Well, I definitely didn't look hard enough. I think it's worth posting an answer instead of deleting the question because I don't think the answer is on Stackoverflow yet.
https://github.com/ijoshsmith/abandoned-strings
This little gem will do exactly this. Easy to use. Simply download the zip file, use the Terminal to go into the "AbandonedStrings" folder containing a single "main.swift" file. Then, on the terminal, enter: ./main.swift /the/path/to/your/project
This will display a list of all the unused ressources. Then, if you also want the script to delete them, simply add "write" at the end of the command.
Watch out though: it will delete all the Storyboard localized ressources, so commit your project before and simply discard the changes.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install BartyCrouch
In order to truly profit from BartyCrouch's ability to update & lint your .strings files you can make it a natural part of your development workflow within Xcode. In order to do this select your target, choose the Build Phases tab and click the + button on the top left corner of that pane. Select New Run Script Phase and copy the following into the text box below the Shell: /bin/sh of your new run script phase:. Next, make sure the BartyCrouch script runs before the steps Compiling Sources (and SwiftGen if used) by moving it per drag & drop, for example right after Target Dependencies. Now BartyCrouch will be run on each build and you won't need to call it manually ever (again). Additionally, all your co-workers who don't have BartyCrouch installed will see a warning with a hint on how to install it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page