Skip to content

Commit

Permalink
fix(resource-limits-plugin): add billing hook translations (bwsw#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
dron8552 committed Feb 22, 2019
1 parent 06dcaf0 commit b77ec84
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/app/shared/services/error.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export class ErrorService {
regex: /Failed to retrieve domains/,
translation: 'ERRORS.RESOURCE_QUOTAS.FAILED_RETRIEVE',
},
{
regex: /Can not update resource with a limit equal to -1/,
translation: 'ERRORS.RESOURCE_QUOTAS.FAILED_UPDATE',
},
{
regex: /maximum must be greater than or equal to minimum/,
translation: 'ERRORS.RESOURCE_QUOTAS.MAX_MUST_BE_GREATER',
Expand All @@ -101,6 +105,14 @@ export class ErrorService {
regex: /max must be between (\d+) and (\d+)/,
translation: 'ERRORS.RESOURCE_QUOTAS.MAX_MUST_BE_BETWEEN',
},
{
regex: /billingid must be specified in accountdetails/,
translation: 'ERRORS.RESOURCE_QUOTAS.NO_BILLING_ID',
},
{
regex: /Запрошенные ресурсы RAM: (\d+) GB, Первичное хранилище: (\d+) GB, Дополнительное хранилище: (\d+) GB не могут быть предоставлены\. Для автоматического выделения требуется чтобы баланс счета был не менее чем (\d+\.?\d*) Руб\., сейчас - (\d+\.?\d*) Руб\./i,
translation: 'ERRORS.RESOURCE_QUOTAS.RESOURCES_CAN_NOT_BE_PROVIDED',
},
{
regex: /Unable to detach volume, please specify a VM that does not have VM snapshots/,
translation: 'ERRORS.VOLUME.VOLUME_DETACH_UNAVAILABLE',
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@
},
"RESOURCE_QUOTAS": {
"FAILED_RETRIEVE": "You can not change any resource limits",
"FAILED_UPDATE": "You can not resource limit",
"MAX_MUST_BE_GREATER": "Maximum must be greater than or equal to minimum",
"MAX_MUST_BE_BETWEEN": "Maximum must be between {{ val1 }} and {{ val2 }}"
"MAX_MUST_BE_BETWEEN": "Maximum must be between {{ val1 }} and {{ val2 }}",
"NO_BILLING_ID": "Billing Id doesn't specified for user",
"RESOURCES_CAN_NOT_BE_PROVIDED": "The requested resources RAM: {{ val1 }} GB, Primary Storage: {{ val2 }} GB, Secondary Storage: {{ val3 }} GB cannot be provided. Automatic allocation requires that the account balance is not less than {{ val4 }} Rub., current balance is {{ val3 }} Rub."
}
},
"NOTIFICATIONS": {
Expand Down
5 changes: 4 additions & 1 deletion src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@
},
"RESOURCE_QUOTAS": {
"FAILED_RETRIEVE": "Невозможно изменить ресурсы",
"FAILED_UPDATE": "Невозможно изменить ресурс",
"MAX_MUST_BE_GREATER": "Максимальное значение должно быть больше или равно минимальному",
"MAX_MUST_BE_BETWEEN": "Максимальное значение должно быть между {{ val1 }} и {{ val2 }}"
"MAX_MUST_BE_BETWEEN": "Максимальное значение должно быть между {{ val1 }} и {{ val2 }}",
"NO_BILLING_ID": "Billing Id не задан для пользователя",
"RESOURCES_CAN_NOT_BE_PROVIDED": "Запрошенные ресурсы ОЗУ: {{ val1 }} ГБ, Первичное хранилище: {{ val2 }} ГБ, Дополнительное хранилище: {{ val3 }} ГБ не могут быть предоставлены. Для автоматического выделения требуется чтобы баланс счета был не менее чем {{ val4 }} Руб., сейчас {{ val5 }} Руб."
}
},
"NOTIFICATIONS": {
Expand Down

0 comments on commit b77ec84

Please sign in to comment.