Professional Web Applications Themes

CFCopyLocalizedString problems - Mac Programming

On Fri, 15 Aug 2003, Jonathan Baumgartner wrote: > This is driving me nuts. I have an existing project I am trying to > localize. I added a Localized.strings file, and localized it for > English. In that file I added: It should be Localizable.strings Also the file will be ignored if it is malformed (missing semicolon, curly quotes instead of normal ones). Fred > > /* No comment provided by engineer. */ > "SnagPathHFS" = "Snag Path HFS"; > > /* No comment provided by engineer. */ > "SnagPathUnix" = "Snag Path Unix"; > > In my code I ...

  1. #1

    Default Re: CFCopyLocalizedString problems

    On Fri, 15 Aug 2003, Jonathan Baumgartner wrote:
    > This is driving me nuts. I have an existing project I am trying to
    > localize. I added a Localized.strings file, and localized it for
    > English. In that file I added:
    It should be Localizable.strings
    Also the file will be ignored if it is malformed (missing semicolon, curly
    quotes instead of normal ones).

    Fred
    >
    > /* No comment provided by engineer. */
    > "SnagPathHFS" = "Snag Path HFS";
    >
    > /* No comment provided by engineer. */
    > "SnagPathUnix" = "Snag Path Unix";
    >
    > In my code I try to pull the localized string:
    >
    > CFStringRef theString = CFCopyLocalizedString(CFSTR("SnagPathHFS"),
    > NULL);
    >
    > theString always ends up as "SnagPathHFS" and never "Snag Path HFS."
    >
    > What am I doing wrong?
    >
    > This is being built on 10.2 with the December 2002 Developer Tools.
    >
    > thanks,
    > jon
    >
    Frederick Cheung Guest

  2. #2

    Default Re: CFCopyLocalizedString problems

    In article
    <Pine.LNX.4.44.0308151824330.13932-100000kern.srcf.societies.cam.ac.uk>
    ,
    Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    > It should be Localizable.strings
    Sorry, my mistake. It *is* Localizable.strings. I changed it at one
    point to Localized.strings based on information I saw in a USENET post
    when I was grasping at straws.

    But to sum up, Localizable.strings doesn't work either.
    > Also the file will be ignored if it is malformed (missing semicolon, curly
    > quotes instead of normal ones).
    What I posted before was the entire file. It looks right to me; does it
    look malformed to you?

    thanks,
    jon
    Jonathan Baumgartner Guest

  3. #3

    Default Re: CFCopyLocalizedString problems

    On Fri, 15 Aug 2003, Jonathan Baumgartner wrote:
    > In article
    > <Pine.LNX.4.44.0308151824330.13932-100000kern.srcf.societies.cam.ac.uk>
    > ,
    > Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    >
    > > It should be Localizable.strings
    >
    > Sorry, my mistake. It *is* Localizable.strings. I changed it at one
    > point to Localized.strings based on information I saw in a USENET post
    > when I was grasping at straws.
    >
    > But to sum up, Localizable.strings doesn't work either.
    >
    > > Also the file will be ignored if it is malformed (missing semicolon, curly
    > > quotes instead of normal ones).
    >
    > What I posted before was the entire file. It looks right to me; does it
    > look malformed to you?
    Seems fine to me. Another point to bear in mind is that the file must be
    saved as UTF-16.

    Fred

    Frederick Cheung Guest

  4. #4

    Default Re: CFCopyLocalizedString problems

    In article
    <Pine.LNX.4.44.0308151925130.3074-100000kern.srcf.societies.cam.ac.uk>,
    Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    > Seems fine to me. Another point to bear in mind is that the file must be
    > saved as UTF-16.
    Well, it was UTF-8, but changing it to UTF-16 didn't help. Still won't
    work.

    Ack!

    jon
    Jonathan Baumgartner Guest

  5. #5

    Default Re: CFCopyLocalizedString problems

    On Fri, 15 Aug 2003, Jonathan Baumgartner wrote:
    > In article
    > <Pine.LNX.4.44.0308151925130.3074-100000kern.srcf.societies.cam.ac.uk>,
    > Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    >
    > > Seems fine to me. Another point to bear in mind is that the file must be
    > > saved as UTF-16.
    >
    > Well, it was UTF-8, but changing it to UTF-16 didn't help. Still won't
    > work.
    >
    Things like invisible control characters and stuff will probably throw it
    off. Are you sure the file is in the right place?

    Fred


    Frederick Cheung Guest

  6. #6

    Default Re: CFCopyLocalizedString problems

    "Jonathan Baumgartner" (<jon_baumgartner>) wrote:
    > This is driving me nuts. I have an existing project I am trying to
    > localize. I added a Localized.strings file, and localized it for
    > English. In that file I added:
    >
    > /* No comment provided by engineer. */
    > "SnagPathHFS" = "Snag Path HFS";
    >
    > /* No comment provided by engineer. */
    > "SnagPathUnix" = "Snag Path Unix";
    >
    > In my code I try to pull the localized string:
    >
    > CFStringRef theString = CFCopyLocalizedString(CFSTR("SnagPathHFS"),
    > NULL);
    >
    > theString always ends up as "SnagPathHFS" and never "Snag Path HFS."
    >
    > What am I doing wrong?
    >
    You have to name it 'Localizable.strings' and it must be placed in the
    'English.lproj' folder that's inside the 'Resources' folder of your
    application bundle.

    ----------------
    Sebastian Wegner

    [url]http://www.mcsebi.com/[/url]

    Sebastian Wegner Guest

  7. #7

    Default Re: CFCopyLocalizedString problems

    In article
    <jon_baumgartner-7244C7.16100215082003newstest2.earthlink.net>,
    Jonathan Baumgartner <jon_baumgartner> wrote:
    > In article
    > <Pine.LNX.4.44.0308152000110.15631-100000kern.srcf.societies.cam.ac.uk>
    > ,
    > Frederick Cheung <fglc2srcf.DUH.ucam.org> wrote:
    >
    > > Things like invisible control characters and stuff will probably throw it
    > > off. Are you sure the file is in the right place?
    >
    > Just checked the file with BBEdit. No invisible characters.
    > Is there any way to find out exactly why CFCopyLocalizedString is
    > failing?
    I don't think so (peeking at the console won't hurt) , thanks to the CF
    error reporting design.
    - I used no comments - just "foo"="bar"; - and it worked
    - strip down your Localized.strings to one single line and see if that
    key works.
    - continue to add your strings.
    -
    <[url]http://developer.apple.com/doentation/CoreFoundation/Conceptual/CFBun[/url]
    dles/Tasks/working.html> might
    -
    <[url]http://developer.apple.com/doentation/MacOSX/Conceptual/SystemOvervie[/url]
    w/International/index.html>

    reagrds,
    Tom_E
    Thomas Engelmeier Guest

Similar Threads

  1. 3.1 problems
    By r-rooster in forum Macromedia Contribute General Discussion
    Replies: 0
    Last Post: August 23rd, 07:31 PM
  2. AVI Problems!
    By pulpman webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: October 30th, 02:42 AM
  3. Replies: 0
    Last Post: September 22nd, 02:18 PM
  4. Problems with mac IE
    By Deamon-Slayer webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 1
    Last Post: September 3rd, 11:53 PM
  5. Problems with 5.8
    By Support in forum Sun Solaris
    Replies: 1
    Last Post: July 1st, 09:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139