Localised Windows


Gerriet M. Denkmann
 

I have two apps: one in Objective-C, the other one in Swift.

Both have:

PrefWindow.xib
PrefWindow.xib (Base)
PrefWindow.strings (German)


The problem is:

1. The Objective-C version just ignores PrefWindow.strings.
2. The Swift version prints (whenever it should show the window):

… [strings] ERROR: QvC-M9-y7g.title not found in table PrefWindow of bundle CFBundle 0x100d02860 </System/Library/Frameworks/AppKit.framework> (not loaded)


But PrefWindow.strings (German) has:
/* Class = "NSWindow"; title = "Preferences"; ObjectID = "QvC-M9-y7g"; */
“QvC-M9-y7g.title" = "Einstellungen";

What am I doing wrong?

Gerriet.


Steve Christensen
 

Did you check to see that the German localization of your strings is included in both targets? If you open both of the app bundles do you see de.lproj folder > PrefVWindow.strings in both?

On Jul 17, 2017, at 11:54 AM, Gerriet M. Denkmann <g@mdenkmann.de> wrote:

I have two apps: one in Objective-C, the other one in Swift.

Both have:

PrefWindow.xib
PrefWindow.xib (Base)
PrefWindow.strings (German)


The problem is:

1. The Objective-C version just ignores PrefWindow.strings.
2. The Swift version prints (whenever it should show the window):

… [strings] ERROR: QvC-M9-y7g.title not found in table PrefWindow of bundle CFBundle 0x100d02860 </System/Library/Frameworks/AppKit.framework> (not loaded)


But PrefWindow.strings (German) has:
/* Class = "NSWindow"; title = "Preferences"; ObjectID = "QvC-M9-y7g"; */
“QvC-M9-y7g.title" = "Einstellungen";

What am I doing wrong?

Gerriet.


Gerriet M. Denkmann
 

On 18 Jul 2017, at 04:49, Steve Christensen <punster@mac.com> wrote:

Did you check to see that the German localization of your strings is included in both targets? If you open both of the app bundles do you see de.lproj folder > PrefVWindow.strings in both?
Both have: app → Content → Resources → de.lproj → PrefWindow.strings



On Jul 17, 2017, at 11:54 AM, Gerriet M. Denkmann <g@mdenkmann.de> wrote:

I have two apps: one in Objective-C, the other one in Swift.

Both have:

PrefWindow.xib
PrefWindow.xib (Base)
PrefWindow.strings (German)


The problem is:

1. The Objective-C version just ignores PrefWindow.strings.
2. The Swift version prints (whenever it should show the window):

… [strings] ERROR: QvC-M9-y7g.title not found in table PrefWindow of bundle CFBundle 0x100d02860 </System/Library/Frameworks/AppKit.framework> (not loaded)


But PrefWindow.strings (German) has:
/* Class = "NSWindow"; title = "Preferences"; ObjectID = "QvC-M9-y7g"; */
“QvC-M9-y7g.title" = "Einstellungen";

What am I doing wrong?

Gerriet.


Gerriet M. Denkmann
 

On 18 Jul 2017, at 04:57, Gerriet M. Denkmann <g@mdenkmann.de> wrote:


On 18 Jul 2017, at 04:49, Steve Christensen <punster@mac.com> wrote:

Did you check to see that the German localization of your strings is included in both targets? If you open both of the app bundles do you see de.lproj folder > PrefVWindow.strings in both?
Both have: app → Content → Resources → de.lproj → PrefWindow.strings
The Objective-C version localises my PrefWindow if I *not* use a WindowController, but instead:

if ( self.window == nil )
{
NSArray *temp;
[ NSBundle.mainBundle loadNibNamed: @"PrefWindow" owner: self topLevelObjects: &temp ];
};

[ self.window makeKeyAndOrderFront: self ];

Either this is a (rather silly) feature of NSWIndowController, or I do not know how to use it properly.
Anyway it works.
Now to fix the Swift version.




On Jul 17, 2017, at 11:54 AM, Gerriet M. Denkmann <g@mdenkmann.de> wrote:

I have two apps: one in Objective-C, the other one in Swift.

Both have:

PrefWindow.xib
PrefWindow.xib (Base)
PrefWindow.strings (German)


The problem is:

1. The Objective-C version just ignores PrefWindow.strings.
2. The Swift version prints (whenever it should show the window):

… [strings] ERROR: QvC-M9-y7g.title not found in table PrefWindow of bundle CFBundle 0x100d02860 </System/Library/Frameworks/AppKit.framework> (not loaded)


But PrefWindow.strings (German) has:
/* Class = "NSWindow"; title = "Preferences"; ObjectID = "QvC-M9-y7g"; */
“QvC-M9-y7g.title" = "Einstellungen";

What am I doing wrong?

Gerriet.