Translation

From Complete Cyclos documentation wiki
Revision as of 18:22, 24 November 2011 by Fabio (talk | contribs) (General operation keys)
Jump to: navigation, search

Introduction

The controller can be configured to work with multiple instances of cyclos, and each of them with a different language, text and message customization. To support these customizations a set of internationalization files exist.

Currently the versions of the SMS module include the texts necessary to operate in English and Spanish (the possibility to generate new internationalized languages is given).

The controller can generate response messages at the moment of interpreting a received SMS or when an error in the execution of a command occurs.

Internationalization files

The internationalization files can be found in the /WEB-INF/classes/i18n folder, following a naming convention:

<type>_<language>_<country>_<variant>.properties

The type is determined by the semantics of their content, which could be errors or cyclosInstance. The elements language, properties and variant are obtained from each cyclos instance configuration (see Cyclos instance). This way a cyclos instance with the following configuration:

<cyclosInstance name="c3u" language="es" country="UY" variant="C3">

entails that all messages which will be processed in that instance can generate messages with corresponding texts in the files /WEB-INF/classes/errors_es_UY_C3.properties or /WEB-INF/classes/cyclosInstance_es_UY_C3.properties. Response messages without customization in any of the files mentioned will take their text in the immediately preceding layer of the hierarchy. For example, in the case of a message key error.INVALID_AMOUNT_PARAMETER.401, generated for a received SMS message in the cyclos instance of the example above (cyclosInstance_es_UY_C3.properties), the text resolving sequence is as follows (the order is relevant)

  • 1. /WEB-INF/classes/errors_es_UY_C3.properties
  • 2. /WEB-INF/classes/errors_es_UY.properties
  • 3. /WEB-INF/classes/errors_es.properties
  • 4. /WEB-INF/classes/errors.properties

For more details about registered keys in the cyclosInstance.properties files see Operation specific key.

Error translation keys

Error keys are defined in the file errors.properties in the directory /WebContent/WEB-INF/classes/i18n/
If during message processing an error occurs and answering to the user is possible, an error message will be issued. Error messages consist of an error code and a description. In general the code identifies the command which produced the error. For reference consider the following table:

Operation Code range
Account detail operation 100-199
Security confirmation operation 200-299
Payment request operation 300-399
Direct Payment Operation 400-499
Register new user operation 500-599
Help operation 600-699


The keys defined in the internationalized error code files follow the following format:

error.<ERROR_TYPE>.<codeNumber>

There is a relationship between codeNumber and the operation which generates the latter. For example, an error of type INVALID_AMOUNT_PARAMETER generated during the processing of a Direct payment command, generates a response message stored in the error.INVALID_AMOUNT_PARAMETER.401 key (codeNumber 401 identifies the Direct payment command)

The significance of each ERROR_TYPE and the texts which can be used to substitute them are listed in the following table.


Error Descriptions

Error type Description substitutions Codes Sample
CAN_NOT_REGISTER Undefined error during member registration -
  • 501 - Register new user
error.CAN_NOT_REGISTER.501=Register member failed.
INVALID_AMOUNT_PARAMETER Error in the amount parameter
  • {0} - Value received for the amount parameter
  • 301 - Payment request
  • 401 - Direct payment
error.INVALID_AMOUNT_PARAMETER.301=Invalid amount [{0}], cannot process the payment request command.
INVALID_CURRENCY_PARAMETER Error in the currency parameter
  • {0} - Value received for the parameter
  • 103 - Account details
  • 303 - Payment request
  • 403 - Direct payment
error.INVALID_CURRENCY_PARAMETER.103=Invalid currency [{0}], cannot process account details command.
INVALID_GROUP_PARAMETER Error in the Group parameter.
  • {0} - Value received for the Group parameter
  • 502 - Regiter new user
error.INVALID_GROUP_PARAMETER.503=Invalid group [{0}], cannot process the register
INVALID_PAGE_PARAMETER Error in the page parameter
  • {0} - Value received for the page parameter
  • 102 - Account details
