#6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US")
by Luc Saffre · in Developers
Kokkuvõte
In lets2, when I added a weight field as asked by the exercise in the LETS tutorial, and when I then fill a weight vcalue for some product, the front end turns into a blank page and the JS console says Uncaught RangeError: invalid language tag: "en_US"
Children
Kommentaarid
- 5 kuud, 3 nädalat ago by Luc Saffre about #6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US") : I had added the Product.weight field to lets2 in order to reproduce this issue, and this change then lead to a doctest failure in book/docs/projects/lets2.rst
- 5 kuud, 3 nädalat ago by Luc Saffre about #6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US") : I committed my changes. @JMK was watching me. After all he discovered the bug.
- 5 kuud, 3 nädalat ago by Luc Saffre about #6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US") : Found the solution: in react/views.py it says user_settings = dict(...locale=to_locale(site_lang)), but Intl.NumberFormat requires "en-us" instead of "en_US". And fortunately Django has another function to_language(), which works like to_locale().
- 5 kuud, 3 nädalat ago by Luc Saffre about #6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US") : Created new Ticket #6769 (lets2 says Uncaught RangeError: invalid language tag: "en_US").