language packs

 packes

https://community.sana-commerce.com/translations/versions


to install language to front end side

admin  app > lanuage > configuration > 

1 upload correct lanuage pack save 

2 need to do app pool restart. after the install package.


To install language to admin side , 

D:\Project docs\lanuages\Change Language of Sana Admin



CHANGE LANGUAGE OF THE SANA ADMIN

·        Download the required Language from below link
Note : Select the Language pack from the “Admin Language Packs” section
-https://community.sana-commerce.com/translations/versions

 

·        Extract the Folder (following files will be there)



·        Step 1: Copy the “Admin” resource file from the “AdminResources” folder in the language pack and replace the one in the Sana Commerce frontend directory:

Frontend\App_Data\content\files\images\languages

 

·        Step 2 : Copy the Language pack icon from content folder to frontend directory :

Frontend\App_Data\AdminResources

·        Step 3: Execute the “Add language script Admin.sql” script on the Sana Commerce database. When the language pack is installed the language of the Sana Admin interface will be changed.


SSO single sign on projects

 Coulisse. 935



Create new UIHint on sana : Drop down

 [DisplayName("ProductPage")]

    [DisplayColumn("Title")]
    public class ProductPage_Metadata : MetadataBase<IProductEnrichment>
    {
        
        ..............

 
        [Display(Name = "CustomerSegments", Order = 121)]
        [UIHint("Country")] 
       // [UIHint("CustomerSegments")]
        public object CustomerSegmentsIds { get; set; }
 
    }


public List<string>CustomerSegmentsIds { get; set; }

View > default > Shared > EditorTemplate > Country.

check Providertype also

@using Sana.Commerce
@using Sana.Commerce.Shop
 
@{
    var fieldTitle = Html.DisplayName(string.Empty).ToString();
    var name = string.Empty;
    var value = ViewData.Model as string;   
 
    var selectedId = ViewData.Model as string;
    var entityField = ViewData.Model as EntityTemplateFieldModel;
 
    var customerSegments = CommerceFrameworkBase.CustomerSegments.Provider.GetCustomerSegments().ToList();
 
 
    if (entityField != null)
    {
        fieldTitle = entityField.FieldTitle;
        name = entityField.Name;
        value = (string)entityField.Value;       
        selectedId = (string)entityField.Value;
    }
   
 
    var modelState = ViewData.ModelState[name];
    if (modelState != null && modelState.Value != null)
    {
        selectedId = modelState.Value.AttemptedValue;
    }
 
    var htmlAttributes = Html.GetTextBoxAttributes(fieldTitle, required: false);
    if (ViewData.ContainsKey("tabindex"))
    {
        htmlAttributes["tabindex"= ViewData["tabindex"];
    }
 
    <div class="ddlb">
        <select name="@Html.Name(name)" id="@Html.Id(name)" @Html.RenderAttributes(htmlAttributes)>
            <option disabled @When(!customerSegments.Any(cs => cs.Id.iEquals(value)), "selected")>
                @Sana.SimpleText("SelectCustomerSegmentPlaceholder""Select customer segment")
            </option>
 
            @{
                var isSelected = false;
 
                foreach (var item in customerSegments)
                {
                    isSelected = false;
                    if (value == item.Id)
                    {
                        isSelected = true;
                    }
                    <option selected="@isSelected" value="@item.Id">@item.Title.Or(item.Id).AsHtml() </option>
                }
 
            }
 
 
        </select>
    </div>
 
    
 
 
}
 
 




@using Sana.Commerce
@using ICountry = Sana.Commerce.Common.ICountry
@{
    var fieldTitle = Html.DisplayName(string.Empty).ToString();
    var name = string.Empty;
    var value = ViewData.Model as string;
    var countries = ViewBag.Countries as IList<ICountry>;
    var selectedId = ViewData.Model as string;
    var entityField = ViewData.Model as EntityTemplateFieldModel;
 
    var cStatment = CommerceFrameworkBase.CustomerSegments.Provider.GetCustomerSegments().ToList();
 
 
 
 
    if (entityField != null)
    {
        fieldTitle = entityField.FieldTitle;
        name = entityField.Name;
        value = (string)entityField.Value;
 
        if (entityField.Settings.Countries != null)
        {
            countries = entityField.Settings.Countries;
        }
        selectedId = (string)entityField.Value;
    }
    if (countries == null)
    {
        countries = CommerceFrameworkBase.Common.GetCountries(userCountriesOnly: true, visibleOnly: true);
    }
    var modelState = ViewData.ModelState[name];
    if (modelState != null && modelState.Value != null)
    {
        selectedId = modelState.Value.AttemptedValue;
    }
 
    var htmlAttributes = Html.GetTextBoxAttributes(fieldTitle, required: true);
    if (ViewData.ContainsKey("tabindex"))
    {
        htmlAttributes["tabindex"] = ViewData["tabindex"];
    }
    @*<div class="ddlb">
        <select name="@Html.Name(name)" id="@Html.Id(name)" @Html.RenderAttributes(htmlAttributes)>
            <option disabled @When(!countries.Any(country => country.Id.iEquals(value)), "selected")>@Sana.SimpleText("SelectCountryPlaceholder")</option>
            @foreach (var item in countries)
            {
                <option value="@item.Id" @Html.RenderAttributes(GetOptionHtmlAttributes(item, selectedId))>@item.Name.Or(item.Id).AsHtml()</option>
            }
        </select>
    </div>*@
 
 
    <div class="ddlb">
        <select name="@Html.Name(name)" id="@Html.Id(name)" @Html.RenderAttributes(htmlAttributes)>
            <option disabled @When(!countries.Any(country => country.Id.iEquals(value)), "selected")>@Sana.SimpleText("SelectCountryPlaceholder")</option>
            @foreach (var item in cStatment)
            {
                <option value="@item.Id">@item.Title.Or(item.Id).AsHtml()</option>
            }
        </select>
    </div>
 
 
 
}
 
 
@functions
{
    IDictionary<string, object> GetOptionHtmlAttributes(ICountry country, string selectedId)
    {
        var attributes = new Dictionary<string, object>();
        if (country.Id.iEquals(selectedId))
        {
            attributes["selected"] = "selected";
        }
        if (country.AddressUseZipPlus4)
        {
            attributes["data-zipPlus4"] = "true";
        }
        return attributes;
    }
}