error.INVALID_PAGE_PARAMETER.102=Invalid page [{0}], could not execute the account detail command.
INVALID_PARAMETERS_COUNT Invalid amount of parameters (less than required amount or greater than required amount including all optional ones) -
  • 101 - Account details
  • 204 - Security confirmation
  • 311 - Payment request
  • 412 - Direct payment
  • 502 - Register new user
error.INVALID_PARAMETERS_COUNT.101=Invalid message format, account details failed.
INVALID_PAYER_PARAMETER The payer is invalid (Not registered member or payment operations disabled)
  • {0} - (Primary) identification of payer
  • 302 - Payment request
error.INVALID_PAYER_PARAMETER.302=The member (member [{0}]) cannot make SMS payments. Payment request failed.
INVALID_RECEIVER_PARAMETER The receiver of the payment is invalid (Not a registered member)
  • {0} - Parameter received as receiver
  • 402 - Direct payment
error.INVALID_RECEIVER_PARAMETER.402=Invalid receiver (member [{0}]), payment failed.
ORIGINATE_MAX_DAILY_AMOUNT_EXCEEDED The member triggering the message has exceeded the daily allowance of transactions -
  • 406 - Direct payment
error.ORIGINATE_MAX_DAILY_AMOUNT_EXCEEDED.406=You have exceeded your max daily transaction amount. Payment failed.
ORIGINATE_MEMBER_BLOCKED_CREDENTIALS The credentials (PIN) of the member triggering the message are blocked -
  • 107 - Account details
  • 202 - Security confirmation
  • 408 - Direct payment
error.ORIGINATE_MEMBER_BLOCKED_CREDENTIALS.107=Your password is blocked, account details failed.
ORIGINATE_MEMBER_INVALID_CREDENTIALS The credentials (PIN) provided by the member originating the message are invalid -
  • 106 - Account details
  • 200 - Security confirmation
  • 410 - Direct payment
error.ORIGINATE_MEMBER_INVALID_CREDENTIALS.106=Invalid password, account details failed.
ORIGINATE_NOT_ENOUGH_CREDITS The member triggering the message does not have enough credit for the transaction -
  • 409 - Direct payment
error.ORIGINATE_NOT_ENOUGH_CREDITS.409=Insufficient balance, payment failed.
ORIGINATE_UPPER_CREDIT_LIMIT_REACHED The member triggering the message has reached the credit limit -
  • 307 - Payment request
error.ORIGINATE_UPPER_CREDIT_LIMIT_REACHED.307=Payment request failed.
REQUEST_PAYMENT_COULD_NOT_BE_SENT The confirmation request to the payer could not be sent (this error does not have any error code but pertains to the process Security confirmation of a Payment request) - - error.REQUEST_PAYMENT_COULD_NOT_BE_SENT=Confirmation unsuccessful. Payment request failed.
SESSION_INVALID_ID_PARAMETER The received unique session id session identifier (OTP) is invalid
  • {0} - The received value of the session id parameter
  • 203 - Security confirmation
error.SESSION_INVALID_ID_PARAMETER.203=The session ID [{0}] is invalid. Confirmation failed.
TRANSACTION INVALID PARAMETER The combination of transaction parameters is not valid (for example, a payment to the same originating member for a Direct payment) -
  • 310 - Payment request
  • 411 - Direct payment
error.TRANSACTION_INVALID_PARAMETERS.310=Invalid command, payment request failed.
TRANSACTION_PAYER_INVALID_CHANNEL The payer is not allowed to operate on the SMS channel (property not selected) -
  • 308 - Payment request
error.TRANSACTION_PAYER_INVALID_CHANNEL.308=The member cannot operate by SMS, payment request failed.


TRANSACTION_PAYER_MAX_DAILY_AMOUNT_EXCEEDED The paying member has exceeded the daily maximum transaction amount -
  • 306 - Payment request
error.TRANSACTION_PAYER_MAX_DAILY_AMOUNT_EXCEEDED.306=Payment request failed.
TRANSACTION_RECEIVER_UPPER_CREDIT_LIMIT_REACHED The member receiving a payment has reached the maximum credit limit -
  • 407 - Direct payment
error.TRANSACTION_RECEIVER_UPPER_CREDIT_LIMIT_REACHED.407=Payment failed.


