Skip to content

Resource Bundle Property Naming Conventions

This is a list of Commerce conventions for the naming of resource keys within the project resource bundles.

Common Resources

The following are conventions used in the common_<locale>.properties file for resource keys that are used globally within the app.

Action labels

action.<action_id>.label * <action_id> is a string resource key identifying the action * This can be used for buttons and/or menu items * Example: action.ok.label=Ok

Title text

title.<id> * <id> is a string resource key identifying the title * Example: title.error=Error

Prompt text

prompt.<id> * <id> is a string resource key identifying the prompt text * Example: prompt.enterValue=Enter a value

Message text

message.<id> * <id> is a string resource key identifying the message * Example: message.pleaseWait=Please wait...

String value

string.<id> * <id> is a key that uniquely identifies the string within the bundle * This might be used in cases where a parameterized message needs a localized value substituted into it * Example: string.cash=Cash

Functional Area Resources

The following is a list conventions for the naming of resource keys that are used within resource bundles that are associated with a functional within the application. E.g., for returns or tendering.

For all items below: * <screen_id> is a string resource key of your choosing which uniquely identifies your screen or dialog within the property file

Screen Title text

screen.<screen_id>.title * Example: screen.taxDiscountPercent.title=Percentage Discount Available

Screen Prompt text

screen.<screen_id>.prompt * Some screen types support multiple line prompts by delimiting lines within the message using a newline \n character. * Example: screen.enterAmount.prompt=Enter an amount

Screen Message text

screen.<screen_id>.message * Example: screen.changeDueCash.message=Change Due: {0}

Screen Instructions

screen.<screen_id>.instructions * Example: screen.changeDueCash.instructions=Change Due: {0}

Screen Action labels

screen.<screen_id>.action.<action_id>.label * <action_id> is a string resource key of your choosing which matches the action name on the screen * This can be used for buttons and/or menu items * Example: screen.sellItems.action.checkout.label=Checkout

Screen Field labels

screen.<screen_id>.field.<field_id>.label * <field_id> is a string resource key of your choosing which matches the field id on the screen * Example: screen.customerInfo.field.firstName.label=First Name

Screen Field placeholders

screen.<screen_id>.field.<field_id>.placeholder * <field_id> is a string resource key of your choosing which matches the field id on the screen * Example: screen.customerInfo.field.firstName.placeholder=Enter a First Name

String value

string.<id> * <id> is a key that uniquely identifies the string within the bundle * This might be used in cases where a parameterized message needs a localized value substituted into it * Example: string.cash=Cash