timkeane / nyc-lib

Apache License 2.0
12 stars 8 forks source link

translate error when switching back to English #43

Open cmenedes opened 3 years ago

cmenedes commented 3 years ago

Expected Behavior

Using the translate button should not throw any errors.

Current Behavior

I'm not sure how this is impacting functionality as translations are still working, but the following error appears in the console after you switch back to English:

Uncaught TypeError: Cannot read property 'name' of undefined at HTMLButtonElement.eval (webpack-internal:///174:240) at Function.each (jquery.min.js:2) at S.fn.init.each (jquery.min.js:2) at Goog.showOriginalText (webpack-internal:///174:234) at Goog.translate (webpack-internal:///174:128) at HTMLSelectElement.i (jquery.min.js:2) at HTMLSelectElement.dispatch (jquery.min.js:2) at HTMLSelectElement.v.handle (jquery.min.js:2)

This doesn't seem to happen when you switching the language using the translate menu in the splash window, only when using the translate button on the map.

Failure Information (for bugs)

Steps to Reproduce

  1. Build nyc-lib as described in readme. Open finderapp.html located in the dist/examples/ol folder
  2. Switch Language to language other than English (bottom-left corner of map) image
  3. Switch Language back to English, and observe if there are any errors in the console