Exemple #1
0
        public override void ApplyResources(string cultureCode)
        {
            ResourcesList.Clear();
            foreach (Control ctl in Controls)
            {
                var action = ctl.Tag as ActionMetaItem;
                if (action != null)
                {
                    string s        = action.CaptionId(BusinessObject, Permissions);
                    var    resValue = CommonResourcesCache.Get(CommonResource.BvMessages.ToString(), cultureCode, s, GetViewNameForSplittedResources());
                    var    propName = TranslationToolHelper.GetPropertyName(ctl.Name, TranslationToolHelper.TextPropName);
                    if (resValue == null && Messages != null)
                    {
                        resValue = CommonResourcesCache.Get(Messages.GetType().Name, cultureCode, s, GetViewNameForSplittedResources());
                    }
                    if (resValue != null)
                    {
                        ResourcesList.Add(propName, resValue);
                        ctl.Text = resValue.Value.ToString();

                        if (!EditableControlsList.ContainsKey(propName))
                        {
                            EditableControlsList.Add(propName, ctl);
                        }
                    }
                }
                else if (BasePanel != null && !(ctl is TranslationButton))
                {
                    TranslationToolHelperWinClient.ApplyResources(ctl, BasePanel as ITranslationView, cultureCode);
                }
            }
        }
Exemple #2
0
 public override void ApplyResources(string cultureCode)
 {
     ResourcesList.Clear();
     EditableControlsList.Clear();
     foreach (GridColumn col in GridView.Columns)
     {
         string captionId = GetKeyForComponent(col, DesignElement.Caption);
         var    resValue  = CommonResourcesCache.Get("EidssFields", cultureCode, captionId, GetViewNameForSplittedResources());
         string propName  = TranslationToolHelper.GetPropertyName(col.Name, TranslationToolHelper.CaptionPropName);
         if (resValue != null && resValue.Value is string)
         {
             if (!ResourcesList.ContainsKey(propName))
             {
                 ResourcesList.Add(propName, resValue);
             }
             col.Caption = resValue.Value.ToString();
         }
         else
         {
             if (!ResourcesList.ContainsKey(propName))
             {
                 ResourcesList.Add(propName, new ResourceValue
                 {
                     Value = col.Caption,
                     //RawValue = col.Caption,
                     //SourceFileName = string.Format("EidssFields.{0}.resx", cultureCode),
                     EnglishText  = WinClientContext.FieldCaptions.GetString(captionId, null, common.Core.Localizer.lngEn),
                     SourceKey    = captionId,
                     ResourceName = CommonResource.EidssFields.ToString()
                 });
             }
         }
         EditableControlsList.Add(propName, col);
     }
 }
Exemple #3
0
        public override void ApplyResources(string cultureCode)
        {
            base.ApplyResources(cultureCode);
            var resValues = TranslationToolHelper.ReadResxFile(ParentBasePanel.GetType().Name, cultureCode,
                                                               null, null);

            if (resValues.ContainsKey("$this.Caption"))
            {
                CaptionLabel.Text = resValues["$this.Caption"].Value.ToString();
                if (!EditableControlsList.ContainsKey("$this.Caption"))
                {
                    EditableControlsList.Add("$this.Caption", this);
                }
            }
        }