Open Closed

Use localization in html template files #537


0
omital created

Hi, What is best way for use localization in html templateUrl file ?


3 Answer(s)
  • 0
    hikalkan created
    Support Team

    I generally use .cshtml instead of .html. But if you use .html, you should use client-side localization API described here: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Localization#DocInJavascript">http://www.aspnetboilerplate.com/Pages/ ... Javascript</a> You have different options, you can create a angular filter or add a Localize method to your scope...

  • 0
    omital created

    I use .chtml file generraly but for situation that we want view modal like this

    var modalInstance = $modal.open({
                    animation: true,
                    templateUrl: 'app/Main/views/factorForm/factorEditForm.html',
                    controller: ctrlrIdEditFactor,
                    size: 'lg',
                    resolve: {
                        item: function () {
                            if (vm.factorForm.factorFormFactors == null)
                                vm.factorForm.factorFormFactors = new Array();
                            if (vm.factorForm.factorFormFactors.indexOf(itm) == -1)
                                    return itm;
                            else
                                return angular.copy(itm);
                        }
                    }
                }
    

    we cant use .chtml

  • 0
    hikalkan created
    Support Team

    OK, than you can use client side localization as I said before :)