#NEWLINE# def create_default_app_strings( self , app ) : #NEWLINE# #INDENT# messages = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for lc in reversed ( app . langs ) : #NEWLINE# #INDENT# if ( lc == 'default' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# new_messages = commcare_translations . loads ( self . create_app_strings ( app , lc , for_default = True ) ) #NEWLINE# for ( key , val ) in new_messages . items ( ) : #NEWLINE# #INDENT# if ( not ( ( val == '' ) and ( key in messages ) ) ) : #NEWLINE# #INDENT# messages [ key ] = val #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( 'case_sharing.exactly_one_group' not in messages ) : #NEWLINE# #INDENT# messages [ 'case_sharing.exactly_one_group' ] = 'The case sharing settings for your user are incorrect. This user must be in exactly one case sharing group. Please contact your supervisor.' #NEWLINE# #UNINDENT# if ( 'case_autoload.fixture.exactly_one_fixture' not in messages ) : #NEWLINE# #INDENT# messages [ 'case_autoload.fixture.exactly_one_fixture' ] = 'The lookup table settings for your user are incorrect. This user must have access to exactly one lookup table row for the table: ${0}' #NEWLINE# #UNINDENT# from corehq.apps.app_manager.models import AUTO_SELECT_CASE , AUTO_SELECT_FIXTURE , AUTO_SELECT_USER , AUTO_SELECT_LOCATION , AUTO_SELECT_USERCASE , AUTO_SELECT_RAW #NEWLINE# mode_text = { #NEWLINE# #INDENT# AUTO_SELECT_FIXTURE : 'lookup table field' , #NEWLINE# AUTO_SELECT_USER : 'user data key' , #NEWLINE# AUTO_SELECT_CASE : 'case index' , #NEWLINE# AUTO_SELECT_USERCASE : 'user case' , #NEWLINE# AUTO_SELECT_RAW : 'custom xpath expression' , #NEWLINE# #UNINDENT# } #NEWLINE# for ( mode , text ) in mode_text . items ( ) : #NEWLINE# #INDENT# key = 'case_autoload.{0}.property_missing' . format ( mode ) #NEWLINE# if ( key not in messages ) : #NEWLINE# #INDENT# messages [ key ] = 'The {} specified for case auto-selecting could not be found: ${{0}}' . format ( text ) #NEWLINE# #UNINDENT# key = 'case_autoload.{0}.case_missing' . format ( mode ) #NEWLINE# if ( key not in messages ) : #NEWLINE# #INDENT# messages [ key ] = 'Unable to find case referenced by auto-select case ID.' #NEWLINE# #UNINDENT# #UNINDENT# key = 'case_autoload.{0}.property_missing' . format ( AUTO_SELECT_LOCATION ) #NEWLINE# messages [ key ] = "This form requires access to the user's location, but none was found." #NEWLINE# key = 'case_autoload.{0}.case_missing' . format ( AUTO_SELECT_LOCATION ) #NEWLINE# messages [ key ] = "This form requires the user's location to be marked as 'Tracks Stock'." #NEWLINE# return commcare_translations . dumps ( messages ) . encode ( 'utf-8' )