Ignore:
Timestamp:
06/22/13 23:27:26 (6 years ago)
Author:
mistic100
Message:

improve display, fix detection problem with "translate" without @

Location:
extensions/plugin_lang_analysis
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/plugin_lang_analysis

    • Property svn:ignore set to
      _data
  • extensions/plugin_lang_analysis/include/functions.inc.php

    r23421 r23449  
    6464  { 
    6565    // l10n 
    66     if (preg_match_all('#l10n\((?:[ ]*)(?:["\']{1})(.*?)(?:["\']{1})(?:[ ]*)\)#', $line, $matches)) 
     66    if (preg_match_all('#l10n\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})(?:\s*)\)#', $line, $matches)) 
    6767    { 
    6868      for ($j=0; $j<count($matches[1]); ++$j) 
     
    7272    } 
    7373    // translate 
    74     if (preg_match_all('#\{(?:["\']{1})(.*?)(?:["\']{1})\|\@translate#', $line, $matches)) 
     74    if (preg_match_all('#\{(?:["\']{1})(.*?)(?:["\']{1})\|(?:@{0,1})translate#', $line, $matches)) 
    7575    { 
    7676      for ($j=0; $j<count($matches[1]); ++$j) 
     
    8080    } 
    8181    // l10n_dec on one line 
    82     if (preg_match_all('#l10n_dec\((?:[ ]*)(?:["\']{1})(.*?)(?:["\']{1})(?:[ ]*),(?:[ ]*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
     82    if (preg_match_all('#l10n_dec\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})(?:\s*),(?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $line, $matches)) 
    8383    { 
    8484      for ($j=0; $j<count($matches[1]); ++$j) 
     
    9898      } 
    9999       
    100       if (preg_match_all('#l10n_dec\((?:[ ]*)(?:["\']{1})(.*?)(?:["\']{1})(?:[ ]*),(?:[ ]*)(?:["\']{1})(.*?)(?:["\']{1})#', $three_lines, $matches)) 
     100      if (preg_match_all('#l10n_dec\((?:\s*)(?:["\']{1})(.*?)(?:["\']{1})(?:\s*),(?:\s*)(?:["\']{1})(.*?)(?:["\']{1})#', $three_lines, $matches)) 
    101101      { 
    102102        for ($j=0; $j<count($matches[1]); ++$j) 
  • extensions/plugin_lang_analysis/template/main.tpl

    r23427 r23449  
    8787  $(this).addClass('active'); 
    8888   
    89   if ($(this).data('type') == 'common') { 
     89  if ($(this).hasClass('common')) { 
    9090    $(this).nextAll('input').val('false'); 
    9191  } 
     
    106106  {foreach from=$PLA_FILES item=file} 
    107107    <div class="type-button"> 
    108       <span class="item {if not $file.is_admin}active{/if}" data-type="common">{'Common'|@translate}</span><!-- 
    109       --><span class="item {if $file.is_admin}active{/if}" data-type="admin">{'Admin'|@translate}</span> 
     108      <span class="item common {if not $file.is_admin}active{/if}">{'Common'|@translate}</span><!-- 
     109      --><span class="item admin {if $file.is_admin}active{/if}">{'Admin'|@translate}</span> 
    110110      <input type="hidden" name="files[{$file.path}]" value="{if $file.is_admin}true{else}false{/if}"> 
    111111    </div> 
     
    158158        <ul> 
    159159        {foreach from=$data.files item=lines key=file} 
    160           <li>{$file} <i>({', '|@implode:$lines})</i></li> 
     160          <li class="text-{if $PLA_FILES[$file].is_admin}admin{else}common{/if}"> 
     161            {$file} <i>({', '|@implode:$lines})</i></li> 
    161162        {/foreach} 
    162163        </ul> 
    163164      </td> 
    164       <td>{if $data.is_admin}{'Admin'|@translate}{else}{'Common'|@translate}{/if}</td> 
     165      {if $data.is_admin}<td class="text-admin">{'Admin'|@translate}</td> 
     166      {else}<td class="text-common">{'Common'|@translate}</td>{/if} 
    165167      <td>{if $data.in_plugin}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
    166168      <td>{if $data.in_common}<b>{'Yes'|@translate}</b>{else}{'No'|@translate}{/if}</td> 
  • extensions/plugin_lang_analysis/template/style.css

    r23421 r23449  
     1.text-common { 
     2  color:#5E9100 !important; 
     3} 
     4.text-admin { 
     5  color:#E23D3B !important; 
     6} 
     7     
    18.type-button { 
    29  display:inline-block; 
     
    714    padding:5px 8px; 
    815    margin:1px; 
    9     border:1px solid #d3d3d3; 
    1016    background:#e6e6e6; 
    1117    color:#555; 
     
    1420    .type-button span.active { 
    1521      color:#212121; 
    16       border-color:#aaa; 
    17       background:#fff; 
     22    } 
     23    .type-button span.common.active { 
     24      background:#BAFF3F; 
     25    } 
     26    .type-button span.admin.active { 
     27      background:#FF5E5B; 
    1828    } 
    1929    .type-button span:first-of-type { 
     
    3343    color:#eee; 
    3444    padding:2px 5px; 
     45    white-space:nowrap; 
    3546  } 
    3647    .strings thead th:not(:first-of-type) { 
Note: See TracChangeset for help on using the changeset viewer.