Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments are not being updated with code option #38

Closed
m9rc1n opened this issue Nov 17, 2016 · 12 comments
Closed

Comments are not being updated with code option #38

m9rc1n opened this issue Nov 17, 2016 · 12 comments

Comments

@m9rc1n
Copy link
Contributor

m9rc1n commented Nov 17, 2016

Given that I have fully translated app with code String files
And I have String let sample = NSLocalizedString("category.sample", comment: "Sample")
When I change a comment for sample String to comment: "New Sample"
Then comment is not updated in Strings file.

Are you going to implement that feature in future?

Btw. super useful tool! Thanks

@Jeehut
Copy link
Member

Jeehut commented Nov 21, 2016

Hi @marc-inn, thank you for your feature request. I just made an attempt to implement this and released a new version with it (3.4.0). Please upgrade BartyCrouch (e.g. via brew update && brew upgrade flinesoft/bartycrouch/bartycrouch) and use the new option override-comments (short -c) on the code sub command – also documented in the README here.

I hope this works, I haven't had the time to test it myself, but it might work. Please reopen the issue if it doesn't, I'm closing it for now.

@m9rc1n
Copy link
Contributor Author

m9rc1n commented Nov 21, 2016

Working great!

I posted PR with small update, which made comments working for me.

Thanks

@Jeehut
Copy link
Member

Jeehut commented Nov 22, 2016

Ahh yeah, I forgot that one. Great catch!

Would you mind also adding a test within your PR for the overrideComments option? That would be great to make sure the feature doesn't break in future releases. If not, I'll try to add one sometime later when I have more spare time. :)

@m9rc1n
Copy link
Contributor Author

m9rc1n commented Nov 22, 2016

No problem :P Tests added.

@Jeehut
Copy link
Member

Jeehut commented Nov 23, 2016

That was not exactly what I was looking for, but never mind, I'm merging it anyway, we can add tests for the overrideComments options change logic regarding the Strings files later on. ;)

@Jeehut
Copy link
Member

Jeehut commented Nov 23, 2016

I just released v3.4.1 with your bug fix. Thanks again!

@banoslo
Copy link

banoslo commented Jun 2, 2019

Updating does not work for me. This is an issue again since we have to use 'bartycrouch update' instead of 'bartycrouch code'. Or am I missing something?

@Jeehut
Copy link
Member

Jeehut commented Jun 2, 2019

Yes, you are missing something. There is no „code“ subcommand anymore starting with version 4 of BartyCrouch. Please refer to the migration guide and the config section in the README for more information.

@noah-nuebling
Copy link

noah-nuebling commented Aug 15, 2022

Hi! Is the overrideComments option still available? It doesn't seem to work for me.

I can only get the comments to change if I completely delete a key from the .strings file before running bartycrouch update

I'm on macOS 13.0 Beta (22A5321d), using bartycrouch 4.11.0, and my .bartycrouch.toml looks like this:

[update]
tasks = ["interfaces", "code", "normalize"]

[update.interfaces]
paths = ["app", "helper", "accomplice"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs", "frameworks", "tests", "*/external", "*/SupportFiles", "*/iOS-Polynomial-Regression-master"]
defaultToBase = false
ignoreEmptyStrings = false
unstripped = false
ignoreKeys = ["#bartycrouch-ignore!", "#bc-ignore!", "#i!"]

[update.code]
overrideComments = true
codePaths = ["app", "helper", "accomplice"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs", "frameworks", "tests", "*/external", "*/SupportFiles", "*/iOS-Polynomial-Regression-master"]
localizablePaths = ["./Localization"]
defaultToKeys = false
additive = false
unstripped = false
plistArguments = true
ignoreKeys = ["#bartycrouch-ignore!", "#bc-ignore!", "#i!"]

[update.transform]
codePaths = ["app", "helper", "accomplice"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs", "frameworks", "tests", "*/external", "*/SupportFiles", "*/iOS-Polynomial-Regression-master"]
localizablePaths = ["./Localization"]
transformer = "foundation"
supportedLanguageEnumPath = "."
typeName = "BartyCrouch"
translateMethodName = "translate"
separateWithEmptyLine = true

[update.normalize]
paths = ["app", "helper", "accomplice"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs", "frameworks", "tests", "*/external", "*/SupportFiles", "*/iOS-Polynomial-Regression-master"]
sourceLocale = "de"
harmonizeWithSource = true
sortByKeys = true
separateWithEmptyLine = true

[lint]
paths = ["app", "helper", "accomplice"]
subpathsToIgnore = [".git", "carthage", "pods", "build", ".build", "docs", "frameworks", "tests", "*/external", "*/SupportFiles", "*/iOS-Polynomial-Regression-master"]
duplicateKeys = true
emptyValues = true

My CLT output looks like this
CleanShot 2022-08-15 at 17 57 43@2x

Not sure if relevant but the normalize task doesn't seem to output anything after the ... so maybe there's something going wrong there?

Let me know if I should create an issue for this.

@Jeehut
Copy link
Member

Jeehut commented Aug 16, 2022

@noah-nuebling If an option is documented in the README, it is still supported. Feel free to report an issue.

@noah-nuebling
Copy link

noah-nuebling commented Sep 24, 2022

Alright @Jeehut, I posted an issue. It's mostly copy pasted from the comment but I added some extra details.

I found I can just delete a comment and then bartycrouch will regenerate it to the updated value, which made things pretty usable for me but it would still be really nice if this was fixed!

@Jeehut
Copy link
Member

Jeehut commented Oct 8, 2022

FYI: @noah-nuebling's issue was fixed in the meantime and this should fully work again in version 4.13.0+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants