Changeset 4567 for Serveur


Ignore:
Timestamp:
12/03/10 19:28:02 (8 years ago)
Author:
kent1
Message:

Un peu mieux

Location:
Serveur/trac/Piwik4Trac
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • Serveur/trac/Piwik4Trac/setup.cfg

    r4562 r4567  
    3030output_dir = tracext/piwik/locale
    3131domain = piwik4trac
     32
     33[extract_messages_js]
     34add_comments = TRANSLATOR:
     35copyright_holder = kent1
     36msgid_bugs_address = kent1@arscenic.org
     37output_file = tracext/piwik/locale/messages.pot
     38keywords = _ ngettext:1,2 N_
     39mapping_file = messages-js.cfg
     40
     41[init_catalog_js]
     42domain = piwik4trac
     43input_file = tracext/piwik/locale/messages.pot
     44output_dir = tracext/piwik/locale
     45
     46[compile_catalog_js]
     47directory = tracext/piwik/locale
     48domain = piwik4trac
     49
     50[update_catalog_js]
     51domain = piwik4trac
     52input_file = tracext/piwik/locale/messages.pot
     53output_dir = tracext/piwik/locale
     54
     55[generate_messages_js]
     56domain = piwik4trac
     57input_dir = tracext/piwik/locale
     58output_dir = tracext/piwik/htdocs
  • Serveur/trac/Piwik4Trac/setup.py

    r4566 r4567  
    1818if cmdclass:
    1919    extra['cmdclass'] = cmdclass
     20    extractors = [
     21        ('*.py', 'python', None),
     22        ('templates/*.html', 'genshi', None),
     23        ('templates/*.txt',  'genshi', {
     24            'template_class': 'genshi.template:TextTemplate'
     25        }),
     26    ]
    2027    extra['message_extractors'] = {
    21         'tracext.piwik': [
    22             ('*.py', 'python', None),
    23             ('templates/*.html', 'genshi', None),
    24         ],
     28        'tracext.piwik': extractors,
    2529    }     
    2630
     
    4044    package_data={'tracext.piwik': [
    4145                                    'templates/*.html',
    42                                     'htdocs/*.css'
     46                                    'htdocs/*.css','htdocs/*.js',
    4347                                    'locale/*/LC_MESSAGES/*.mo',
    4448                                    ]
  • Serveur/trac/Piwik4Trac/tracext/piwik/__init__.py

    r4564 r4567  
    2525add_domain, _, tag_ = domain_functions('piwik4trac', 'add_domain', '_', 'tag_')
    2626
    27 def __init__(self):
    28         import pkg_resources # here or with the other imports
    29         # bind the 'foo' catalog to the specified locale directory
    30         locale_dir = pkg_resources.resource_filename(__name__, 'locale')
    31         self.log.info("Added domain 'piwik4trac' -> %s",resource_filename(__name__, 'locale'))
    32         add_domain(self.env.path, locale_dir)
    33 
    3427# ==============================================================================
    3528# Piwik Configuration
    3629# ==============================================================================
    3730class PiwikConfig(Component):
     31    def __init__(self):
     32        import pkg_resources # here or with the other imports
     33        # bind the 'foo' catalog to the specified locale directory
     34        locale_dir = pkg_resources.resource_filename(__name__, 'locale')
     35        add_domain(self.env.path, locale_dir)
     36       
    3837    tracking_site = Option(
    3938        'piwik', 'tracking_site', None,
     
    7574   
    7675    def environment_needs_upgrade(self, db):
    77         self.log.debug('environment needs upgrade')
    7876        pass
    7977
  • Serveur/trac/Piwik4Trac/tracext/piwik/admin.py

    r4566 r4567  
    1111from trac.config import Option, _TRUE_VALUES
    1212from trac.core import Component, implements
    13 from trac.web.chrome import add_stylesheet
     13from trac.web.chrome import add_stylesheet,add_script
    1414from trac.util.translation import domain_functions
    1515
     
    2222   
    2323    def __init__(self):
    24         import pkg_resources
    2524        locale_dir = pkg_resources.resource_filename(__name__, 'locale')
    2625        add_domain(self.env.path, locale_dir)
    2726        self.log.info("Added domain 'piwik4trac' -> %s",
    28                       resource_filename(__name__, 'locale'))
     27                      pkg_resources.resource_filename(__name__, 'locale'))
    2928       
    3029    # IAdminPanelProvider methods
     
    3433
    3534    def render_admin_panel(self, req, cat, page, path_info):
     35        if req.locale is not None:
     36            add_script(req, 'piwik/%s.js' % req.locale)
    3637        add_stylesheet(req, 'piwik/piwik.css')
    3738        if req.method.lower() == 'post':
     
    4142                            req.args.get('tracking_server'))
    4243            self.config.save()
    43             self.options.tracking_site.description(_('Description tracking_server'))
    4444        self.update_config()
    4545        return 'piwik_admin.html', {'piwik': self.options}
  • Serveur/trac/Piwik4Trac/tracext/piwik/locale/fr/LC_MESSAGES/piwik4trac.po

    r4564 r4567  
    77msgstr ""
    88
     9msgid "Title piwik_admin"
     10msgstr "Options de Piwik"
     11
     12msgid "Label tracking_server"
     13msgstr "Serveur de statistiques :"
     14
    915msgid "Description tracking_server"
    10 msgstr "Entrez l'adresse de votre serveur Piwik ici,<br/>sans \"http://\" ni \"https://\" ni sliash final<br/>"
     16msgstr "Entrez l'adresse de votre serveur Piwik ici, sans \"http://\" ni \"https://\" ni slash final."
     17
     18msgid "Label tracked_site"
     19msgstr "Site analysé :"
     20
     21msgid "Description tracked_site"
     22msgstr "Entrez ici l'identifiant numérique du site analysé par Piwik. Cela doit être un chiffre."
    1123
    1224msgid "Option tracking_server"
  • Serveur/trac/Piwik4Trac/tracext/piwik/locale/messages.pot

    r4564 r4567  
    77msgstr ""
    88
     9msgid "Title piwik_admin"
     10msgstr "Piwik Options"
     11
     12msgid "Label tracking_server"
     13msgstr "Tracking server :"
     14
    915msgid "Description tracking_server"
    1016msgstr "Enter your Piwik's tracking server address there,<br/>without the \"http://\" or \"https://\" and without trailing slash<br/>"
     17
     18msgid "Label tracked_site"
     19msgstr "Tracked Site :"
     20
     21msgid "Description tracked_site"
     22msgstr "Enter your Piwik's tracked site ID in this box. The tracked site ID should be a digit number."
    1123
    1224msgid "Option tracking_server"
  • Serveur/trac/Piwik4Trac/tracext/piwik/templates/piwik_admin.html

    r4564 r4567  
    22    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    33    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    4 <html xmlns="http://www.w3.org/1999/xhtml"
     4<html
     5          xml:lang="$locale"
     6          xmlns="http://www.w3.org/1999/xhtml"
    57      xmlns:py="http://genshi.edgewall.org/"
    6       xmlns:xi="http://www.w3.org/2001/XInclude">
     8          xmlns:i18n="http://genshi.edgewall.org/i18n"
     9      xmlns:xi="http://www.w3.org/2001/XInclude"
     10          i18n:domain="piwik4trac">
    711  <xi:include href="admin.html" />
    812
    913  <head>
    10     <title>Piwik Options</title>
     14    <title i18n:msg="Title piwik_admin">Piwik Options</title>
    1115  </head>
    1216  <body>
     
    1418      <fieldset>
    1519        <legend>Basic Options</legend>
    16                 <label for="tracking_server">Tracking server :</label>
     20                <label for="tracking_server" i18n:msg="Label tracking_server">Tracking server :</label>
    1721                <input type="text" name="tracking_server" value="${piwik.tracking_server.value}" />
    18                 <p class="help">${piwik.tracking_site.description}</p>
     22                <p class="help" i18n:msg="Description tracking_server">Description tracking_server</p>
    1923               
    20         <label for="tracking_site">Tracked Site:</label>
     24        <label for="tracking_site" i18n:msg="Label tracked_site">Tracked Site :</label>
    2125        <input type="text" name="tracking_site" value="${piwik.tracking_site.value}"/>
    22         <p class="help">Enter your Piwik's tracked site ID in this box.<br/>
     26        <p class="help" i18n:msg="Description tracked_site">Enter your Piwik's tracked site ID in this box.<br/>
    2327          The tracked site ID should be a digit number.<br/>
    2428        </p><br/>
Note: See TracChangeset for help on using the changeset viewer.