UNKNOWN_COMMAND_ERROR An unknown error occurred while processing the command -
  • 108 - Account details
  • 312 - Payment request
  • 413 - Direct payment
error.UNKNOWN_COMMAND_ERROR.108=Account details failed.



Error texts in runtime

The following URL will display a complete table of errors in runtime, codes and texts: http://<cyclos_sms_server>:<cyclos_sms_port>/<sms_controller_application>/jsp/errorCodes.jsp. This table is constructed from the internationalization text file (see Internacionalization files), corresponding to a selected instance of Cyclos (see [Cyclos instances], keys language, country, and variant).

Operations translation keys

Operation keys are all translatable message that can be send via SMS. The operation keys are defined in the file cyclosInstance.properties (see Internationalization files)

General operation keys

Key Description Substitutions Sample value
command.<commandName>.regularExpression Regular expression used to match against a message received by the controller (its value has to be unique for a single route defined in confix.xml->controller->driverInstances->criverInstance->cyclosRouting->route, or for all those routes not defining usingPrefix) -

(\\s*)(acinfo|accountinfo)(\\s+.*)*$

command.<commandName>.confirmation Text sent to the member to request confirmation of the <commandName> operation (see Security confirmation). {0} - The text of the message passed by the member (Command to be confirmed) Please confirm request for account details: {0}
command.<commandName>.help.withoutConf Response text for a help request message for the command <commandName>. It is used when the command is configured without security confirmation message (see Security confirmation) {0} - El alias mas corto para el <commandName> For account details. Send a message with: {0} password page number (page number is optional)
command.<commandName>.help.withConf Texto de respuesta a mensaje de ayuda para el comando <commandName>. Es utilizado cuando el comando se encuentra configurado con confirmación de seguridad (ver Security confirmation) {0} - El alias mas corto para el <commandName> For account details. Send a message with: {0} page number (page number is optional)
command.memberNotRegistered Respuesta en caso de que el número de mobil de origen de un mensaje no se encuentre registrado en el cyclos instance (con el cual se procesa el mensaje) - You are not a registered member. In order to register, please send a message with the text: register loginname password fullname
error.template Formato de mensaje a responder en caso de generar un error que posee número de código
  • {0} - Código de error que se ha producido
  • {1} - Descripcion del error. Este parámetro es sustituido por el valor que se obtenga de la clave en error.prooperties
Error {0}: {1}
error.templateWithoutErrorCode Formato de mensaje a responder en caso de generar un error que no posee número de código
  • {0} - Descripción del error
Error: {0}
confirmation.template.onlyOTP Solicitud de confirmación sin utilizar credenciales (PIN). Se utiliza para Register new user
  • {0} - Texto obtenido de la clave command.<commandName>.confirmation
  • {1} - (OTP) Identificador de sesión Session id
{0}. Please confirm operation by sending: cf {1}
confirmation.template.withPIN Solicitud de confirmación.
  • {0} - Texto obtenido de la clave command.<commandName>.confirmation
  • {1} - (OTP) Identificador de sesión Session id
{0}. Please confirm operation by sending: cf {1} password


Operation specific keys

Operation Key (Security confirmation operation) Description Substitutions Sample value
Security confirmation command.confirm.confirmation Texto de mensaje solicitando confirmacion para requerimiento de pago
  • {0} - Principal para miembro receptor del pago
  • {1} - Nombre de usuario para miembro receptor del pago
  • {3} - Nombre del miembro receptor del pago
  • {4} - Monto formateado
{2} has requested you to pay {3}
Security confirmation command.confirm.response.receiver Confirmacion enviado al quien realizó un requerimiento de pago luego que el pago fue confirmado por el pagador
  • {0} - Monto formateado
  • {1} - Número telefónico del miembro pagador
  • {2} - Nombre de usuario del miembrio pagador
  • {3} - Identificador de transaccion
  • {4} - Nuevo saldo disponible formateado (luego de realizado el pago)
