Re(2): More localization
Re(2): More localization
- Subject: Re(2): More localization
- From: Jens Bauer <email@hidden>
- Date: Wed, 12 Dec 2001 15:55:25 +0100
Hi Douglas,
On Tue, 11 Dec, 2001, Douglas Davidson <email@hidden> wrote:
>
On Tuesday, December 11, 2001, at 10:56 AM, Jens Bauer wrote:
>
>
> 1: Create a cocoa application
>
> 2: Create a "Localizable.strings" in the "Resources" group containing
>
> one
>
> English and one Danish file:
>
>
The Localizable.strings file is for those strings that are referred to
>
in code using one of the NSBundle or CFBundle string localization APIs.
>
You will also need to create localized versions of your nibs, to
>
localize those strings that appear in nibs rather than in code. The
>
localized nibs can also be re-laid-out as desired. There may be other
>
elements that require localization--images or sounds, for example--which
>
would typically be treated as separate localizable resources.
>
>
See the System Overview documentation for more information on the
>
localization process; there used to be a separate Localization release
>
note, but I believe its contents have now been subsumed by the System
>
Overview and Bundle Services documentation.
Thanks Douglas, I got everything working now. :)
After a bunch of reading, I finally got it to work. :)
I had success, when I created the strings using genstrings, but not when
I made them
by hand. When I look at the freshly generated strings, I found out that I
forgot the
trailing semicolon, duh! :)
"string" = "string";
Here's what I found:
/Developer/Documentation/CoreFoundation/BundleServices/Bundle_Services/
Concepts/CFBundle-20.html
and in TextEdit, I find this:
NSLocalizedString(@"The file have been removed.", @"Subtitle of alert
panel indicating file couldn't be reverted")
For other people having problems, I'd recommend the same documentation
you mentioned,
the specific page is:
/Developer/Documentation/Essentials/SystemOverview/International/
Internation_Application.html
-This told me everything I needed to get rolling. :)
I had another problem, where I found the solution, it's about the danish
character 'f' ('ae').
I made a file called "Custom.strings", which I access by using the
following code:
[message setTitle:NSLocalizedStringFromTable(@"Window Title", @"Custom",
@"Window Title")];
When "Custom.strings" contain this:
"Window Title" = "Vflg";
I get this message text in my dialog-box:
"V3/4lg"
..where "3/4" is one character.
-If I set the string directly from my source-code using @"Vflg", it works
fine, and ofcourse,
it works if I change it directly in the nib file using Interface Builder.
OK, now I open PropertyListEditor, a fine utility. I open the file
"Custom.strings" in this application,
and it reads and converts almost every line (except the line containing
the danish 'f'). I copy and paste
the line from a text-editor into the PropertyListEditor's document and I save.
PropertyListEditor now converted the text-file into a nice XML-file,
which can also be used directly.
The difference is that now I have UTF-8 encoding contrary to "no encoding". :)
-I hope you can use this information for other purposes as well..
Love,
Jens