FROM : Jean-Daniel Dupas
DATE : Tue Apr 01 12:25:03 2008
The strings you are looking for are in the AppKit ressources, but I
don't think there are part of the API, the keys can change at anytime
and you cannot rely on the files names. (in Leopard, the Undo.strings
file contains a "Paste Font" key, but it's not garantee that it remain
like that)
Anyway, you can probably copy this Undo.strings file in your
application.
Le 1 avr. 08 à 11:52, Gerriet M. Denkmann a écrit :
> Cocoa uses (automatically) localized strings. I would like to do the
> same.
>
> E.g. using NSTextView and pasting a font, the Edit menu will
> suddenly show Undo "Paste Font".
> If the same app is running with German as the preferred language,
> the Edit menu will contain Undo "Schrift einsetzen" (yes, the "Undo"
> also gets translated, but this does not interest me at this point).
>
> When I override this mechanism, doing my own undo handling I have to
> use setActionName: "Paste Font".
> But this is only correct if the current language is English.
>
> So I have to do: setActionName: NSLocalizedStringFromTable( @"Paste
> Font", @"UndoStrings", @"setting font via menu Format → Font");
>
> But this means that I have to create UndoStrings.strings files for
> about 15 languages, which is kind of tedious.
> Also: If Apple decides that the correct translation for "Paste Font"
> should be "Schriftart einfügen" instead of "Schrift einsetzen", my
> app would look strange, using different words compared to all other
> apps.
>
> So I want something like:
> NSLocalizedStringFrom_the_Table_used_by_the_System(..).
> Or maby I could get at the official translations using
> NSDefaultManager?
>
> These strings must be somewhere - so how to find them? Neither
> Spotlight nor grep seem to handle utf-16 files (like .strings).
>
>
> Kind regards,
>
> Gerriet.
DATE : Tue Apr 01 12:25:03 2008
The strings you are looking for are in the AppKit ressources, but I
don't think there are part of the API, the keys can change at anytime
and you cannot rely on the files names. (in Leopard, the Undo.strings
file contains a "Paste Font" key, but it's not garantee that it remain
like that)
Anyway, you can probably copy this Undo.strings file in your
application.
Le 1 avr. 08 à 11:52, Gerriet M. Denkmann a écrit :
> Cocoa uses (automatically) localized strings. I would like to do the
> same.
>
> E.g. using NSTextView and pasting a font, the Edit menu will
> suddenly show Undo "Paste Font".
> If the same app is running with German as the preferred language,
> the Edit menu will contain Undo "Schrift einsetzen" (yes, the "Undo"
> also gets translated, but this does not interest me at this point).
>
> When I override this mechanism, doing my own undo handling I have to
> use setActionName: "Paste Font".
> But this is only correct if the current language is English.
>
> So I have to do: setActionName: NSLocalizedStringFromTable( @"Paste
> Font", @"UndoStrings", @"setting font via menu Format → Font");
>
> But this means that I have to create UndoStrings.strings files for
> about 15 languages, which is kind of tedious.
> Also: If Apple decides that the correct translation for "Paste Font"
> should be "Schriftart einfügen" instead of "Schrift einsetzen", my
> app would look strange, using different words compared to all other
> apps.
>
> So I want something like:
> NSLocalizedStringFrom_the_Table_used_by_the_System(..).
> Or maby I could get at the official translations using
> NSDefaultManager?
>
> These strings must be somewhere - so how to find them? Neither
> Spotlight nor grep seem to handle utf-16 files (like .strings).
>
>
> Kind regards,
>
> Gerriet.
| Related mails | Author | Date |
|---|---|---|
| Gerriet M. Denkman… | Apr 1, 11:52 | |
| Jean-Daniel Dupas | Apr 1, 12:25 | |
| Gerriet M. Denkman… | Apr 1, 14:47 | |
| Jean-Daniel Dupas | Apr 1, 14:55 | |
| Gary L. Wade | Apr 1, 20:29 |






Cocoa mail archive

