R 0.1.2

R 0.1.2

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Sep 2015

Maintained by Mrdaios.



R 0.1.2

  • By
  • mrdaios

RLocalizable

Usage: RLocalizable [-o <path>] [-f <path>] [-p <prefix>] [<paths>]
Options:
    -o <path>   Output files at <path>
    -f <path>   Search for *.strings folders starting from <path>
    -p <prefix> Use <prefix> as the class prefix in the generated code
    -h          Print this help and exit
    <paths>     Input files; this and/or -f are required.
  • Input: Localizable.strings:
"Cancel"="取消";
"Ok"="确定";
  • shell
"$PODS_ROOT/R/tools/RLocalizable" -o "$SRCROOT/$TARGET_NAME/R/string" -p "$TARGET_NAME" "$SRCROOT/$TARGET_NAME/Localizable.strings"
  • Output: Localizable.h
@interface Localizable : NSObject

- (NSString *)cancel;
- (NSString *)ok;

@end
  • Output: Localizable.m
@implementation AppHallLocalizable

- (NSString *)cancel;
{
    return NSLocalizedString(@"Cancel","取消");
}

- (NSString *)ok;
{
    return NSLocalizedString(@"Ok","确定");
}

@end

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

R is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "R"

#configure R default Build Phases
post_install do |rInstaller|
    require File.expand_path('RConfigurator.rb', './Pods/R/tools/')
    RConfigurator::post_install(rInstaller)
end

Author

mrdaios, [email protected]

Inspired by these projects:

License

R is available under the MIT license. See the LICENSE file for more info.