@@ -408,14 +408,24 @@ public void onDismiss(DialogInterface dialog) {
408408 }
409409
410410 private void showScanMessage (Product product ) {
411+ Project project = SnabbleUI .getProject ();
411412 Resources res = getResources ();
412413
413414 String identifier = product .getScanMessage ();
414415 if (identifier != null ) {
415- identifier = identifier .replace ("-" , "_" );
416- int id = res .getIdentifier (identifier , "string" , getContext ().getPackageName ());
417- if (id != 0 ) {
418- String str = res .getString (id );
416+ // replace occurences of "-" in scan message, as android resource identifiers are not
417+ // supporting "-" in identifiers
418+ String idWithoutProjectId = identifier .replace ("-" , "." );
419+ String idWithProjectId = project .getId ().replace ("-" , "." ) + "." + idWithoutProjectId ;
420+
421+ int resId = res .getIdentifier (idWithProjectId , "string" , getContext ().getPackageName ());
422+
423+ if (resId == 0 ) {
424+ resId = res .getIdentifier (idWithoutProjectId , "string" , getContext ().getPackageName ());
425+ }
426+
427+ if (resId != 0 ) {
428+ String str = res .getString (resId );
419429 showInfo (str );
420430 }
421431 }
@@ -516,7 +526,10 @@ public void onItemAdded(ShoppingCart list, ShoppingCart.Item item) {
516526 if (list .getAddCount () == 1 ) {
517527 showHints ();
518528 }
529+ }
519530
531+ @ Override
532+ public void onQuantityChanged (ShoppingCart list , ShoppingCart .Item item ) {
520533 showScanMessage (item .getProduct ());
521534 }
522535
0 commit comments