Daniel and I just tracked down this issue. There were translations that
should have had the placeholder {user_name} but instead had {username}. The
error is because the code was trying to format the string, but there was no
value provided for {username}. The KeyError is format's very unhelpful
error message saying that it couldn't format the message because the
placeholder with the given name was missing.I've created a localization FAQ and described this problem and the solution here: https://openedx.atlassian.net/wiki/display/LOC/Localization+FAQ#LocalizationFAQ-I'mseeingaKeyErrorwhenusingmylocaltranslations - Andy On Tue, Jan 3, 2017 at 3:55 PM, Bryan Wilson (Appsembler) < [email protected]> wrote: > The Python string formatting code in > lms/djangoapps/certificates/view/webview.py > do not use unicode and will break when encountering non-ASCII text, for > example, in a user's name or in a course name, or even the platform name. > I have fixed these errors for one of our customer's sites and am working on > filing an issue/fix. I'll repost here when I have done that. > > > > On Saturday, December 31, 2016 at 6:21:19 AM UTC-8, Olga Filipova wrote: >> >> I got the same error when using non-english language, with english >> everything is perfect. Have you figured out the problem? >> >> On Saturday, November 5, 2016 at 3:01:26 PM UTC, Daniel wrote: >>> >>> Nov 5 16:59:39 ubuntu [service_variant=lms][util.views][env:sandbox] >>> ERROR [ubuntu 14460] [views.py:114] - Error in django view. >>> Traceback (most recent call last): >>> File "/edx/app/edxapp/edx-platform/common/djangoapps/util/views.py", >>> line 105, in inner >>> return func(request, *args, **kwargs) >>> File >>> "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/views/webview.py", >>> line 568, in render_html_view >>> _update_context_with_user_info(context, user, user_certificate) >>> File >>> "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/views/webview.py", >>> line 306, in _update_context_with_user_info >>> user_name=user_fullname >>> KeyError: u'username' >>> >>> Please help)) >>> >> -- > You received this message because you are subscribed to the Google Groups > "General Open edX discussion" group. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/edx-code/d258ade1-e64e-4135-a749-0568d86eef16%40googlegroups.com > <https://groups.google.com/d/msgid/edx-code/d258ade1-e64e-4135-a749-0568d86eef16%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- *Andy Armstrong* edX | UI Architect | [email protected] 141 Portland Street, 9th floor Cambridge, MA 02139 http://www.edx.org <http://www.edxonline.org/> [image: http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566] -- You received this message because you are subscribed to the Google Groups "General Open edX discussion" group. To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/CAG2ZmnDu8iynkU4a8qgqSyDPcdWtM9cFv03%2BStvMyViAd-FcLQ%40mail.gmail.com.
