Commit 1525055a by Jeong Gilmo

#33006 事業者毎のリソース多重化(Android)

parent 2cac1130
......@@ -15,4 +15,15 @@ public class AndroidStringUtil {
public static String format(Context context, int id, String... args) {
return String.format(context.getResources().getString(id), (Object[]) args);
}
// #33006 start
// メッセージのパターン化する
public static int pattern(Context context, String key, int pattern) {
if (pattern > 0) {
return context.getResources().getIdentifier(String.format(key + "_%d", pattern), "string", context.getPackageName());
} else {
return context.getResources().getIdentifier(key, "string", context.getPackageName());
}
}
// #33006 end
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment