> On Aug 22, 2018, at 6:56 PM, Lars C. Hassing <l...@ccieurope.com> wrote:
> 
> OK, so Carbon was designed with the smart feature to provide localized 
> standard application menu items,
> whereas Cocoa app always are stuck with the menu from the .xib file.
        I would put “smart” in quotes because it often gets it wrong, which is 
one of the reasons for the switch to the current model.  Carbon also only 
supported a small set of languages. Cocoa supports 100+ localizations, 
including Right-To-Left localizations like Hebrew & Arabic.  So Cocoa is much 
more flexible & localizable compared to Carbon.


> The Carbon approach is much better, e.g. to accommodate new application menu 
> items from Apple,
> Cocoa developers has to check if a new menubar template has arrived, and 
> update their .xib files,
        Not exactly. You can create a .xib and configure it for base 
localization so there is only one nib for all localizations.  With autolayout, 
the UI will lay out properly regardless of the localization. Then for each 
localization you supply your own strings that are displayed on screen.  See:
https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LocalizingYourApp/LocalizingYourApp.html


> And all Cocoa developers have to implement CreateStandardWindowMenu and 
> updating it themselves ?
        No, they just have a menu bar set in (one of) their .xib files and the 
app takes care of the rest.  Again, much more flexible.

—Rob




>> Den 23. aug. 2018 kl. 02.39 skrev Eric Schlegel <eri...@apple.com 
>> <mailto:eri...@apple.com>>:
>> 
>> 
>> 
>>> On Aug 22, 2018, at 5:19 PM, Lars C. Hassing <l...@ccieurope.com 
>>> <mailto:l...@ccieurope.com>> wrote:
>>> 
>>> Thanks, but I would like to avoid an .xib file.
>>> However, like you suggested I have created a new Cocoa app in Xcode, and I 
>>> look at its content as a basis for creating the menubar programmatically.
>>> 
>>> Still, this doesn’t doesn’t solve the localization.
>>> It seems Carbon does the localization, but Cocoa apps do not have that 
>>> feature.
>>> If I run a Cocoa app with Danish as my Preferred Language, the application 
>>> menu has the English “Show Others”,
>>> where a Carbon app would display “Skjul andre”.
>> 
>> I believe that’s because for the Carbon case, the menu contents are coming 
>> from HIToolbox.framework’s localized resources, and we have all of the 
>> localizations already provided by Apple. 
>> 
>> In the Cocoa case, it would be up to you to localize your .nib/xib for each 
>> supported language. I think you can find our recommendation translation 
>> glossaries here: https://developer.apple.com/download/more/?=Glossaries 
>> <https://developer.apple.com/download/more/?=Glossaries>. If you don’t use a 
>> nib/xib, you could instead put the localizations into a strings file.
>> 
>> -eric
>> 
>> 
>> 
>>> /Lars
>>> 
>>> 
>>>> Den 23. aug. 2018 kl. 02.03 skrev Rob Petrovec <petr...@mac.com 
>>>> <mailto:petr...@mac.com>>:
>>>> 
>>>> You should use a .xib instead of creating the menu bar programatically.  
>>>> Create a new Cocoa App in Xcode and it will have all of what you seek 
>>>> pre-configured in a .xib with no code needed.
>>>> 
>>>> —Rob
>>>> 
>>>> 
>>>>> On Aug 22, 2018, at 2:14 PM, Lars C. Hassing <l...@ccieurope.com 
>>>>> <mailto:l...@ccieurope.com>> wrote:
>>>>> 
>>>>> In decarbonizing I have now come to creating a menubar programmatically 
>>>>> using NSMenu.
>>>>> 
>>>>> Carbon seems to be so nice to add standard items to the application menu: 
>>>>> Services, Hide app, Hide Others, Show All, Quit app,
>>>>> and they are added using the user’s Preferred Language setting in System 
>>>>> Preferences’s Language & Region,
>>>>> so in German “Hide Others” is added as “Andere ausblenden”.
>>>>> 
>>>>> However, it seems that in Cocoa I have to add these standard items myself,
>>>>> but how can I find out what “Hide Others” is called in the user’s 
>>>>> Preferred Language ?
>>>>> 
>>>>> And what is the Cocoa equivalent of CreateStandardWindowMenu ?
>>>>> /Lars
>>>>> 
>>>>> _______________________________________________
>>>>> Do not post admin requests to the list. They will be ignored.
>>>>> Carbon-dev mailing list      (Carbon-dev@lists.apple.com 
>>>>> <mailto:Carbon-dev@lists.apple.com>)
>>>>> Help/Unsubscribe/Update your Subscription:
>>>>> https://lists.apple.com/mailman/options/carbon-dev/petrock%40mac.com 
>>>>> <https://lists.apple.com/mailman/options/carbon-dev/petrock%40mac.com>
>>>>> 
>>>>> This email sent to petr...@mac.com <mailto:petr...@mac.com>
>>>> 
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Carbon-dev mailing list      (Carbon-dev@lists.apple.com 
>>> <mailto:Carbon-dev@lists.apple.com>)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/carbon-dev/ericsc%40apple.com 
>>> <https://lists.apple.com/mailman/options/carbon-dev/ericsc%40apple.com>
>>> 
>>> This email sent to eri...@apple.com <mailto:eri...@apple.com>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (Carbon-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/carbon-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to