Localization of the "Edit" menu and other standard menus

I am trying to translate my Mac application into several different languages. There are a large number of menu items, especially the "Edit" menu, which are provided by OS X and work automatically. I suggested that these items will be automatically translated, but they do not seem to be that way. As you can see in the screenshot below, I get a mixture of translated and untranslated elements.

The Edit menu, partially localized

Strange, the same menu items are translated when they appear in the context menu, for example, in NSTextView. In this case, everything will be automatically translated, except for the two services below.

A contextual menu, automatically translated

So I'm very confused: do I really need to translate the Edit menu? I obviously want my translations to match Apple, so I would make a lot of copies and attachments. Or is there some kind of secret to get localization? My application needs 10.7 or later, so if there is anything new that makes it easier, this should not be a problem.

Addendum: Assuming there is no easier way to do this, is there at least an easy way to copy the text of Apple translations so that I can paste them into my application? I thought I could just open NIB from one of my applications, but all of them are compiled and cannot be opened in Xcode. I can open them in a text editor, but finding suitable lines in this way does not seem faster than just redisplaying everything.

+4
source share
2 answers

From what I can say, there really is no easy way to do this. In particular, for the Japanese, I used this process:

  • In Finder, right-click on an existing application, for example TextEdit, and select "Show Package Contents"

  • Inside the package, go to "Content / Resources" and you will see localization folders such as en.lproj and Japanese.lproj

  • Inside these folders you will see NIB files. Using text editing (e.g. BBEdit), open the main NIB file for the main language and the language you want to translate into. In many cases, the files you want will be called MainMenu.nib. With TextEdit, files are called Edit.nib. XML files, so they are clearly structured, but there are many things that you do not need. Opening two files makes it easy.

  • In the English file you can find something like "Check document now." Right below is the key combination (;) and the method that invokes the menu item ( checkSpelling: . Now you can search the Japanese file for checkSpelling, and the translation you need is right above it. This sounds tedious, but I found it pretty fast for the most part, especially since you rarely need to enter everything to find what you need. Many method names are also obvious - for example, cut: paste: copy: etc., so that you can skip checking the English file first.

  • Menu items that are submenus are a bit more complicated, since the method will be submenuAction: You can use the surrounding XML to make sure that you look at the same thing in both NIBs, or you can test the application yourself to make sure that you look at the correct text. Google Translate was useful when I wanted to make sure I copied the right thing. You might even try using Google Translate first and just make sure that it matches what Apple uses.

Obviously, you need to be very careful, or someone who speaks the language checks that everything is working as expected. It would be better if the translator did all the work. In my case, I had people who voluntarily performed translations, and all the text unique to my application has already been translated. I did not want to bother them with the tedious work of translating a text that someone else had translated.

+1
source

Localized threads contain MainMenu.nib files that are pre-localized in different languages. All elements are connected to the corresponding actions, and several additional resources are added (for example, flag graphics, ISO language tables, etc.).

localize-mainmenu is a command-line tool that automatically localizes common items on the OS X application’s main menu.

+3
source

All Articles