diff --git a/intl/strres/tests/strres-test.html b/intl/strres/tests/strres-test.html index 5eb91f99686b..a3782e50b633 100644 --- a/intl/strres/tests/strres-test.html +++ b/intl/strres/tests/strres-test.html @@ -55,20 +55,45 @@ function write() /* dump("\n--** strBundleService.StrVal = " + strBundleService.StrVal + " **--\n"); */ - var strbundle = new Object(); - strBundleService.CreateBundle("resource:/res/strres.properties", - null, - strbundle); + var strbundle = strBundleService.CreateBundle("resource:/res/strres.properties", + null); if (strbundle) { - dump("\n--** strbundle createInstance succeeded **--\n"); - var ostr; - strbundle.GetStringFromID(123, ostr); - dump("\n--** strbundle GetStringFromID 123=" + ostr + " **--\n"); + dump("\n--** JS strbundle createInstance succeeded **--\n"); + var ostr1 = strbundle.GetStringFromName("file"); + dump("\n--** strbundle GetStringFromName file=" + ostr1 + " **--\n"); + var ostr2 = strbundle.GetStringFromID(123); + dump("\n--** strbundle GetStringFromID 123=" + ostr2 + " **--\n"); + var field = document.getElementById('writeBtn'); + field.value = ostr2; + dump("\n--** writeBtn GetStringFromID 123=" + ostr2 + " **--\n"); + } else { dump("\n--** strbundle createInstance failed **--\n"); } + + var strXPCbundle = strBundleService.CreateXPCBundle("resource:/res/strres.properties", + "en-US"); + + if (strXPCbundle) { + dump("\n--** JS strXPCbundle createInstance succeeded **--\n"); + var ostr1 = strXPCbundle.GetStringFromName("back"); + dump("\n--** strXPCbundle GetStringFromName back=" + ostr1 + " **--\n"); + var field1 = document.getElementById('getBtn'); + field1.value = ostr1; + dump("\n--** getBtn GetStringFromName back=" + ostr1 + " **--\n"); + var ostr2 = strXPCbundle.GetStringFromID(123); + dump("\n--** strXPCbundle GetStringFromID 123=" + ostr2 + " **--\n"); + var field = document.getElementById('writeBtn'); + field.value = ostr2; + dump("\n--** writeBtn GetStringFromID 123=" + ostr2 + " **--\n"); + + } + else { + dump("\n--** strXPCbundle createInstance failed **--\n"); + } + } else { dump("\n--** strBundleService createInstance 2 **--\n"); @@ -83,11 +108,11 @@ function write()
- + - + diff --git a/intl/strres/tests/strres.properties b/intl/strres/tests/strres.properties index 011226d4d746..2d3339d5048a 100644 --- a/intl/strres/tests/strres.properties +++ b/intl/strres/tests/strres.properties @@ -14,6 +14,7 @@ # Reserved. # file=File +back=戻る edit=Edit view=View go=Go