org.starhope.appius.mb
Class Messages

java.lang.Object
  extended by org.starhope.appius.mb.Messages

public class Messages
extends Object

Author:
brpocock

Field Summary
private static Properties messages
           
 
Constructor Summary
Messages()
           
 
Method Summary
static String account_not_approved()
          The message catalogue
static String agree_ts_and_cs()
           
static String answer_incorrect()
           
static String bad_cc()
           
static String blank_field(String field)
           
static String cc_invalid()
           
static String ccv_invalid()
           
static String code_invalid()
           
static String dob_invalid()
           
static String exp_invalid()
           
static String formatFutureDate(Date targetDate)
          Format a date into a user-friendly visible object relative to "now."
static String[] getSecurityQuestion()
          Get suggested question(s) for the forgotten password recovery system
static String getText(String string, String language, String dialect)
           
private static void initMessages()
          Initialize the configured message catalog.
private static String listToDisplay_English(List<String> words)
          Internal helper method for listToDisplay(List, String, String) for English.
private static String listToDisplay_Español(List<String> words)
          Internal helper method for listToDisplay(List, String, String) for Spanish.
private static String listToDisplay_فرسئ(List<String> words)
          Internal helper method for listToDisplay(List, String, String) for Persian.
static String listToDisplay(List<String> words, String language, String dialect)
           Given a list of strings, combine then into a string for display purposes.
static String listToDisplay(Object[] stuff, String language, String dialect)
          WRITEME: document this method (brpocock, Aug 24, 2009)
static String login_invalid()
           
static String login_length()
           
static String mail_invalid()
           
static String mail_mismatch()
           
static String mail_not_on_file()
          Deprecated. 
static String minPrecisionOneCent()
           
static String not_logged_in()
           
static String onlyVisaOrMC()
           
static String parent_account_already_exists()
          WRITEME: document this method (theys, Aug 26, 2009)
static String password_change()
           
static String password_invalid()
           
static String password_length()
           
static String password_mismatch()
           
static String password_reset()
          The message catalogue
static String password_same()
           
static String payment_already_made()
           
static String prettyDate(Date date)
           
static String retry_payment()
          TODO: document this method (theys, Sep 4, 2009)
static String rulesAgree()
           
static String select_toot_upgrade()
           
static String subscription_invalid()
          TODO: document this method (theys, Sep 4, 2009)
static String unsupported_currency()
          TODO: document this method (theys, Sep 4, 2009)
static String user_does_not_exist()
           
static String username_invalid()
           
static String username_unavail()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

private static Properties messages
Constructor Detail

Messages

public Messages()
Method Detail

account_not_approved

public static final String account_not_approved()
The message catalogue

Returns:

agree_ts_and_cs

public static final String agree_ts_and_cs()
Returns:
"You must agree to the Terms and Conditions to play in Tootsville."

bad_cc

public static final String bad_cc()
Returns:
"Oops! We are having trouble processing your Credit Card. The card is being declined. Please try again with a different Credit Card."

answer_incorrect

public static final String answer_incorrect()
Returns:
"You have answered your question incorrectly. Please try again or contact customer service if you are having trouble"

blank_field

public static final String blank_field(String field)
Parameters:
field -
Returns:
"You have left the required " + field + " field blank. Please try again.";

payment_already_made

public static final String payment_already_made()
Returns:
"A payment has already been made for that subscription for the Toots Account you have selected."

cc_invalid

public static final String cc_invalid()
Returns:
"The credit card number you have entered is invalid. Please try again."

user_does_not_exist

public static final String user_does_not_exist()
Returns:
"The credit card number you have entered is invalid. Please try again."

select_toot_upgrade

public static final String select_toot_upgrade()
Returns:
"Please click your child's Toots account, from the 'My Child's Toots Account(s)' list, and then click 'Make Me A V.I.T.' to upgrade. "

ccv_invalid

public static final String ccv_invalid()
Returns:
"Your password is already set as that!"

code_invalid

public static final String code_invalid()
Returns:
"The peanut code you have entered is either invalid or already used."

dob_invalid

public static final String dob_invalid()

exp_invalid

public static final String exp_invalid()

formatFutureDate

public static String formatFutureDate(Date targetDate)
Format a date into a user-friendly visible object relative to "now."

Parameters:
targetDate - the date (in the future)
Returns:
a user-visible string form

getSecurityQuestion

public static String[] getSecurityQuestion()
Get suggested question(s) for the forgotten password recovery system

Returns:
array of possible security questions.

