2012-11-24 18:22:44 +00:00
module ValidationMessages
2012-12-22 00:56:16 +00:00
# Note that these are not set up to be internationalizable
2012-11-24 18:22:44 +00:00
2012-11-25 19:37:54 +00:00
# general messages
2012-11-24 18:22:44 +00:00
PERMISSION_VALIDATION_ERROR = " You do not have permissions to perform this action. "
2012-11-28 05:26:53 +00:00
USER_NOT_MUSICIAN_VALIDATION_ERROR = " You must be a Musician to perform this action. "
USER_NOT_BAND_MEMBER_VALIDATION_ERROR = " You must be a band member to perform this action. "
2012-11-24 18:22:44 +00:00
2012-11-25 19:37:54 +00:00
# band invitations
BAND_INVITATION_NOT_FOUND = " Band invitation not found. "
2012-11-24 18:22:44 +00:00
# recordings
2012-11-25 19:37:54 +00:00
RECORDING_NOT_FOUND = " Recording not found. "
2012-11-24 18:22:44 +00:00
2012-12-15 07:11:04 +00:00
# tracks
TRACK_NOT_FOUND = " Track not found. "
2012-12-16 23:24:14 +00:00
# sessions
SESSION_NOT_FOUND = " Session not found. "
2015-11-13 13:12:58 +00:00
NOT_FOUND = 'not found'
2012-11-24 18:22:44 +00:00
# genres
2014-02-19 22:56:13 +00:00
RECORDING_GENRE_LIMIT_EXCEEDED = " No more than 1 genre is allowed. "
BAND_GENRE_LIMIT_EXCEEDED = " No more than 3 genres are allowed. "
SESSION_GENRE_LIMIT_EXCEEDED = " No more than 3 genres are allowed. "
RECORDING_GENRE_MINIMUM_NOT_MET = " At least 1 genre is required. "
BAND_GENRE_MINIMUM_NOT_MET = " At least 1 genre is required. "
SESSION_GENRE_MINIMUM_NOT_MET = " At least 1 genre is required. "
2012-11-24 18:22:44 +00:00
# instruments
INSTRUMENT_LIMIT_EXCEEDED = " No more than 5 instruments are allowed. "
2012-11-25 19:37:54 +00:00
INSTRUMENT_MINIMUM_NOT_MET = " At least 1 instrument is required. "
2012-11-24 18:22:44 +00:00
2012-12-13 17:15:47 +00:00
# user
OLD_PASSWORD_DOESNT_MATCH = " Your old password is incorrect. "
2012-12-22 00:56:16 +00:00
EMAIL_NOT_FOUND = " Email address not found. "
2013-05-13 03:27:12 +00:00
NOT_YOUR_PASSWORD = " is not your current password "
2013-07-10 20:18:25 +00:00
EMAIL_ALREADY_TAKEN = " has already been taken "
2013-05-13 03:27:12 +00:00
EMAIL_MATCHES_CURRENT = " is same as your current email "
2013-05-31 01:59:37 +00:00
INVALID_FPFILE = " is not valid "
2016-01-26 02:25:30 +00:00
VERIFY_EMAIL = " You need to verify your email. "
2013-11-03 20:55:55 +00:00
2020-05-12 01:45:32 +00:00
CHINESE_CANT_BE_MIXED = " must be all Chinese or Japanese "
CHINESE_NAME_TOO_LONG = " must be 4 characters or less when Chinese or Japanese "
NO_SPECIAL_CHARACTERS = " must not have special characters "
INVALID_NAME = " not valid "
2014-11-04 20:55:12 +00:00
# recurly
RECURLY_ERROR = " Error occurred during Recurly transaction. "
RECURLY_ACCOUNT_ERROR = " You don't have Recurly account yet. "
RECURLY_PARAMETER_ERROR = " You didn't input correct information for Recurly transaction. "
2013-11-03 20:55:55 +00:00
#connection
2014-05-16 19:39:37 +00:00
USER_OR_LATENCY_TESTER_PRESENT = " user or latency_tester must be present "
2014-03-06 17:56:15 +00:00
SELECT_AT_LEAST_ONE = " Please select at least one track " # DO NOT CHANGE THIS TEXT MESSAGE UNLESS YOU CHANGE createSession.js.erb, which is looking for it
2013-11-03 20:55:55 +00:00
FAN_CAN_NOT_JOIN_AS_MUSICIAN = " A fan can not join a music session as a musician "
MUSIC_SESSION_MUST_BE_SPECIFIED = " A music session must be specified "
2018-07-29 17:39:40 +00:00
INVITE_REQUIRED = " You must be invited to join this session "
2013-11-03 20:55:55 +00:00
FANS_CAN_NOT_JOIN = " Fans can not join this session "
CANT_JOIN_RECORDING_SESSION = " is currently recording "
2014-02-24 01:46:38 +00:00
CANT_JOIN_MULTIPLE_SESSIONS = 'You cannot join more than one music session'
2020-10-14 02:05:08 +00:00
CANT_JOIN_SCHOOL_SESSION = " You can not join school sessions "
CAN_ONLY_JOIN_SAME_SCHOOL_SESSION = " You can only join sessions from your school "
2020-10-17 17:30:42 +00:00
LICENSE_EXPIRED = " Your license has expired "
LICENSE_NOT_STARTED = " Your license has not started "
2020-11-21 22:14:37 +00:00
PLAN_PROHIBIT_MAX_PLAYERS = " The session size is greater than your plan allows "
2020-10-14 02:05:08 +00:00
# chat
CAN_ONLY_CHAT_SAME_SCHOOL = " You can only message others from your school "
DISABLED_GLOBAL_SCHOOL_CHAT = " Global chat disabled for schools "
# permissions
CAN_ONLY_VIEW_SAME_SCHOOL = " You can only view other users from your school "
2013-11-03 20:55:55 +00:00
# recordings
ALREADY_BEING_RECORDED = " already being recorded "
2014-01-05 03:47:23 +00:00
ALREADY_PLAYBACK_RECORDING = " already playing a recording "
2013-11-03 20:55:55 +00:00
NO_LONGER_RECORDING = " no longer recording "
NOT_IN_SESSION = " not in session "
2014-01-06 20:35:35 +00:00
PREVIOUS_RECORDING_STILL_BEING_FINALIZED = " still has previous recording being finalized "
2013-12-17 19:44:21 +00:00
# recorded tracks
ALREADY_UPLOADED = " already set "
INVALID_PART_NUMBER_SPECIFIED = " is unexpected value "
PART_NOT_FOUND_IN_AWS = " not found in AWS "
FILE_OFFSET_EXCEEDS_LENGTH = " exceeds upload file length "
LENGTH_NOT_SPECIFIED = " not specified "
BAD_UPLOAD = " incorrectly uploaded "
PART_NOT_STARTED = " not started "
UPLOAD_FAILURES_EXCEEDED = " exceeded "
2014-02-13 16:41:50 +00:00
ONLY_ONE_MIX = " can not be multiple "
# claimed recordings
NOT_PART_OF_RECORDING = " not a part of this recording "
2013-12-17 19:44:21 +00:00
2014-01-05 03:47:23 +00:00
# music sessions
MUST_BE_A_MUSICIAN = " must be a musician "
CLAIMED_RECORDING_ALREADY_IN_PROGRESS = " already started by someone else "
2014-07-11 22:21:55 +00:00
MUST_BE_KNOWN_TIMEZONE = " not valid "
2015-01-07 23:44:56 +00:00
JAM_TRACK_ALREADY_OPEN = 'another jam track already open'
RECORDING_ALREADY_IN_PROGRESS = " recording being made "
2015-01-11 20:15:47 +00:00
METRONOME_ALREADY_OPEN = 'another metronome already open'
BACKING_TRACK_ALREADY_OPEN = 'another audio file already open'
2014-01-05 03:47:23 +00:00
2014-03-20 11:53:26 +00:00
# notification
DIFFERENT_SOURCE_TARGET = 'can\'t be same as the sender'
2013-12-17 19:44:21 +00:00
2014-11-11 22:21:46 +00:00
# mods
2014-11-15 02:47:56 +00:00
MODS_MUST_BE_HASH = 'must be a hash'
2014-11-11 22:21:46 +00:00
MODS_UNKNOWN_KEY = 'unknown mod'
2013-12-17 19:44:21 +00:00
# takes either a string/string hash, or a string/array-of-strings|symbols hash,
# and creates a ActiveRecord.errors style object
def createValidationStyleObject ( validation_errors )
validate = { }
errors = { }
validate [ :errors ] = errors
validation_errors . each do | key , value |
if value . class == Array
errors [ key ] = value
elsif value . class == String || value . class == Symbol
errors [ key ] = [ value . to_s ]
else
raise Exception . new ( " must be array or string " )
end
end
return validate
end
2012-12-22 00:56:16 +00:00
end