turquoiseowl / i18n

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

Javascript not translating #194

Closed markoOmega closed 9 years ago

markoOmega commented 9 years ago

Hi,

when we set up newest i18n version Javascript is not localizing. We tried with all settings from documentation.

turquoiseowl commented 9 years ago

Is anything translating?

markoOmega commented 9 years ago

No, nothing. But when I take version from nuget it works as charm. But on that version there is no Void schema so that's the reason I need newer version.

turquoiseowl commented 9 years ago

To troubleshoot:

  1. Ensure the HTTP module is loading correctly via the settings in web.config.
  2. Ensure you have the 'locale' folder structure in place and you have successfully run the post build procedure to pick up any nuggets and update the POT and PO files under there.
  3. If you build the Debug configuration, i18n should output trace information to the Debugger output window.
gitsno commented 9 years ago

When you say Javascript is not localizing - how are the Javascript resources requested, are they static files, returned by a handler or aspx, something else? I recently added improved handling of static file compression, which may be affecting your Javascript - see https://github.com/turquoiseowl/i18n#static-file-compression-and-i18n for your options when working with static files.

markoOmega commented 9 years ago

When I said nothing to localize I was referencing Javascript not all files (because the theme is Javascript so I'm sorry for not being clear). I'm not using static file compression and all other files IS localizing, but Javascript with this version of i18n is not localizing and with latest nuget version is localizing (I want use this latest version because of Void scheme and lang cookie).

turquoiseowl commented 9 years ago

I've just done a quick test with the latest codebase and can confirm that javascript does translate okay. So I presume it is something in your config.

On the basis that other content-types are translating okay, further things to check:

  1. Your nuggets in .js are being found by PostBuild and inserted into the .POT/.PO files correctly. If not, look at your i18n.WhiteList setting.
  2. You have translation entries (msgstr values) for those nuggets in the .PO files.
  3. Bundling is DISABLED for the .js files in question.
  4. i18n.LocalizedApplication.Current.ContentTypesToLocalize setting is not excluding the mime type of your js resources in question.
  5. i18n.LocalizedApplication.Current.UrlsToExcludeFromProcessing is not excluding the URLS for your js resources in question.