View openlaszlo i18n コメント規約
Coding Rule for OpenLaszlo i18n
Abstract:
システムメッセージを国際化するためのコメント文フォーマットを規定します。
このコメント文をもとに、convertorプログラムがLaszloMessagesクラスメソッドに
変換します。
1.国際化させたいメッセージストリングの
前後に以下のようなコメント行を追加する。
//@conv-i18n.begin
//@conv-i18n.end
コメント例:
修正前;
public class LZDummy {
....
public static int getKrankPort () {
String portStr = LPS.getProperties().getProperty(KRANK_PORT_PROPERTY);
int portnum = DEFAULT_KRANK_PORT;
if (portStr == null) {
return portnum;
}
try {
portnum = Integer.parseInt(portStr);
} catch (NumberFormatException e) {
-> throw new RuntimeException("Server configuration error: can't parse lps.properties entry '"+ KRANK_PORT_PROPERTY +"'");
}
return portnum;
}
}
修正後:
public class LZDummy {
....
public static int getKrankPort () {
String portStr = LPS.getProperties().getProperty(KRANK_PORT_PROPERTY);
int portnum = DEFAULT_KRANK_PORT;
if (portStr == null) {
return portnum;
}
try {
portnum = Integer.parseInt(portStr);
} catch (NumberFormatException e) {
throw new RuntimeException(
-> //@conv-i18n.begin
"Server configuration error: can't parse lps.properties entry '"+ KRANK_PORT_PROPERTY +"'"
-> //@conv-i18n.end
);
}
return portnum;
}
}
注意)国際化したいストリングがあるメソッドの引数になっている場合は、
かならずその引数(文字列と"+"及び変数を含む)の前後に、規定のコメント行を挿入してください。
以上
| |