Changeset 1496

Show
Ignore:
Timestamp:
11/30/08 02:27:49 (5 weeks ago)
Author:
bderenzi
Message:

Now checks to make sure that all locales have a translation for any given itext item.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/dev/javarosa/org.javarosa.xform/src/org/javarosa/xform/parse/XFormParser.java

    r1491 r1496  
    547547        private static boolean hasITextMapping (FormDef form, String textID) { 
    548548                Localizer l = form.getLocalizer(); 
    549                 return l.hasMapping(l.getDefaultLocale(), textID); 
     549                 
     550                // 30.Nov BWD - Fixing bug.  Previously it only checked for the default locale 
     551                // that's not good enough since everything that calls this method expects it to 
     552                // ensure there is a translation for all locales. 
     553                String locales[] = l.getAvailableLocales(); 
     554                boolean answer = true; 
     555                for( int i=0; i<locales.length; i++ ) 
     556                        answer = l.hasMapping(locales[i], textID) && answer; 
     557                return answer; 
    550558        } 
    551559