Browse Source

Fxied i18n dashed vars

Closes #483
master
Igor Zhukov 10 years ago
parent
commit
8f402d2f31
  1. 2
      app/js/i18n.js
  2. 4
      app/js/locales/en-us.json
  3. 2
      app/partials/desktop/message_service.html

2
app/js/i18n.js

@ -5,7 +5,7 @@ angular.module('myApp.i18n', ['izhukov.utils'])
var locale = Config.I18n.locale; var locale = Config.I18n.locale;
var messages = Config.I18n.messages; var messages = Config.I18n.messages;
var fallbackMessages = Config.I18n.fallback_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) { function insertParams(msgstr, params) {
return msgstr.replace(paramRegEx, function ($0, paramKey, nestedMsgStr) { return msgstr.replace(paramRegEx, function ($0, paramKey, nestedMsgStr) {

4
app/js/locales/en-us.json

@ -173,8 +173,8 @@
"conversation_unknown_user": "Somebody", "conversation_unknown_user": "Somebody",
"conversation_unknown_chat": "Unknown chat", "conversation_unknown_chat": "Unknown chat",
"message_service_created_group": "created the group {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_name": "changed group name to {group-name}",
"message_service_changed_group_photo": "changed group photo", "message_service_changed_group_photo": "changed group photo",
"message_service_removed_group_photo": "removed group photo", "message_service_removed_group_photo": "removed group photo",
"message_service_invited_user": "invited {user}", "message_service_invited_user": "invited {user}",

2
app/partials/desktop/message_service.html

@ -2,7 +2,7 @@
<my-i18n> <my-i18n>
<span ng-switch-when="messageActionChatCreate" my-i18n-format="message_service_created_group"></span> <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> <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> </my-i18n>
<span ng-switch-when="messageActionChatEditPhoto" my-i18n="message_service_changed_group_photo"></span> <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> <span ng-switch-when="messageActionChatDeletePhoto" my-i18n="message_service_removed_group_photo"></span>

Loading…
Cancel
Save