Edgewall Software

Ticket #9439: no-Babel-prefs-language.patch

File no-Babel-prefs-language.patch, 2.3 KB (added by cboos, 20 months ago)

Add more information in the Language preference panel.

  • trac/prefs/templates/prefs_language.html

    # HG changeset patch
    # Parent f930f56e51638d2b4a2f3d4a273da419834f39f0
    0.12.2dev: apologies for no translations being available, in the //Language// preference panel.
    
    diff -r f930f56e5163 trac/prefs/templates/prefs_language.html
    a b  
    1010  </head> 
    1111  <body> 
    1212 
    13     <div class="field" py:with="session_language = settings.session.get('language')"> 
    14       <label>Language: 
    15       <select name="language"> 
     13    <div class="field" 
     14         py:with="session_language = settings.session.get('language')"> 
     15      <label for="language">Language:</label> 
     16      <select id="language" name="language"> 
    1617        <option value="">default language</option> 
    1718        <option py:for="locale, language in languages" 
    1819                selected="${session_language == locale or None}" 
    1920                value="$locale">$language</option> 
    20       </select></label> 
    21       <p class="hint">Configuring your language will result in all text 
    22       displayed on this site to use your language instead of that of the 
    23       server.</p> 
    24  
    25       <p class="hint">The 'default language' option uses the browser's 
    26         language negotiation feature to select the appropriate language.</p> 
     21      </select> 
     22      <py:choose> 
     23        <py:when test="languages"> 
     24          <p class="hint" py:choose=""> 
     25            Configuring your language will result in all text 
     26            displayed on this site to use your language instead of 
     27            that of the server. 
     28          </p> 
     29          <p class="hint"> 
     30            The 'default language' option uses the browser's language 
     31            negotiation feature to select the appropriate language. 
     32          </p> 
     33        </py:when> 
     34        <py:otherwise> 
     35          <p class="hint"> 
     36            We're sorry, but no translations are available.  Trac has 
     37            localized to more than a dozen of languages but in order 
     38            to be able to use them, the 
     39            <a href="http://babel.edgewall.org">Babel</a> package needs to be 
     40            present at installation time. See 
     41            <a href="${href.wiki('TracInstall')}">TracInstall</a> 
     42            for details. 
     43          </p> 
     44        </py:otherwise> 
     45      </py:choose> 
    2746    </div> 
    2847 
    2948  </body>