Localization of Watch Extension is missing

I have made an iOS 13 app with a watch extension. The app is written in English. I have localized it to German. Everything is fine with the iPhone app; however the watch extension is only available in English. The German localization is not loaded.


When I list the available localizations by printing1 like so:

print(Bundle.main.localizations)

the iPhone app gives me:

["en", "Base", "de"]

which is fine for me, but the Watch Extension only lists:

["en"]

which isn't correct – "de" is missing.


I have added German as a localization in the Interface Builder (Interface Builder Languages Screenshot) but that doesn't seem to work.

I have also tried removing the German localization completely from the project and adding it back – didn't work either. (Localization screenshot with German localization enabled)


What am I missing?


Any help is appreciated. Thank you very much.

1 I know that printing to the console is obsolete, you should use oslog instead, but I haven't gotten around to that yet, to be honest.

Replies

Do you test on watch itself or on simulator ?


Localization is not missing but does not work on simulator.


I use a workaround trick when I need to test:

- first make a complete backup of the project !

- I have files for -en; -de, -fr (for instance) : localizable.strings and interface.strings at least

- for each -en file, I comment out the whole file content and paste at the end the complete copy of the -de file

- then I run and get the -de localization

- once completed, I have jeust a few undo to perform in each -en file

Hi Claude,


thank you for your effort.


Unfortunately, I am alredy testing both in the simulator and on a device (Series 4). My problem is the same in both instances.


Hm. But thank you for that hint, I will now only test on the watch.


Otacon

I have an app extension running on watch, localized in french, spanish and english, works OK. So that's probably something in your configuration. Hard to say with information we get.


Have you checked if any of the 2 work:

- interface.strings localization

- localizable.strings

That's interesting – that you have a working project.


I have made a new project, using the current (first) Xcode 11 GM, this time on macOS Mojave, last time on macOS Catalina, put a label on the canvas, added the localization – and it doesn't work, neither in the simulator (6.0) nor on my physical Watch (5.3.1). I've also put a label on the canvas of the iPhone app, and it's translation does work fine.


Maybe I've made some kind of stupid mistake… I go over it over and over, but I can't find one.


I'm really losing sleep over this.


I have now filed a radar, but I do hope, it's not my mistake.

Could you test on 10.14 and XCode 10 ?


I just tested switching the watch language to spanish. And app is effectively localized on the watch.


Have you a complete sample project you could send me for looking at what is different from what I do in my app ? It is probably some configuration issue.

When you select an interface.strings for a given language, what do you get in File inspector ?

- are all Localization checkboxes checked, including Base.

- is "myApp Watch" checked (not "myApp Watch Extension" in Target membership


When you select an Localizable.strings for a given language, what do you get in File inspector ?

- are all Localization checkboxes checked (here, no Base).

- is "myApp Watch Extension" checked (not "myApp Watch") in Target membership



Compared to what you show, I have created files for the base (english) language as well

Yes, they are checked in the way you describe it.


I have no idea why it's not working.

If you provide an address we could exchange by mail the complete project sample.