[jsword-devel] Language.equals("zh") no longer works

Martin Denham mjdenham at gmail.com
Sat Jan 22 15:43:43 MST 2011


I have a check for Chinese documents in And Bible that used to work with
JSword code from about the beginning of last December but has now stopped
working  Here is my code:

     // Chinese search is not currently supported
     if (book.getLanguage().equals("zh")) {
     showErrorMsg(R.string.search_chinese_na);
     return null;
     }

The comparison used to work but now it does not return true for Chinese
documents.  On investigation I think it possibly happened during Java 5
conversion and that now Language.equals() expects to be compared with
another Language object and so the following change seems to work:


    private static Language CHINESE = new Language("zh");

     if (book.getLanguage().equals(CHINESE)) {
     showErrorMsg(R.string.search_chinese_na);
     return null;
     }

Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20110122/cb64535d/attachment.html>


More information about the jsword-devel mailing list