R 0.1.2

R 0.1.2

测试已测试
语言语言 Objective-CObjective C
许可证 MIT
发布最后发布2015 年 9 月

Mrdaios 维护。



R 0.1.2

  • 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.
  • 输入:Localizable.strings
"Cancel"="取消";
"Ok"="确定";
  • shell
"$PODS_ROOT/R/tools/RLocalizable" -o "$SRCROOT/$TARGET_NAME/R/string" -p "$TARGET_NAME" "$SRCROOT/$TARGET_NAME/Localizable.strings"
  • 输出:Localizable.h
@interface Localizable : NSObject

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

@end
  • 输出:Localizable.m
@implementation AppHallLocalizable

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

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

@end

使用方法

要运行示例项目,首先要将仓库克隆下来,然后在 Example 目录下运行 pod install

安装

R 通过 CocoaPods 提供支持。要安装它,只需将以下行添加到 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

作者

mrdaios, [email protected]

灵感来源于以下项目

许可证

R 在 MIT 许可下可用。有关更多信息,请参阅 LICENSE 文件。