Fxied i18n dashed vars

Closes #483
This commit is contained in:
Igor Zhukov 2014-09-23 21:06:05 +04:00
parent 9597d50d3a
commit 8f402d2f31
3 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ angular.module('myApp.i18n', ['izhukov.utils'])
var locale = Config.I18n.locale;
var messages = Config.I18n.messages;
var fallbackMessages = Config.I18n.fallback_messages;
var paramRegEx = /\{\s*([a-zA-Z\d\--]+)(?:\s*:\s*(.*?))?\s*\}/g;
var paramRegEx = /\{\s*([a-zA-Z\d\-_]+)(?:\s*:\s*(.*?))?\s*\}/g;
function insertParams(msgstr, params) {
return msgstr.replace(paramRegEx, function ($0, paramKey, nestedMsgStr) {

View File

@ -173,8 +173,8 @@
"conversation_unknown_user": "Somebody",
"conversation_unknown_chat": "Unknown chat",
"message_service_created_group": "created the group {group_name}",
"message_service_changed_group_name": "changed group name to {group_name}",
"message_service_created_group": "created the group {group-name}",
"message_service_changed_group_name": "changed group name to {group-name}",
"message_service_changed_group_photo": "changed group photo",
"message_service_removed_group_photo": "removed group photo",
"message_service_invited_user": "invited {user}",

View File

@ -2,7 +2,7 @@
<my-i18n>
<span ng-switch-when="messageActionChatCreate" my-i18n-format="message_service_created_group"></span>
<span ng-switch-when="messageActionChatEditTitle" my-i18n-format="message_service_changed_group_name"></span>
<my-i18n-param name="group_name">&laquo;<strong ng-bind-html="::historyMessage.action.rTitle"></strong>&raquo;</my-i18n-param>
<my-i18n-param name="group-name">&laquo;<strong ng-bind-html="::historyMessage.action.rTitle"></strong>&raquo;</my-i18n-param>
</my-i18n>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="message_service_changed_group_photo"></span>
<span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>