[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Localization of special directories
From: |
Riccardo Mottola |
Subject: |
Localization of special directories |
Date: |
Wed, 13 Mar 2013 10:09:15 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16.1 |
Hi,
I'd like to Localize the "special" directories handled by NSWorkspace,
specifically to return the appropriate custom icon.
That is, if the Directory has a localized name, it should get the proper
icon anyway!
When I implemented this in NSWorkspace (not in GWorkspace, thus it is
available to all applications) I had two class of Directories.
"Images" and "Music" are simple. For example:
[folderPathIconDict setObject: @"MusicFolder"
forKey: [NSHomeDirectory () stringByAppendingPathComponent: @"Music"]];
just Localizing "Music" should do the trick, thus I would have a
localizable string for NSWorkspace.
For other directories, like the Desktop or the Document, I use NS constants:
Dir = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory,
NSUserDomainMask, YES);
I wonder, also with mac compatibility, if I NSDesktopDirectory should
return already the localized string (I guess yes, but how?) or if I
should use that constant to localize it. It would make less sense though.
Riccardo