Ignore:
Timestamp:
Apr 5, 2012 10:24:27 AM (12 years ago)
Author:
enkidu
Message:

add French localization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.analytics/trunk/quintagroup/analytics/browser/views.py

    r3171 r3407  
    1818 
    1919from GChartWrapper import VerticalBarStack 
    20  
    2120from quintagroup.analytics.config import COLORS, OTHER_TYPES, NO_WF_BIND 
    22  
    23  
    24 class OwnershipByType(BrowserView): 
     21from quintagroup.analytics import QuintagroupAnalyticsMessageFactory as _ 
     22 
     23MENUEITEMS = [{'href':'qa_overview',         'content':_('Overview')}, 
     24              {'href':'ownership_by_type',   'content':_('Ownership by type')}, 
     25              {'href':'ownership_by_state',  'content':_('Ownership by state')}, 
     26              {'href':'type_by_state',       'content':_('Types by state')}, 
     27              {'href':'portlets_stats',      'content':_('Portlets stats')}, 
     28              {'href':'legacy_portlets',     'content':_('Legacy portlets')}, 
     29              {'href':'properties_stats',    'content':_('Properties stats')},] 
     30 
     31class AnalyticsBaseView(BrowserView): 
     32    def analiticsNavigation(self): 
     33        return MENUEITEMS 
     34 
     35 
     36class OwnershipByType(AnalyticsBaseView): 
    2537    MAX = 10 
    26  
    2738    def __init__(self, context, request): 
    2839        self.context = context 
     
    97108        chart = VerticalBarStack(data, encoding='text') 
    98109        types = other and types + OTHER_TYPES or types 
    99         chart.title('Content ownership by type').legend(*(types)) 
     110        chart.title(_('Content ownership by type')).legend(*(types)) 
    100111        chart.bar('a', 10, 0).legend_pos("b") 
    101112        chart.color(*COLORS) 
     
    106117 
    107118 
    108 class OwnershipByState(BrowserView): 
     119class OwnershipByState(AnalyticsBaseView): 
    109120    MAX = 10 
    110121 
     
    189200        max_value = max(self.getTotal()) 
    190201        chart = VerticalBarStack(data, encoding='text') 
    191         title = 'Content ownership by state' 
     202        title = _('Content ownership by state') 
    192203        chart.title(title).legend(*self.states + [NO_WF_BIND]) 
    193204        chart.bar('a', 10, 0).legend_pos("b") 
     
    199210 
    200211 
    201 class TypeByState(BrowserView): 
     212class TypeByState(AnalyticsBaseView): 
    202213    MAX = 10 
    203214 
     
    281292        max_value = max(self.getTotal()) 
    282293        chart = VerticalBarStack(data, encoding='text') 
    283         chart.title('Content type by state').legend( 
     294        chart.title(_('Content type by state')).legend( 
    284295            *self.states + [NO_WF_BIND]) 
    285296        chart.bar('a', 10, 0).legend_pos("b") 
     
    291302 
    292303 
    293 class LegacyPortlets(BrowserView): 
     304class LegacyPortlets(AnalyticsBaseView): 
    294305    def __init__(self, context, request): 
    295306        self.context = context 
     
    358369 
    359370 
    360 class PropertiesStats(BrowserView): 
     371class PropertiesStats(AnalyticsBaseView): 
    361372    def __init__(self, context, request): 
    362373        self.context = context 
     
    427438 
    428439 
    429 class PortletsStats(BrowserView): 
     440class PortletsStats(AnalyticsBaseView): 
    430441    def __init__(self, context, request): 
    431442        self.context = context 
Note: See TracChangeset for help on using the changeset viewer.