BartyCrouch icon indicating copy to clipboard operation
BartyCrouch copied to clipboard

Translations not attempted

Open jtruher opened this issue 4 years ago • 4 comments

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 avatar Jun 17 '20 22:06 jtruher

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!

jtruher avatar Jun 17 '20 23:06 jtruher

@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!

Jeehut avatar Jun 19 '20 06:06 Jeehut

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

uniqby avatar Jul 04 '20 14:07 uniqby

@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"

jtruher avatar Jul 04 '20 21:07 jtruher