Как сделать перевод?

djuga228

Пользователь
6 Июл 2015
56
0
Как сделать перевод того что в чате пишется, вот пример
e86bca5a5f51.png

Надо это на рус перевести :D
Что бы для Англикосов на энг было , а для Русских на русс было
 
[quote author=djuga228 link=topic=256.msg1352#msg1352 date=1439580021]
Как сделать перевод того что в чате пишется, вот пример
e86bca5a5f51.png

Надо это на рус перевести :D
Что бы для Англикосов на энг было , а для Русских на русс было
[/quote]
Делай уведомления в панораме. Такие штуки должны обрабатываться у каждого клиента отдельно, а не на сервере(луа).
В JS есть $.Localize( "#some_value_from_..." )
from game ...\panorama\localization\addon_english.txt или russian.
 
Последнее редактирование модератором:
Делай уведомления в панораме. Такие штуки должны обрабатываться у каждого клиента отдельно, а не на сервере(луа).
В JS есть $.Localize( "#some_value_from_..." )
from game ...\panorama\localization\addon_english.txt или russian.
Нету
Код:
function TopNotification( msg ) {
 AddNotification(msg, $('#TopNotifications'));
}

function BottomNotification(msg) {
 AddNotification(msg, $('#BottomNotifications'));
}

function AddNotification(msg, panel) {
 var newNotification = true;
 var lastNotification = panel.GetChild(panel.GetChildCount() - 1)
 //$.Msg(msg)

 msg.continue = msg.continue || false;
 //msg.continue = true;

 if (lastNotification != null && msg.continue) 
  newNotification = false;

 if (newNotification){
  lastNotification = $.CreatePanel('Panel', panel, '');
  lastNotification.AddClass('NotificationLine')
  lastNotification.hittest = false;
 }

 var notification = null;
 
 if (msg.hero != null)
  notification = $.CreatePanel('DOTAHeroImage', lastNotification, '');
 else if (msg.image != null)
  notification = $.CreatePanel('Image', lastNotification, '');
 else if (msg.ability != null)
  notification = $.CreatePanel('DOTAAbilityImage', lastNotification, '');
 else if (msg.item != null)
  notification = $.CreatePanel('DOTAItemImage', lastNotification, '');
 else
  notification = $.CreatePanel('Label', lastNotification, '');

 if (typeof(msg.duration) != "number"){
  //$.Msg("[Notifications] Notification Duration is not a number!");
  msg.duration = 3
 }
 
 if (newNotification){
  $.Schedule(msg.duration, function(){
   //$.Msg('callback')
   lastNotification.DeleteAsync(0);
  });
 }

 if (msg.hero != null){
  notification.heroimagestyle = msg.imagestyle || "icon";
  notification.heroname = msg.hero
  notification.hittest = false;
 } else if (msg.image != null){
  notification.SetImage(msg.image);
  notification.hittest = false;
 } else if (msg.ability != null){
  notification.abilityname = msg.ability
  notification.hittest = false;
 } else if (msg.item != null){
  notification.itemname = msg.item
  notification.hittest = false;
 } else{
  notification.html = true;
  var text = msg.text || "No Text provided";
  notification.text = $.Localize(text)
  notification.hittest = false;
  notification.AddClass('TitleText');
 }
 
 if (msg.class)
  notification.AddClass(msg.class);
 else
  notification.AddClass('NotificationMessage');

 if (msg.style){
  for (var key in msg.style){
   var value = msg.style[key]
   notification.style[key] = value;
  }
 }
}

(function () {
 GameEvents.Subscribe( "top_notification", TopNotification );
 GameEvents.Subscribe( "bottom_notification", BottomNotification );
})();
 
Последнее редактирование модератором:
[quote author=djuga228 link=topic=256.msg1363#msg1363 date=1439679589]
Нету
Код:
function TopNotification( msg ) {
 AddNotification(msg, $('#TopNotifications'));
}

function BottomNotification(msg) {
 AddNotification(msg, $('#BottomNotifications'));
}

function AddNotification(msg, panel) {
 var newNotification = true;
 var lastNotification = panel.GetChild(panel.GetChildCount() - 1)
 //$.Msg(msg)

 msg.continue = msg.continue || false;
 //msg.continue = true;

 if (lastNotification != null && msg.continue) 
  newNotification = false;

 if (newNotification){
  lastNotification = $.CreatePanel('Panel', panel, '');
  lastNotification.AddClass('NotificationLine')
  lastNotification.hittest = false;
 }

 var notification = null;
 
 if (msg.hero != null)
  notification = $.CreatePanel('DOTAHeroImage', lastNotification, '');
 else if (msg.image != null)
  notification = $.CreatePanel('Image', lastNotification, '');
 else if (msg.ability != null)
  notification = $.CreatePanel('DOTAAbilityImage', lastNotification, '');
 else if (msg.item != null)
  notification = $.CreatePanel('DOTAItemImage', lastNotification, '');
 else
  notification = $.CreatePanel('Label', lastNotification, '');

 if (typeof(msg.duration) != "number"){
  //$.Msg("[Notifications] Notification Duration is not a number!");
  msg.duration = 3
 }
 
 if (newNotification){
  $.Schedule(msg.duration, function(){
   //$.Msg('callback')
   lastNotification.DeleteAsync(0);
  });
 }

 if (msg.hero != null){
  notification.heroimagestyle = msg.imagestyle || "icon";
  notification.heroname = msg.hero
  notification.hittest = false;
 } else if (msg.image != null){
  notification.SetImage(msg.image);
  notification.hittest = false;
 } else if (msg.ability != null){
  notification.abilityname = msg.ability
  notification.hittest = false;
 } else if (msg.item != null){
  notification.itemname = msg.item
  notification.hittest = false;
 } else{
  notification.html = true;
  var text = msg.text || "No Text provided";
  notification.text = $.Localize(text)
  notification.hittest = false;
  notification.AddClass('TitleText');
 }
 
 if (msg.class)
  notification.AddClass(msg.class);
 else
  notification.AddClass('NotificationMessage');

 if (msg.style){
  for (var key in msg.style){
   var value = msg.style[key]
   notification.style[key] = value;
  }
 }
}

(function () {
 GameEvents.Subscribe( "top_notification", TopNotification );
 GameEvents.Subscribe( "bottom_notification", BottomNotification );
})();
[/quote]
Текст идет в формате "#MY_MESSAGE" который прописан в addon_english.txt ?
 
Последнее редактирование модератором:
Реклама: