1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 14:13:23 +00:00

Put in function for localization (as suggested on the cocoa dev list) and comment it out because i can't get it working as desired yet.

This commit is contained in:
Mitchell Livingston 2008-03-18 19:18:22 +00:00
parent 21124a8de8
commit 128fa0aedf
2 changed files with 33 additions and 3 deletions

View file

@ -60,6 +60,33 @@ void tr_msgInit( void )
messageLock = tr_lockNew( );
}
/*
#if defined(SYS_DARWIN)
const char * tr_getMacLocalizedCString(CFStringRef string)
{
//if you need to be thread safe, add proper locks around that
static CFMutableDictionaryRef mapping = NULL;
if( mapping == NULL )
{
mapping = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, NULL);
}
const char * result = (const char *)CFDictionaryGetValue(mapping, string);
if( result == NULL )
{
CFStringRef localizedString = CFCopyLocalizedStringFromTable(string, CFSTR("LibraryLocalizable"), NULL);
result = (const char *)malloc(CFStringGetMaximumSizeForEncoding(CFStringGetLength(localizedString), kCFStringEncodingUTF8));
CFStringGetCString(localizedString, (char *)result, CFStringGetLength(localizedString)+1, kCFStringEncodingUTF8);
CFDictionarySetValue(mapping, string, result);
}
return result;
}
#endif
*/
FILE*
tr_getLog( void )
{

View file

@ -34,9 +34,12 @@ void tr_msgInit( void );
#if !defined(_)
#if defined(SYS_DARWIN)
#include <CoreFoundation/CFBundle.h>
#define _(a) CFStringGetCStringPtr(CFCopyLocalizedStringFromTable( \
CFSTR( a ), CFSTR("LibraryLocalizable"), "comment" ), kCFStringEncodingMacRoman)
/*#include <CoreFoundation/CFBundle.h>
const char * tr_getMacLocalizedCString(CFStringRef string);
#define _(a) tr_getMacLocalizedCString(CFSTR(a))*/
#define _(a) (a)
#else
#include <libintl.h>
#define _(a) gettext (a)