编辑:我完全重写了这个问题,因为在我的前两个版本中我似乎不够清楚.感谢您的建议到目前为止.
我想国际化教程项目的源代码(请注意,而不是运行时应用程序).这是一个例子(在Java中):
/** A comment */
public String doSomething() {
System.out.println("Something was done successfully");
}
Run Code Online (Sandbox Code Playgroud)
用英语,然后将法语版本改为:
/** Un commentaire */
public String faitQuelqueChose() {
System.out.println("Quelque chose a été fait avec succès.");
}
Run Code Online (Sandbox Code Playgroud)
等等.然后在某处使用常规工具编辑这些翻译的属性文件,例如:
com.foo.class.comment1=A comment
com.foo.class.method1=doSomething
com.foo.class.string1=Something was done successfully
Run Code Online (Sandbox Code Playgroud)
和其他语言:
com.foo.class.comment1=Un commentaire
com.foo.class.method1=faitQuelqueChose
com.foo.class.string1=Quelque chose a été fait avec succès.
Run Code Online (Sandbox Code Playgroud)
我试图找到最简单,最有效和不显眼的方法,用最少量的手动咕噜声工作(除了明显翻译实际文本).最好在Eclipse下工作.例如,原始代码将用英语编写,然后外部化(属性,最好保持原始源不变),翻译(人工)然后重新生成(作为单独的源文件/项目).
我找到的一些路径(除了AlexS建议的):
我很惊讶没有一个工具可以做到这一点.
使用此代码:
var m = moment('150218 10:20:00', 'YYMMDD HH:MM:SS');
m.isValid();
Run Code Online (Sandbox Code Playgroud)
回报false.进一步:
m.toDate();
Run Code Online (Sandbox Code Playgroud)
返回一个Date对象Thu Aug 18 2016 10:00:00 GMT-0400 (EDT),该对象确认解析日期似乎在某些东西上窒息.
为什么?我在最近的Chrome浏览器和Firefox浏览器中尝试了这两种方法,并在最新的时刻(2.9.0)尝试了.传递的字符串似乎没问题,我用文档加倍检查.那么我错过了什么呢?