getText

public static String getText(String string,
                             String language,
                             String dialect)
Parameters:
string - The identifier (dotted hierarchy) of the string to be returned
dialect - The human-language dialect in which the message should be found (always "US" for now.)
language - The ISO language code for the language, in which this message should be found. (always "en" for now.)
Returns:
The translated, locale-specific — haha. I lie. The US English message in user-visible format.

initMessages

private static void initMessages()
Initialize the configured message catalog. Does not currently cope with languages and dialects properly. (TODO: have multiple properties files, for various languages and dialects, and replace the single "messages" attribute with a Map or similar.)


listToDisplay

public static String listToDisplay(List<String> words,
                                   String language,
                                   String dialect)

Given a list of strings, combine then into a string for display purposes.

For English, the list will obey the traditional grammatical usage of commas: List elements are joined with commas, except that the conjunction (in our case, always “and”) occurs penultimate, and two or three element lists do not use commas.

For Spanish, works essentially the same way.

For other languages, we just join the words with commas and omit the conjunction

Parameters:
words - A list of words.
language - The user's display language
dialect - The user's sublanguage dialect
Returns:
The list formatted into a string.

listToDisplay

public static String listToDisplay(Object[] stuff,
                                   String language,
                                   String dialect)
WRITEME: document this method (brpocock, Aug 24, 2009)

Parameters:
stuff -
userEnrolments -
language -
dialect -
Returns:

listToDisplay_English

private static String listToDisplay_English(List<String> words)
Internal helper method for listToDisplay(List, String, String) for English.

Parameters:
words - word list
Returns:
list formatted for display in English

listToDisplay_Español

private static String listToDisplay_Español(List<String> words)
Internal helper method for listToDisplay(List, String, String) for Spanish.

Parameters:
words - word list
Returns:
list formatted for display in Spanish

listToDisplay_فرسئ

private static String listToDisplay_فرسئ(List<String> words)
Internal helper method for listToDisplay(List, String, String) for Persian.

Parameters:
words - word list
Returns:
list formatted for display in Persian

login_invalid

public static final String login_invalid()
Returns:
"Your username or password is incorrect. Please check your typnig and try logging in again."

login_length

public static final String login_length()
Returns:
"The username you choose is too short. Please pick a new one at least " + User.MIN_LOGIN_LENGTH + " characters long."

mail_invalid

public static final String mail_invalid()
Returns:
"The email address you have entered appears to be invalid, please check your typing."

mail_mismatch

public static final String mail_mismatch()
Returns:
"The email addresses you have entered do not match."

mail_not_on_file

@Deprecated
public static final String mail_not_on_file()
Deprecated. 


minPrecisionOneCent

public static String minPrecisionOneCent()
Returns:
"The amount of the payment supplied included fractional values of less than 1¢ (USD $.01). This is not supported. Payment values must be in increments of 1¢."

not_logged_in

public static final String not_logged_in()
Returns:
"You must be logged in to do that."

onlyVisaOrMC

public static String onlyVisaOrMC()
Returns:
"The subscription system only supports VISA or MasterCard, sorry."

parent_account_already_exists

public static final String parent_account_already_exists()
WRITEME: document this method (theys, Aug 26, 2009)

Returns:

password_change

public static final String password_change()
Returns:
"You have successfully changed your password."

password_invalid

public static final String password_invalid()
Returns:
"The password you have entered is incorrect."

password_length

public static final String password_length()
Returns:
"That password is too short, please pick one that is 6 characters long."

password_mismatch

public static final String password_mismatch()
Returns:
"Your password does not match the confirmation, please retype your password in both fields."

password_reset

public static final String password_reset()
The message catalogue

Returns:

password_same

public static final String password_same()
Returns:
"Your password is already set as that!"

prettyDate

public static String prettyDate(Date date)
Parameters:
date -
Returns:

retry_payment

public static final String retry_payment()
TODO: document this method (theys, Sep 4, 2009)

Returns:

rulesAgree

public static final String rulesAgree()
Returns:
"You must agree to the rules to play Tootsville."

subscription_invalid

public static final String subscription_invalid()
TODO: document this method (theys, Sep 4, 2009)

Returns:

unsupported_currency

public static final String unsupported_currency()
TODO: document this method (theys, Sep 4, 2009)

Returns:

username_invalid

public static final String username_invalid()
Returns:
"That username contains invalid characters or is not allowed, please choose another one."

username_unavail

public static final String username_unavail()
Returns:
"That username is not available, please choose another one."