mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-01-14 08:57:53 -05:00
31 lines
643 B
Objective-C
31 lines
643 B
Objective-C
//
|
|
// localizable.m
|
|
//
|
|
//
|
|
// Created by Tue Topholm on 13/02/11.
|
|
// Copyright 2011 Sugee. All rights reserved.
|
|
//
|
|
|
|
#import "localizable.h"
|
|
|
|
|
|
@implementation localizable
|
|
- (void)get:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
|
|
{
|
|
NSUInteger argc = [arguments count];
|
|
NSString* jsString;
|
|
if(argc == 2)
|
|
{
|
|
NSString *key = [arguments objectAtIndex:0];
|
|
NSString *successCallback = [arguments objectAtIndex:1];
|
|
|
|
NSString *returnVar = NSLocalizedString(key, nil);
|
|
|
|
jsString = [NSString stringWithFormat:@"%@(\"%@\");",successCallback,returnVar];
|
|
|
|
[self writeJavascript:jsString]; //Write back to JS
|
|
}
|
|
|
|
}
|
|
@end
|