Muxor
Muxor

Reputation: 171

Xcode 10 - How to refresh localization of a Siri shortcut intent definition file?

I have an intent definition file for a Siri shortcut. When I click on localize Xcode does very well create a localization file, each string beeing used is present with an ID. But how do I refresh this if I added a new intent in the same file or just added a new possible response to the same file? I currently only found two ways:

So, does anybody know a way to refresh the auto-localization of an intents definition file?

Upvotes: 8

Views: 1565

Answers (3)

Mark Bridges
Mark Bridges

Reputation: 8448

I wish Apple would fix with this.

In the meantime, the easiest way of dealing with it that I've found is this...

Add support for a new language in your project. For example, add Australian English. Then you'll get a new .strings file with all the new keys in it with the values from your intents definition.

Paste the contents of that into your existing English version and delete support for that new language.

If you want to get the new keys merged into your existing localised .strings files then you can use this https://github.com/Flinesoft/BartyCrouch Once it's installed you can run bartycrouch update and it'll sync the changes into all your .strings files.

Upvotes: 1

Zaphod
Zaphod

Reputation: 7270

I ran into the same problem lately, and I managed to fix it with a simple workaround and two small, quick and dirty scripts:

  1. Be sure to have your old localizations .strings files in your git repository
  2. Uncheck all your .intendefinition localizations (and delete them)
  3. Check back all your localizations, it will recreate the .strings files, but without your old translations (hopefully, they are safe in git)
  4. DO NOT COMMIT THEM (yet)
  5. For each .strings file run my little script this way: {script-path}/update-modified-strings-file.sh {project-path}/xx.lproj/YourIntents.strings
  6. Check if everything is ok
  7. Commit
  8. Live long and prosper...

Please be sure to put both scripts in the same directory:

The first script checks out the old version of the strings with your existing translations, the second merges the new file containing new entries with the old existing translations.

Hope this helps.

Upvotes: 2

Mathias
Mathias

Reputation: 3981

I have the same question, i played around with this exact thing tonight. From what i can see, i have to remove all localized files and recreate them, just like you said...

Upvotes: 0

Related Questions