1. Java Rosa
  2. javarosa
  3. Issues
Issue #63 new

Core crashes on language change

Yaw Anokwa
created an issue

Originally filed at http://code.google.com/p/opendatakit/issues/detail?id=562

E/AndroidRuntime( 3767): FATAL EXCEPTION: main E/AndroidRuntime( 3767): org.javarosa.core.util.NoLocalizedTextException: Error loading locale english. There were 17 keys which were contained in this locale, but were not properly registered in the default Locale. Any keys which are added to a locale should always be added to the default locale to ensure appropriate functioning. E/AndroidRuntime( 3767): The missing translations were for the keys: /inj_test1/injections/1:label,/inj_test1/inj1why/1:label,/inj_test1/injections/9:label,/inj_test1/inj1why/5:label,/inj_test1/inj1why/3:label,/inj_test1/injno:label,/inj_test1/inj1why/7:label,/inj_test1/inj1why/0:label,/inj_test1/injections/0:label,/inj_test1/inj1why/4:label,/inj_test1/injwhyoth:label,/inj_test1/inj1why/2:label,/inj_test1/inj1why:label,/inj_test1/injections:label,/inj_test1/inj1why/9:label,/inj_test1/inj1why/6:label,/inj_test1/inj1why/8:label, E/AndroidRuntime( 3767): at org.javarosa.core.services.locale.Localizer.getLocaleData(Localizer.java:343) E/AndroidRuntime( 3767): at org.javarosa.core.services.locale.Localizer.loadCurrentLocaleResources(Localizer.java:245) E/AndroidRuntime( 3767): at org.javarosa.core.services.locale.Localizer.setLocale(Localizer.java:191) E/AndroidRuntime( 3767): at org.javarosa.form.api.FormEntryModel.setLanguage(FormEntryModel.java:261) E/AndroidRuntime( 3767): at org.javarosa.form.api.FormEntryController.setLanguage(FormEntryController.java:284) E/AndroidRuntime( 3767): at org.odk.collect.android.logic.FormController.setLanguage(FormController.java:398) E/AndroidRuntime( 3767): at org.odk.collect.android.activities.FormEntryActivity$9.onClick(FormEntryActivity.java:1328)

"The problem is that in one language you have defined only an image, and in the other language you have defined only text. you need to define everything in both languages else you get the error you're seeing. IMHO, I think as long as the text id is defined and at least one of the elements (text, image, etc..) then it shouldn't complain." -- Carl

"If the language without images is not the default, then adding strings to the language with only images stops crashes, but you see all the images in the language without images and the language with only images has a bunch of whitespace where the strings were added. If the language without images is the default then the crashes still happen. Adding empty images to the language without images should stop the crash and stop the images from the other language from showing up. However, it would require an empty image we can reference. Also, there is still the issue of whitespace from the added text and images making the layout look odd. Until there is a fix for this in jr making a separate form for each language might be the best option." -- Nathan

Comments (0)

  1. Log in to comment