Modify ↓
#11921 closed defect (fixed)
"Default language" is selected on Localization preferences panel even when language has been set
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.4 |
Component: | general | Version: | |
Severity: | normal | Keywords: | preferences |
Cc: | Branch: | ||
Release Notes: |
Fixed regression in [13323]: Default language was always selected even when a language had been set. |
||
API Changes: | |||
Internal Changes: |
Description (last modified by )
This is a regression from #11813 / [13323]. The Default language is always selected on the Localization preferences panel even when a language has been set. The following will fix the issue:
-
trac/prefs/templates/prefs_localization.html
diff --git a/trac/prefs/templates/prefs_localization.html b/trac/prefs/templates/prefs_localization.html index 6d54749..43b0c8a 100644
a b 27 27 <tr class="field"> 28 28 <th><label for="language">Language:</label></th> 29 29 <td> 30 <select id="language" name="language" disabled="${'disabled' if not languages else None}" 30 <select py:with="session_language = settings.session.get('language', '').replace('-', '_')" 31 id="language" name="language" disabled="${'disabled' if not languages else None}" 31 32 title="${_('Translations are currently unavailable') if not languages else None}"> 32 33 <option value="">Default language</option> 33 34 <option py:for="locale, language in languages"
Attachments (0)
Change History (4)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Status: | new → assigned |
comment:2 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:3 by , 10 years ago
Test failure is:
====================================================================== FAIL: Test for regression of http://trac.edgewall.org/ticket/11515 ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/travis/build/edgewall/trac/trac/prefs/tests/functional.py", line 202, in runTest % (second_locale_id, second_locale)) File "/home/travis/build/edgewall/trac/trac/tests/functional/better_twill.py", line 229, in better_find (to_unicode(e), filename)) TwillAssertionError: no match to '<option selected="selected" value="zh_TW">\u4e2d\u6587 (\u7e41\u9ad4\u4e2d\u6587, \u53f0\u7063)</option>' at file:///home/travis/build/edgewall/trac/testenv/trac/log/RegressionTestTicket11515.html
I'm unsure how to interpolate the string to get
'<option selected="selected" value="zh_TW">中文 (台湾)</option>'
rather than
'<option selected="selected" value="zh_TW">\u4e2d\u6587 (\u7e41\u9ad4\u4e2d\u6587,\u53f0\u7063)</option>'
Calling print
outputs characters rather than escape sequences:
>>> Locale.parse('zh_TW').display_name u'\u4e2d\u6587 (\u53f0\u6e7e)' >>> print Locale.parse('zh_TW').display_name 中文 (台湾)
comment:4 by , 10 years ago
Fixed failing test in [13668] by removing test for the unicode characters.
Note:
See TracTickets
for help on using tickets.
Fixed in [13667].