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.
"Cancel"="取消";
"Ok"="确定";
"$PODS_ROOT/R/tools/RLocalizable" -o "$SRCROOT/$TARGET_NAME/R/string" -p "$TARGET_NAME" "$SRCROOT/$TARGET_NAME/Localizable.strings"
@interface Localizable : NSObject
- (NSString *)cancel;
- (NSString *)ok;
@end
@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 文件。