turquoiseowl / i18n

Smart internationalization for ASP.NET
Other
556 stars 156 forks source link

angularjs kendojs [[[ being converted #327

Closed apiercy78 closed 7 years ago

apiercy78 commented 7 years ago

I have been using this without fail for the longest time but now when I try to include Kendo JS or some AngularJS scripts I am getting Unexpected symbol error ].

Looks like the JS is still being translated at run time even though I have outgoing and Incoming filters set as below:

        UrlLocalizer.IncomingUrlFilters += delegate(Uri url)
        {
            if (url.LocalPath.ToLower().Contains("bundles") || url.LocalPath.ToLower().Contains("content") || url.LocalPath.ToLower().Contains("scripts"))
            {
                return false;
            }
            return true;
        };

        UrlLocalizer.OutgoingUrlFilters += delegate(string url, Uri currentRequestUrl)
        {
            Uri uri;
            if (Uri.TryCreate(url, UriKind.Absolute, out uri) || Uri.TryCreate(currentRequestUrl, url, out uri))
            {
                if (uri.LocalPath.ToLower().Contains("bundles") || uri.LocalPath.ToLower().Contains("content") || uri.LocalPath.ToLower().Contains("scripts"))
                {
                    return false;
                }
            }
            return true;
        };

I have included blacklist paths in the webconfig also.

turquoiseowl commented 7 years ago

Using the default nugget markup can conflict with JavaScript arrays. Have you considered alternative sequences? I use [#[message]#] for this reason.

https://github.com/turquoiseowl/i18n#nugget-markup-customization

apiercy78 commented 7 years ago

Thanks for your reply, I was able to fix the issue by adding in blacklists for my bundles and moving the i18n code in global.asax to after the registration logic.

Alisdair


From: Martin Connell notifications@github.com Sent: December 7, 2016 6:42 PM To: turquoiseowl/i18n Cc: Alisdair Piercy; Author Subject: Re: [turquoiseowl/i18n] angularjs kendojs [[[ being converted (#327)

Using the default nugget markup can conflict with JavaScript arrays. Have you considered alternative sequences? I use [#[message]#] for this reason.

https://github.com/turquoiseowl/i18n#nugget-markup-customization

- You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/turquoiseowl/i18n/issues/327#issuecomment-265609579, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APx7sr-QmwBk7Dp9WipZCPghqEwVyBToks5rF0R9gaJpZM4LG4jd.