Django

Code

Changeset 801

Show
Ignore:
Timestamp:
10/07/05 19:01:25 (3 years ago)
Author:
hugo
Message:

i18n: again cleaned up make-messages.py - now the line numbers for templates will be correct.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/i18n/django/bin/make-messages.py

    r799 r801  
    3838    os.makedirs(basedir) 
    3939 
    40 tpl_i18n_re = re.compile(r'{%\s+i18n\s+.*?%}') 
    41 tpl_value_re = re.compile(r'{{\s*_\(.*?\)\s*}}') 
    42 tpl_tag_re = re.compile(r"""{%.*_\((?:".*?")|(?:'.*?')\).*%}""") 
     40dot_re = re.compile('\S') 
     41def blank(src): 
     42    return dot_re.sub('p', src) 
     43 
     44def templateize(src): 
     45    o = [] 
     46    going = 1 
     47    while going: 
     48        start = src.find('{') 
     49        if start >= 0 and src[start+1] in ('{', '%'): 
     50            o.append(blank(src[:start])) 
     51            end = src.find(src[start+1] == '{' and '}' or '%', start) 
     52            if end >= 0: 
     53                o.append(src[start:end+2]) 
     54                src = src[end+2:] 
     55            else: 
     56                o.append(blank(src[start:])) 
     57                going = 0 
     58        else: 
     59            o.append(blank(src)) 
     60            going = 0 
     61    return ''.join(o) 
    4362 
    4463pofile = os.path.join(basedir, '%s.po' % domain) 
     
    5473            if file.endswith('.html'): 
    5574                src = open(os.path.join(dirpath, file), "rb").read() 
    56                 lst = [] 
    57                 for match in tpl_i18n_re.findall(src): 
    58                    lst.append(match) 
    59                 for match in tpl_value_re.findall(src): 
    60                    lst.append(match) 
    61                 for match in tpl_tag_re.findall(src): 
    62                    lst.append(match) 
    63                 open(os.path.join(dirpath, '%s.py' % file), "wb").write('\n'.join(lst)) 
     75                open(os.path.join(dirpath, '%s.py' % file), "wb").write(templateize(src)) 
    6476                thefile = '%s.py' % file 
    6577            if verbose: sys.stdout.write('processing file %s in %s\n' % (file, dirpath)) 
     
    6779                os.path.exists(potfile) and '--omit-header' or '', domain, os.path.join(dirpath, thefile)) 
    6880            msgs = os.popen(cmd, 'r').read() 
     81            if thefile != file: 
     82                old = '#: '+os.path.join(dirpath, thefile)[2:] 
     83                new = '#: '+os.path.join(dirpath, file)[2:] 
     84                msgs = msgs.replace(old, new) 
    6985            if msgs: 
    7086                open(potfile, 'ab').write(msgs) 
  • django/branches/i18n/django/conf/locale/de/LC_MESSAGES/django.po

    r798 r801  
    99"Project-Id-Version: Django 1.0\n" 
    1010"Report-Msgid-Bugs-To: \n" 
    11 "POT-Creation-Date: 2005-10-08 00:07+0200\n" 
     11"POT-Creation-Date: 2005-10-08 00:51+0200\n" 
    1212"PO-Revision-Date: 2005-10-08 00:03+0200\n" 
    1313"Last-Translator: Georg Bauer <gb@bofh.ms>\n" 
     
    1616"Content-Transfer-Encoding: 8bit\n" 
    1717 
    18 #: conf/admin_templates/admin_object_history.html.py:1 
    19 #: conf/admin_templates/base.html.py:4 
    20 #: conf/admin_templates/registration/password_change_done.html.py:1 
    21 #: conf/admin_templates/registration/password_reset_form.html.py:1 
    22 #: conf/admin_templates/registration/logged_out.html.py:1 
    23 #: conf/admin_templates/registration/password_reset_done.html.py:1 
    24 #: conf/admin_templates/registration/password_change_form.html.py:1 
     18#: conf/admin_templates/admin_object_history.html:4 
     19#: conf/admin_templates/base.html:28 
     20#: conf/admin_templates/registration/password_change_done.html:3 
     21#: conf/admin_templates/registration/password_reset_form.html:3 
     22#: conf/admin_templates/registration/logged_out.html:3 
     23#: conf/admin_templates/registration/password_reset_done.html:3 
     24#: conf/admin_templates/registration/password_change_form.html:3 
    2525msgid "Home" 
    2626msgstr "Start" 
    2727 
    28 #: conf/admin_templates/admin_object_history.html.py:2 
     28#: conf/admin_templates/admin_object_history.html:4 
    2929msgid "History" 
    3030msgstr "Geschichte" 
    3131 
    32 #: conf/admin_templates/admin_object_history.html.py:3 
     32#: conf/admin_templates/admin_object_history.html:17 
    3333msgid "Date/time" 
    3434msgstr "Datum/Zeit" 
    3535 
    36 #: conf/admin_templates/admin_object_history.html.py:4 
     36#: conf/admin_templates/admin_object_history.html:18 
    3737msgid "User" 
    3838msgstr "Benutzer" 
    3939 
    40 #: conf/admin_templates/admin_object_history.html.py:5 
     40#: conf/admin_templates/admin_object_history.html:19 
    4141msgid "Action" 
    4242msgstr "Aktion" 
    4343 
    44 #: conf/admin_templates/admin_object_history.html.py:6 
     44#: conf/admin_templates/admin_object_history.html:35 
    4545msgid "" 
    4646"This object doesn't have a change history. It probably wasn't added via this " 
     
    5050"�iese Verwaltungsseiten angelegt." 
    5151 
    52 #: conf/admin_templates/changelist_generic.html.py:1 
    53 #: conf/admin_templates/index.html.py:1 
     52#: conf/admin_templates/changelist_generic.html:8 
     53#: conf/admin_templates/index.html:26 
    5454msgid "Add" 
    5555msgstr "Zuf� 
    56 #: conf/admin_templates/changelist_generic.html.py:2 
     56#: conf/admin_templates/changelist_generic.html:26 
    5757msgid "Click to change" 
    5858msgstr "Zur �derung klicken" 
    5959 
    60 #: conf/admin_templates/base_site.html.py:1 
     60#: conf/admin_templates/base_site.html:3 
    6161msgid "Django site admin" 
    6262msgstr "Django Systemverwaltung" 
    6363 
    64 #: conf/admin_templates/base_site.html.py:2 
     64#: conf/admin_templates/base_site.html:6 
    6565msgid "Django administration" 
    6666msgstr "Django Verwaltung" 
    6767 
    68 #: conf/admin_templates/index.html.py:
     68#: conf/admin_templates/index.html:3
    6969msgid "Change" 
    7070msgstr "�dern" 
    7171 
    72 #: conf/admin_templates/index.html.py:3 
     72#: conf/admin_templates/index.html:42 
    7373msgid "You don't have permission to edit anything." 
    7474msgstr "Sie haben keine Berechtigung irgendwas zu �ern." 
    7575 
    76 #: conf/admin_templates/index.html.py:4 
     76#: conf/admin_templates/index.html:50 
    7777msgid "Recent Actions" 
    7878msgstr "K�he Aktionen" 
    7979 
    80 #: conf/admin_templates/index.html.py:5 
     80#: conf/admin_templates/index.html:51 
    8181msgid "My Actions" 
    8282msgstr "Meine Aktionen" 
    8383 
    84 #: conf/admin_templates/index.html.py:6 
     84#: conf/admin_templates/index.html:55 
    8585msgid "None available" 
    8686msgstr "Keine vorhanden" 
    8787 
    88 #: conf/admin_templates/500.html.py:1 
     88#: conf/admin_templates/500.html:5 
    8989msgid "Server error (500)" 
    9090msgstr "Serverfehler (500)" 
    9191 
    92 #: conf/admin_templates/500.html.py:2 
     92#: conf/admin_templates/500.html:8 
    9393msgid "Server Error <em>(500)</em>" 
    9494msgstr "Serverfehler <em>(500)</em>" 
    9595 
    96 #: conf/admin_templates/500.html.py:3 
     96#: conf/admin_templates/500.html:9 
    9797msgid "" 
    9898"There's been an error. It's been reported to the site administrators via e-" 
     
    103103"Verst�nis." 
    104104 
    105 #: conf/admin_templates/404.html.py:1 conf/admin_templates/404.html.py:2 
     105#: conf/admin_templates/404.html:3 conf/admin_templates/404.html.py:7 
    106106msgid "Page not found" 
    107107msgstr "Seite nicht gefunden" 
    108108 
    109 #: conf/admin_templates/404.html.py:3 
     109#: conf/admin_templates/404.html:9 
    110110msgid "We're sorry, but the requested page could not be found." 
    111111msgstr "" 
    112112"Es tut uns leid, aber die angeforderte Seite kann nicht gefunden werden." 
    113113 
    114 #: conf/admin_templates/delete_confirmation_generic.html.py:1 
     114#: conf/admin_templates/delete_confirmation_generic.html:6 
    115115#, python-format 
    116116msgid "" 
     
    123123"folgenden abh�igen Daten zu l�en:" 
    124124 
    125 #: conf/admin_templates/delete_confirmation_generic.html.py:2 
     125#: conf/admin_templates/delete_confirmation_generic.html:13 
    126126#, python-format 
    127127msgid "" 
     
    132132"werden zus�lich die folgenden abh�igen Daten mit gel�t:" 
    133133 
    134 #: conf/admin_templates/delete_confirmation_generic.html.py:3 
     134#: conf/admin_templates/delete_confirmation_generic.html:17 
    135135msgid "Yes, I'm sure" 
    136136msgstr "Ja, ich bin sicher" 
    137137 
    138 #: conf/admin_templates/login.html.py:1 
     138#: conf/admin_templates/login.html:14 
    139139msgid "Username:" 
    140140msgstr "Benutzername:" 
    141141 
    142 #: conf/admin_templates/login.html.py:2 
     142#: conf/admin_templates/login.html:17 
    143143msgid "Password:" 
    144144msgstr "Passwort:" 
    145145 
    146 #: conf/admin_templates/login.html.py:3 
     146#: conf/admin_templates/login.html:19 
    147147msgid "Have you <a href=\"/password_reset/\">forgotten your password</a>?" 
    148148msgstr "Haben Sie <a href=\"/password_reset/\">ihr Passwort vergessen</a>?" 
    149149 
    150 #: conf/admin_templates/login.html.py:4 
     150#: conf/admin_templates/login.html:23 
    151151msgid "Log in" 
    152152msgstr "Anmelden" 
    153153 
    154 #: conf/admin_templates/base.html.py:1 
     154#: conf/admin_templates/base.html:22 
    155155msgid "Welcome," 
    156156msgstr "Willkommen," 
    157157 
    158 #: conf/admin_templates/base.html.py:2 conf/admin_templates/base.html.py:5 
     158#: conf/admin_templates/base.html:22 
    159159msgid "Change password" 
    160160msgstr "Passwort �ern" 
    161161 
    162 #: conf/admin_templates/base.html.py:3 conf/admin_templates/base.html.py:5 
     162#: conf/admin_templates/base.html:22 
    163163msgid "Log out" 
    164164msgstr "Abmelden" 
    165165 
    166 #: conf/admin_templates/registration/password_change_done.html.py:2 
    167 #: conf/admin_templates/registration/password_change_done.html.py:6 
    168 #: conf/admin_templates/registration/password_change_form.html.py:2 
    169 #: conf/admin_templates/registration/password_change_form.html.py:3 
    170 #: conf/admin_templates/registration/password_change_form.html.py:4 
    171 #: conf/admin_templates/registration/password_change_form.html.py:10 
     166#: conf/admin_templates/registration/password_change_done.html:3 
     167#: conf/admin_templates/registration/password_change_form.html:3 
     168#: conf/admin_templates/registration/password_change_form.html:5 
     169#: conf/admin_templates/registration/password_change_form.html:9 
    172170msgid "Password change" 
    173171msgstr "Kennwort �ern" 
    174172 
    175 #: conf/admin_templates/registration/password_change_done.html.py:3 
    176 #: conf/admin_templates/registration/password_change_done.html.py:4 
     173#: conf/admin_templates/registration/password_change_done.html:5 
     174#: conf/admin_templates/registration/password_change_done.html:9 
    177175msgid "Password change successful" 
    178176msgstr "Erfolgreiche Kennwort�erung" 
    179177 
    180 #: conf/admin_templates/registration/password_change_done.html.py:5 
     178#: conf/admin_templates/registration/password_change_done.html:11 
    181179msgid "Your password was changed." 
    182180msgstr "Ihr Kennwort wurde ge�ert." 
    183181 
    184 #: conf/admin_templates/registration/password_reset_form.html.py:2 
    185 #: conf/admin_templates/registration/password_reset_form.html.py:3 
    186 #: conf/admin_templates/registration/password_reset_form.html.py:4 
    187 #: conf/admin_templates/registration/password_reset_form.html.py:8 
    188 #: conf/admin_templates/registration/password_reset_form.html.py:9 
    189 #: conf/admin_templates/registration/password_reset_done.html.py:2 
    190 #: conf/admin_templates/registration/password_reset_done.html.py:6 
     182#: conf/admin_templates/registration/password_reset_form.html:3 
     183#: conf/admin_templates/registration/password_reset_form.html:5 
     184#: conf/admin_templates/registration/password_reset_form.html:9 
     185#: conf/admin_templates/registration/password_reset_done.html:3 
    191186msgid "Password reset" 
    192187msgstr "Kennwort zur�zen" 
    193188 
    194 #: conf/admin_templates/registration/password_reset_form.html.py:5 
     189#: conf/admin_templates/registration/password_reset_form.html:11 
    195190msgid "" 
    196191"Forgotten your password? Enter your e-mail address below, and we'll reset " 
     
    201196"Sie raus." 
    202197 
    203 #: conf/admin_templates/registration/password_reset_form.html.py:6 
     198#: conf/admin_templates/registration/password_reset_form.html:15 
    204199msgid "E-mail address:" 
    205200msgstr "eMail-Adresse:" 
    206201 
    207 #: conf/admin_templates/registration/password_reset_form.html.py:7 
     202#: conf/admin_templates/registration/password_reset_form.html:15 
    208203msgid "Reset my password" 
    209204msgstr "Mein Kennwort zur�zen" 
    210205 
    211 #: conf/admin_templates/registration/logged_out.html.py:2 
     206#: conf/admin_templates/registration/logged_out.html:7 
    212207msgid "Thanks for spending some quality time with the Web site today." 
    213208msgstr "Danke, dass Sie eine Weile bei uns waren." 
    214209 
    215 #: conf/admin_templates/registration/logged_out.html.py:3 
     210#: conf/admin_templates/registration/logged_out.html:9 
    216211msgid "Log in again" 
    217212msgstr "Neu anmelden" 
    218213 
    219 #: conf/admin_templates/registration/password_reset_done.html.py:3 
    220 #: conf/admin_templates/registration/password_reset_done.html.py:4 
     214#: conf/admin_templates/registration/password_reset_done.html:5 
     215#: conf/admin_templates/registration/password_reset_done.html:9 
    221216msgid "Password reset successful" 
    222217msgstr "Erfolgreich Kennwort zur�etzt" 
    223218 
    224 #: conf/admin_templates/registration/password_reset_done.html.py:5 
     219#: conf/admin_templates/registration/password_reset_done.html:11 
    225220msgid "" 
    226221"We've e-mailed a new password to the e-mail address you submitted. You " 
     
    230225"Sie uns gegeben haben. Es sollte in K�nkommen." 
    231226 
    232 #: conf/admin_templates/registration/password_change_form.html.py:5 
     227#: conf/admin_templates/registration/password_change_form.html:11 
    233228msgid "" 
    234229"Please enter your old password, for security's sake, and then enter your new " 
     
    239234"neue Kennwort ein." 
    240235 
    241 #: conf/admin_templates/registration/password_change_form.html.py:
     236#: conf/admin_templates/registration/password_change_form.html:1
    242237msgid "Old password:" 
    243238msgstr "altes Kennwort:" 
    244239 
    245 #: conf/admin_templates/registration/password_change_form.html.py:7 
     240#: conf/admin_templates/registration/password_change_form.html:18 
    246241msgid "New password:" 
    247242msgstr "neues Kennwort:" 
    248243 
    249 #: conf/admin_templates/registration/password_change_form.html.py:8 
     244#: conf/admin_templates/registration/password_change_form.html:20 
    250245msgid "Confirm password:" 
    251246msgstr "Kennwortwiederholung:" 
    252247 
    253 #: conf/admin_templates/registration/password_change_form.html.py:9 
     248#: conf/admin_templates/registration/password_change_form.html:22 
    254249msgid "Change my password" 
    255250msgstr "Mein Kennwort �ern" 
    256251 
    257 #: conf/admin_templates/registration/password_reset_email.html.py:1 
     252#: conf/admin_templates/registration/password_reset_email.html:1 
    258253msgid "You're receiving this e-mail because you requested a password reset" 
    259254msgstr "Sie erhalten diese Mail, weil Sie ein neues Kennwort" 
    260255 
    261 #: conf/admin_templates/registration/password_reset_email.html.py:2 
     256#: conf/admin_templates/registration/password_reset_email.html:2 
    262257#, python-format 
    263258msgid "for your user account at %(site_name)s" 
    264259msgstr "f�en Benutzer bei %(site_name)s angefordert haben." 
    265260 
    266 #: conf/admin_templates/registration/password_reset_email.html.py:3 
     261#: conf/admin_templates/registration/password_reset_email.html:4 
    267262#, python-format 
    268263msgid "Your new password is: %(new_password)s" 
    269264msgstr "Ihr neues Kennwort ist: %(new_password)s" 
    270265 
    271 #: conf/admin_templates/registration/password_reset_email.html.py:4 
     266#: conf/admin_templates/registration/password_reset_email.html:6 
    272267msgid "Feel free to change this password by going to this page:" 
    273268msgstr "Sie k�n das Kennwort auf folgender Seite �ern:" 
    274269 
    275 #: conf/admin_templates/registration/password_reset_email.html.py:5 
     270#: conf/admin_templates/registration/password_reset_email.html:10 
    276271msgid "Your username, in case you've forgotten:" 
    277272msgstr "Ihr Benutzername, falls Sie ihn vergessen haben:" 
    278273 
    279 #: conf/admin_templates/registration/password_reset_email.html.py:6 
     274#: conf/admin_templates/registration/password_reset_email.html:12 
    280275msgid "Thanks for using our site!" 
    281276msgstr "Vielen Dank, das Sie unsere Seiten benutzen!" 
    282277 
    283 #: conf/admin_templates/registration/password_reset_email.html.py:7 
     278#: conf/admin_templates/registration/password_reset_email.html:14 
    284279#, python-format 
    285280msgid "The %(site_name)s team"