lgalfaso / angular-dynamic-locale

Module to be able to change the locale at an angularjs application
http://lgalfaso.github.io/angular-dynamic-locale/
MIT License
322 stars 75 forks source link

Issue with special characters #105

Closed MMastrofini closed 8 years ago

MMastrofini commented 8 years ago

When I use characters like &, à or è, I see their corresponding code, e.g. & for & or à for à. My version is 0.1.32.

lgalfaso commented 8 years ago

Hi, would it be possible to understand what the specific issue is? Would it be possible to have a plunker that shows the issue?

MMastrofini commented 8 years ago

I followed the step by step procedure. The module is working correctly, provided I don't use special characters. When I use special characters, I see their corresponding code, e.g. & rather than & or à rather than à.

E.g. in my HTML I have <p>{{"FooterA" | translate}}</p>. In my localized json file I have {"FooterA":"--- è ---"}and the output in the HTML page is --- &#232; ---

app.js is just

angular .module('LASTHorizon', [ 'ngRoute', 'ngCookies', 'ui.router', 'ngSanitize', 'pascalprecht.translate', 'tmh.dynamicLocale', 'LocalStorageModule' ]);

app.controller('IndexCtrl', ['$scope', 'LocaleService', function ($scope, LocaleService) {
    $scope.currentLocaleDisplayName = LocaleService.getLocaleDisplayName();
    $scope.localesDisplayNames = LocaleService.getLocalesDisplayNames();
    $scope.visible = $scope.localesDisplayNames &&
      $scope.localesDisplayNames.length > 1;
    $scope.changeLanguage = function (locale) {
      LocaleService.setLocaleByDisplayName(locale);
    };
  }]
);
lgalfaso commented 8 years ago

This project is tmh.dynamicLocale, are you looking for pascalprecht.translate?

On Wednesday, July 6, 2016, MMastrofini notifications@github.com wrote:

I followed the step by step procedure. The module is working correctly, provided I don't use special characters. When I use special characters, I see their corresponding code, e.g. & rather than & or à rather than à.

E.g. in my HTML I have

{{"FooterA" | translate}}

. In my localized json file I have {"FooterA":"--- è ---"}and the output in the HTML page is --- è ---

app.js is just

angular .module('LASTHorizon', [ 'ngRoute', 'ngCookies', 'ui.router', 'ngSanitize', 'pascalprecht.translate', 'tmh.dynamicLocale', 'LocalStorageModule' ]);

app.controller('IndexCtrl', ['$scope', 'LocaleService', function ($scope, LocaleService) { $scope.currentLocaleDisplayName = LocaleService.getLocaleDisplayName(); $scope.localesDisplayNames = LocaleService.getLocalesDisplayNames(); $scope.visible = $scope.localesDisplayNames && $scope.localesDisplayNames.length > 1; $scope.changeLanguage = function (locale) { LocaleService.setLocaleByDisplayName(locale); }; }] );

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lgalfaso/angular-dynamic-locale/issues/105#issuecomment-230833747, or mute the thread https://github.com/notifications/unsubscribe/AAX44lSxXa2ntW4OOWwSvmkiL11uVZlAks5qS9xNgaJpZM4JGPpR .

MMastrofini commented 8 years ago

I am very sorry, I initially thought the problem was somewhere else. Thanks.