Changeset 1101


Ignore:
Timestamp:
2012-08-01T10:00:21+02:00 (2 years ago)
Author:
moo
Message:

devel: use gettext to scan translate string

Location:
trunk
Files:
11 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/devel/prepare.mak

    r1095 r1101  
    66.PHONY: dummy 
    77.PHONY: all 
    8 all: xcache/xc_opcode_spec_def.h xc_const_string tags 
     8all: xcache/xc_opcode_spec_def.h xc_const_string tags po 
    99 
    1010.PHONY: clean 
    11 clean: clean_xc_const_string 
     11clean: clean_xc_const_string clean_po 
    1212    rm -f tags xcache/xc_opcode_spec_def.h 
    1313 
     
    9797    "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard" 
    9898endif 
     99 
     100.PHONY: po 
     101define htdocspo 
     102  po: \ 
     103    htdocs/$(1)/lang/en.po \ 
     104    htdocs/$(1)/lang/en.po-merged \ 
     105    htdocs/$(1)/lang/zh-simplified.po-merged \ 
     106    htdocs/$(1)/lang/zh-simplified.po \ 
     107    htdocs/$(1)/lang/zh-traditional.po \ 
     108    htdocs/$(1)/lang/zh-traditional.po-merged 
     109 
     110  htdocs/$(1)/lang/%.po-merged: htdocs/$(1)/lang/%.po htdocs/$(1)/lang/$(1).pot 
     111    msgmerge -o "$$@".tmp $$^ 
     112    mv "$$@".tmp "$$@" 
     113 
     114  htdocs/$(1)/lang/%.po: 
     115    touch "$$@" 
     116 
     117  htdocs/$(1)/lang/$(1).pot: 
     118    xgettext --keyword=_T --keyword=N_ --from-code=UTF-8 -F -D htdocs/$(1)/ $$(subst htdocs/$(1)/,,$$^) -o "$$@".tmp 
     119    mv "$$@".tmp "$$@" 
     120 
     121  htdocs/$(1)/lang/$(1).pot: $(shell find htdocs/$(1) -type f | grep php | grep -v lang | grep -v config) 
     122 
     123endef 
     124 
     125$(eval $(call htdocspo,cacher)) 
     126$(eval $(call htdocspo,common)) 
     127$(eval $(call htdocspo,coverager)) 
     128$(eval $(call htdocspo,diagnosis)) 
     129 
     130.PHONY: clean_po 
     131clean_po: clean_pot 
     132    rm -f htdocs/*/lang/*.po-merged 
     133 
     134.PHONY: clean_pot 
     135clean_pot: 
     136    rm -f htdocs/*/lang/*.pot 
  • trunk/devel/run

    r1098 r1101  
    1616prep*) 
    1717    exec $MAKE -f devel/prepare.mak "${args[@]}" 
     18    ;; 
     19*langphp) 
     20    find htdocs -iname '*.po' | while read -r i; do 
     21        echo updateing $i 
     22        devel/updatelangphp.awk < $i 
     23    done 
     24    exit 
     25    ;; 
     26mergepo) 
     27    ./run prep 
     28    find htdocs -iname '*.po' | while read -r i; do 
     29        if [[ -f $i-merged ]]; then 
     30            mv $i-merged $i 
     31        fi 
     32    done 
     33    exit 
    1834    ;; 
    1935tags) 
  • trunk/htdocs/cacher/index.php

    r1099 r1101  
    228228    $entryList = array('cache_list' => array(), 'deleted_list' => array()); 
    229229    if ($_GET['do'] == 'listphp') { 
    230         $entryList['type_name'] = 'php'; 
    231230        $entryList['type'] = XC_TYPE_PHP; 
    232231    } 
    233232    else { 
    234         $entryList['type_name'] = 'var'; 
    235233        $entryList['type'] = XC_TYPE_VAR; 
    236234    } 
  • trunk/htdocs/cacher/listentries.tpl.php

    r1078 r1101  
    44<?php 
    55$entryList = getEntryList(); 
    6 $isphp = $entryList['type'] == 'listphp'; 
    7 $typeName = $entryList['type_name']; 
     6$isphp = $entryList['type'] == XC_TYPE_PHP; 
    87ob_start($config['path_nicer']); 
    98 
    109$listName = 'Cached'; 
    1110$entries = $entryList['cache_list']; 
     11$caption = $isphp ? _T("php Cached") : _T("var Cached"); 
    1212include "./sub/entrylist.tpl.php"; 
    1313 
    1414$listName = 'Deleted'; 
     15$caption = $isphp ? _T("php Deleted") : _T("var Deleted"); 
    1516$entries = $entryList['deleted_list']; 
    1617include "./sub/entrylist.tpl.php"; 
  • trunk/htdocs/cacher/sub/entrylist.tpl.php

    r1086 r1101  
    22<form action="" method="post"> 
    33    <table cellspacing="0" cellpadding="4" class="cycles entries"> 
    4         <caption><?php echo _T("$typeName $listName"); ?></caption> 
     4        <caption><?php echo $caption; ?></caption> 
    55<?php 
    66 
     
    1212if ($isphp) { 
    1313    echo 
    14         th("entry.id") 
     14        th(N_("entry.id")) 
    1515        ; 
    1616} 
    1717else { 
    1818    echo 
    19         th("entry.remove") 
     19        th(N_("entry.remove")) 
    2020        ; 
    2121} 
  • trunk/htdocs/cacher/sub/summary.tpl.php

    r1100 r1101  
    132132    <div class="legendtitle"><?php echo _T('Legends:'); ?></div> 
    133133    <div class="legend pvalue">&nbsp;&nbsp;</div> 
    134     <div class="legendtitle"><?php echo _T($config['percent_graph_type'] == 'free' ? '% Free' : '% Used'); ?></div> 
     134    <div class="legendtitle"><?php echo $config['percent_graph_type'] == 'free' ? _T('% Free') : _T('% Used'); ?></div> 
    135135    <div class="legend" style="background: rgb(0,0,255)">&nbsp;&nbsp;</div> 
    136     <div class="legendtitle"><?php echo _T($config['percent_graph_type'] == 'free' ? 'Free Blocks' : 'Used Blocks'); ?></div> 
     136    <div class="legendtitle"><?php echo $config['percent_graph_type'] == 'free' ? _T('Free Blocks') : _T('Used Blocks'); ?></div> 
    137137    <div class="legend" style="background: rgb(255,0,0)">&nbsp;&nbsp;</div> 
    138138    <div class="legendtitle"><?php echo _T('Hits'); ?></div> 
  • trunk/htdocs/coverager/lang/en.php

    r1099 r1101  
    11<?php 
    22 
    3 $GLOBALS['show_todo_strings'] = false; 
    4  
    53?> 
Note: See TracChangeset for help on using the changeset viewer.