You have received a payment of {0} from member {3} ({2}). Transaction ID: {4}. Your new account balance is : {5}
Security confirmation command.confirm.response.payer Notificación enviada a quien confirmó un requerimiento de pago
  • {0} - Monto formateado
  • {1} - Número telefónico del miembro receptor del pago
  • {2} - Nombre de usuario del miembro receptor del pago
  • {3} - Nombre del miembro receptor del pago
  • {4} - Identificador de transacción
  • {5} - Nuevo saldo disponible formateado (luego de realizado el pago)
You have made a payment of {0} to member: {3} ({2}). Transaction ID: {4}. New account balance: {5}
Security confirmation command.confirm.cancel.payer Notificación de cancelado de requerimiento de pago, enviada al pagador
  • {0} - Monto formateado
  • {1} - Número telefónico del miembro requirente (receptor) del pago
  • {2} - Nombre de usuario del miembro requirente (Receptor) del pago
  • {3} - Nombre del miembro requierente (Receptor) del pago
  • {4} - monto del requerimiento de pago cancelado
Payment request from member {3} by {0} was canceled.
Security confirmation command.confirm.cancel.receiver Notificación de cancelado de requerimiento de pago, enviada al requierente (receptor)
  • {0} - Monto formateado
  • {1} - Número telefónico del miembro pagador
  • {2} - Nombre de usuario del miembro pagador
  • {3} - Nombre del miembro requierente pagador
  • {4} - monto del requerimiento de pago cancelado
Payment request from member {3} by {0} was canceled.
Operation Key (Account details operation) Description Substitutions Basic value
Account details command.accountDetails.response.withTx Respuesta de comando Account details
  • {0} - Balance disponible
  • {1} - Nombre (alias) mas largo de la moneda
  • {2} - Lista de transacciones (items formateados con command.accountDetails.response.tx)
  • {3} - command.accountDetails.response.next ("" si no existen transacciones mas antiguas que las mostradas)
Available balance: {0} {1}. Last transactions: {2} {3}
Account details command.accountDetails.response.tx.dateFormat Formato de la fecha para cada transacción - dd/MM/yyyy HH:mm
Account details command.accountDetails.response.tx Formato de cada item de transacción listado
  • {0} - Secuencial de la transaccion (en la página)
  • {1} - Fecha de la transaccion (formateada con command.accountDetails.response.tx.dateFormat)
  • {2} - Nombre del miembro complementario de la transaccion
  • {3} - Nombre de usuario del miembro complementario de la transaccion
  • {4} - Monto de la transacción
{1} {3} {4}
Account details command.accountDetails.response.tx.separator Caracteres separadores de cada items en el listado de transacciones - ::
Account details command.accountDetails.response.withoutTx Respuesta de comando Account details cuando no hay transacciones para listar
  • {0} - Balance disponible
  • {1} - Nombre (alias) mas largo de la moneda
  • {2} - Número de página actual
Available balance: {0} {1}. No transactions for page {2}
Account details command.accountDetails.response.next Indicador de existencia de transacciones anteriores (existen mas páginas de transacciones para listar) - +
Operation Key (Help operation) Description Substitutions Basic value
Help command.help.help Ayuda general dentro de un cyclosInstance. Es devuelta al recibir un mensaje de comando Help sin parámetros - For information about SMS operations. Send a message with the word help followed by one of the following operation commands: acinfo, pay, rq, reg, info
Operation Key (Direct payment operation) Description Substitutions Basic value
Direct payment command.performPayment.response Confirmación (respuesta) de pago realizado.
  • {0} - Nombre completo del miembro receptor del pago
  • {1} - UserName (LoginName) del miembro receptor del pago
  • {2} - Monto del pago formateado (incluye simbolo de moneda)
  • {3} - Número de transaccion (en Cyclos)
  • {4} - Balance (saldo disponible) del pagador luego de ejecutado el pago.
You have made a payment of {2} to member: {1}. Transaction ID: {3}. Your new account balance is {4}
Operation Key (Register new user operation) Description Substitutions Basic value
Register new user command.registration.response Confirmación (respuesta) de registro realizado.
  • {0} - Nombre de la instancia de cyclos en la cual se realizó el registro
  • {1} - UserName (LoginName) del miembro registrado
  • {2} - Mobile phone number del miembro registrado
You have been registered with mobile number {2} and login name {1}.