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

Translations not attempted #192

Open
jtruher opened this issue Jun 17, 2020 · 4 comments
Open

Translations not attempted #192

jtruher opened this issue Jun 17, 2020 · 4 comments
Labels

Comments

@jtruher
Copy link

jtruher commented Jun 17, 2020

Expected Behavior

Non-sourceLocale languages should have translated strings if the 'translate' step exists.

Actual Behavior

No translations are performed, or even attempted, as near as I can tell.

Steps to Reproduce the Problem

  1. run bartycrouch update
  2. See this output:
Starting Task 'Update Interfaces' ...
2020-06-17 15:34:53.276: ✅  ./musicplayer-extension/Base.lproj/MainInterface.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
2020-06-17 15:34:53.350: ✅  ./musicplayer/Assets/Base.lproj/LaunchScreen.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
2020-06-17 15:34:53.417: ✅  ./musicplayer/Assets/Base.lproj/Main.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
Task 'Update Interfaces' took 0.955 seconds.
Starting Task 'Update Code' ...
2020-06-17 15:34:53.650: ✅  .:  Successfully updated strings file(s) of Code files.
Task 'Update Code' took 0.233 seconds.
Starting Task 'Code Transform' ...
Task 'Code Transform' took 0.174 seconds.
Starting Task 'Normalize' ...
Starting Task 'Translate' ...
2020-06-17 15:34:53.882: ✅  ./en.lproj/Localizable.strings:  Successfully translated 0 values in 0 files.

I've got 9 languages in there, and it's worked successfully before, but the translate step doesn't seem tremendously reliable.

Specifications

  • Version: 4.2.0
  • Platform: MacOS
  • IDE Version: 11.5 (11E608c)

My config file: yes, I know, I'm doing some foolish things, but I promise, this worked at least once! 😃

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

[update.interfaces]
paths = ["."]
defaultToBase = true
ignoreEmptyStrings = false
unstripped = false

[update.code]
codePaths = ["."]
localizablePaths = ["."]
defaultToKeys = true
additive = true
unstripped = false
plistArguments = true

[update.transform]
codePaths = ["."]
localizablePaths = ["."]
transformer = "foundation"
supportedLanguageEnumPath = "."
typeName = "BartyCrouch"
translateMethodName = "translate"

[update.translate]
paths = "."
secret = "XXX"
sourceLocale = "en"

[update.normalize]
paths = ["."]
sourceLocale = "en"
harmonizeWithSource = true
sortByKeys = true

[lint]
paths = ["."]
duplicateKeys = true
emptyValues = true
@jtruher jtruher added the bug label Jun 17, 2020
@jtruher
Copy link
Author

jtruher commented Jun 17, 2020

For anyone who finds this: I was able to get things translating again by setting:

  • defaultToBase in update.interfaces to false,
  • defaultToKeys in update.code to false
    and huzzah!
Starting Task 'Update Interfaces' ...
2020-06-17 16:03:17.683: ✅  ./musicplayer-extension/Base.lproj/MainInterface.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
2020-06-17 16:03:17.755: ✅  ./musicplayer/Assets/Base.lproj/LaunchScreen.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
2020-06-17 16:03:17.824: ✅  ./musicplayer/Assets/Base.lproj/Main.storyboard:  Successfully updated strings file(s) of Storyboard or XIB file.
Task 'Update Interfaces' took 0.238 seconds.
Starting Task 'Update Code' ...
2020-06-17 16:03:18.058: ✅  .:  Successfully updated strings file(s) of Code files.
Task 'Update Code' took 0.234 seconds.
Starting Task 'Code Transform' ...
Task 'Code Transform' took 0.183 seconds.
Starting Task 'Normalize' ...
Starting Task 'Translate' ...
2020-06-17 16:03:26.952: ✅  ./en.lproj/Localizable.strings:  Successfully translated 144 values in 6 files.
Task 'Translate' took 8.67 seconds.
Time: 0h:00m:09s

I'm not sure if this was something I was doing wrong, or if this is safe to close, or what!

@Jeehut
Copy link
Member

Jeehut commented Jun 19, 2020

@jtruher Let's keep it open until we have time to reproduce the situation you had before. If it was not working with the default options turned on, then something is wrong anyways and it should be fixed.

Thank you for reporting!

@uniqby
Copy link

uniqby commented Jul 4, 2020

Still not working.

Version: 4.2.0
Platform: MacOS
IDE Version: 11.5 (11E608c)

bartycrouch init

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

[update.interfaces]
paths = ["."]
defaultToBase = false
ignoreEmptyStrings = false
unstripped = false

[update.code]
codePaths = ["."]
localizablePaths = ["."]
defaultToKeys = false
additive = true
unstripped = false
plistArguments = true

[update.transform]
codePaths = ["."]
localizablePaths = ["."]
transformer = "swiftgenStructured"
supportedLanguageEnumPath = "."
typeName = "BartyCrouch"
translateMethodName = "translate"

[update.normalize]
paths = ["."]
sourceLocale = "en"
harmonizeWithSource = true
sortByKeys = true

[lint]
paths = ["."]
duplicateKeys = true
emptyValues = true

@jtruher
Copy link
Author

jtruher commented Jul 4, 2020

@uniqby - it appears that you're missing the "translate" task in the tasks array at the top, and the update.translate block, which should look something like this:

[update.translate]
paths = "."
secret = "YOUR_AZURE_SECRET_GOES_HERE"
sourceLocale = "en"

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

No branches or pull requests

3 participants