View of /mambo/branches/4.6/administrator/components/com_languages/views/templates/editcatalog.tpl.php
Parent Directory
|
Revision Log
Revision 403 -
(download)
(annotate)
Sun Mar 19 20:41:39 2006 UTC (7 years, 2 months ago) by csouza
File size: 8011 byte(s)
Sun Mar 19 20:41:39 2006 UTC (7 years, 2 months ago) by csouza
File size: 8011 byte(s)
language manager
<input type="hidden" name="domain" value="<?php echo $catalog->name ?>" />
<input type="hidden" name="textdomain" value="<?php echo $catalog->path ?>" />
<input type="hidden" name="lang" value="<?php echo $catalog->lang ?>" />
<?php mosCommonHTML::loadOverlib(); ?>
<script type="text/javascript">
function update(value, is_plural, nplural)
{
row_id = document.getElementById('row_id');
if(is_plural) {
trans = document.getElementById('msgstr_'+nplural+'_'+row_id.value);
trans.value = value;
if(nplural == 0) display = value;
} else {
trans = document.getElementById('msgstr_'+row_id.value);
transspan = document.getElementById('msgstr_'+row_id.value+'_span');
trans.value = value;
display = value;
}
transspan = document.getElementById('msgstr_'+row_id.value+'_span');
transspan.innerHTML = display;
}
function translate(row, id, is_plural, nplurals){
singular = document.getElementById('singular');
plural = document.getElementById('plural');
row_class = document.getElementById('row_class');
row_id = document.getElementById('row_id');
if(is_plural) {
plural.style.display = 'block';
singular.style.display = 'none';
msgid = document.getElementById('msgid_'+id);
original = document.getElementById('p_msgid');
original.value = msgid.value;
msgid_plural = document.getElementById('msgid_plural_'+id);
original_plural = document.getElementById('p_msgid_plural');
original_plural.value = msgid_plural.value;
for(a = 0; a < nplurals; a++) {
msgstr = document.getElementById('msgstr_'+a+'_'+id);
translation = document.getElementById('p_msgstr_'+a);
translation.value = msgstr.value
}
} else {
plural.style.display = 'none';
singular.style.display = 'block';
msgid = document.getElementById('msgid_'+id);
original = document.getElementById('s_msgid');
original.value = msgid.value;
msgstr = document.getElementById('msgstr_'+id);
translation = document.getElementById('s_msgstr');
translation.value = msgstr.value;
}
prev_row = document.getElementById('row_'+row_id.value);
if (prev_row) prev_row.className = row_class.value;
row_class.value = row.className;
row_id.value = id;
row.className = 'transhighlight';
}
</script>
<style>
table.adminlist th {text-align:left}
legend {font-weight:bold;}
.transhighlight {background-color:#80B5D7;}
div.strings {height:400px;overflow:auto;}
</style>
<table><tr><td style="width:75%;vertical-align:top">
<?php
$tabs = new mosTabs(1);
$tabs->startPane("catalog");
$tabs->startTab(T_("Messages"),"messages");
?>
<table class="adminlist">
<tr>
<th style="width:50px">
<?php echo T_('Fuzzy') ?>
</th>
<th style="width:40%;text-align:center;">
<?php echo T_('Original') ?>
</th>
<th style="width:40%;text-align:center;">
<?php echo T_('Translation') ?>
</th>
<th style="width:70px">
<?php echo T_('Ref') ?>
</th>
</tr>
</table>
<div class="strings">
<table class="adminlist">
<?php $a=0; foreach ($catalog->strings as $id => $message) :?>
<?php
if(is_array($message->comments)) {
$ref = '';
$tt = '';
foreach($message->comments as $comment) {
if(strncmp($comment, "#: ",3) == 0)
$ref .= ltrim(trim($comment), '#: ')."\n";
$tt .= ltrim(trim($comment),'#: ')."<br />";
}
$tip = mosToolTip( $tt);
}
$is_plural = strlen($message->msgid_plural) > 1 ? 1 : 0;
?>
<tr class="<?php echo "row$a"; ?>" id="row_<?php echo $id ?>" onclick="translate(this, <?php echo $id ?>, <?php echo $is_plural ?>, <?php echo $nplurals ?>)">
<td style="width:50px">
<input type="checkbox" name="fuzzy_<?php echo $id ?>" value="<?php echo $message->is_fuzzy; ?>" <?php echo $message->is_fuzzy ? 'checked="checked" ' : ''; ?>/>
</td>
<td style="width:40%">
<textarea style="display:none" readonly="readonly" id="msgid_<?php echo $id ?>" name="msgid_<?php echo $id ?>"><?php echo $message->msgid ?></textarea>
<?php if ($is_plural): ?>
<textarea style="display:none" readonly="readonly" id="msgid_plural_<?php echo $id ?>" name="msgid_plural_<?php echo $id ?>"><?php echo $message->msgid_plural ?></textarea>
<?php endif; ?>
<?php echo $message->msgid; ?>
</td>
<td style="width:40%">
<?php if ($is_plural): ?>
<?php for ($b=0; $b < $nplurals; $b++):?>
<textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $b ?>_<?php echo $id ?>" name="msgstr_<?php echo $b ?>_<?php echo $id ?>"><?php echo $message->msgstr[$b] ?></textarea>
<?php endfor; ?>
<?php else : ?>
<textarea style="display:none" readonly="readonly" id="msgstr_<?php echo $id ?>" name="msgstr_<?php echo $id ?>"><?php echo $message->msgstr ?></textarea>
<?php endif; ?>
<span id="msgstr_<?php echo $id ?>_span"><?php echo $is_plural ? $message->msgstr[0] : $message->msgstr;?></span>
</td>
<td style="width:50px;text-align:right">
<?php if ($tip) echo $tip; ?>
</td>
</tr>
<?php $a=1-$a;endforeach; ?>
</table>
</div>
<?php $tabs->endTab(); $tabs->startTab(T_('Headers'),"headers");?>
<table class="adminform" style="width:250px">
<tr><td>
<?php
foreach($catalog->headers as $key => $value) {
$disabled = ($key == 'POT-Creation-Date') ? 'readonly="readonly"' : '';
$str = "<tr>\n\t<td>\n\t<label style=\"font-weight:bold\">$key<br />\n";
$str .= "<input type=\"text\" size=\"100\" name=\"headers[$key]\" value=\"".str_replace("\\n", "", trim($value))."\" $disabled />";
$str .= "</label>\n</td>\n\t</tr>\n";
echo $str;
}
?>
</td></tr>
</table>
<?php $tabs->endTab(); $tabs->startTab(T_('Comments'),"comments"); ?>
<table class="adminform" style="width:250px">
<tr><td>
<textarea rows="20" cols="75" name="comments"><?php echo implode("", $catalog->comments) ?></textarea>
</td></tr>
</table>
<?php $tabs->endTab(); $tabs->endPane(); ?>
</td><td style="vertical-align:top;padding-top:20px">
<input type="hidden" id="row_class" name="row_class" value="" />
<input type="hidden" id="row_id" name="row_id" value="" />
<div id="singular" style="position:relative;top:0;left:0;height:250px">
<table class="adminform"><tr><td>
<fieldset><legend><?php echo T_('Original') ?></legend><textarea id="s_msgid" name="s_msgid" cols="40" rows="11" readonly="readonly"></textarea></fieldset>
</td></tr><tr><td>
<fieldset><legend><?php echo T_('Translation') ?></legend><textarea id="s_msgstr" name="s_msgstr" cols="40" rows="11" onblur="update(this.value, 0, 0)"></textarea></fieldset>
</td></tr></table>
</div>
<div id="plural" style="position:relative;top:0;left:0;height:250px;display:none">
<table class="adminform"><tr><td>
<fieldset><legend><?php echo T_('Original') ?></legend>
<label><?php echo T_('Singular') ?><textarea id="p_msgid" name="p_msgid" cols="40" rows="4" readonly="readonly"></textarea></label>
<label><?php echo T_('Plural') ?><textarea id="p_msgid_plural" name="p_msgid_plural" cols="40" rows="4" readonly="readonly"></textarea></label></fieldset>
</td></tr><tr><td>
<fieldset><legend><?php echo T_('Translation') ?></legend>
<div id="plurals">
<script type="text/javascript">
var pluralPane1 = new WebFXTabPane( document.getElementById( "plurals" ), 0);
</script>
<?php for ($a=0; $a < $nplurals; $a++):?>
<div class="tab-page" id="plural_<?php echo $a ?>">
<h2 class="tab"><?php echo T_("Plural") ?>[<?php echo $a ?>]</h2>
<script type="text/javascript">
pluralPane1.addTabPage( document.getElementById( "plural_<?php echo $a ?>" ) );
</script>
<textarea id="p_msgstr_<?php echo $a ?>" name="p_msgstr_<?php echo $a ?>" cols="38" rows="9" onchange="update(this.value, 1, <?php echo $a ?> )"></textarea>
</div>
<?php endfor; ?>
</div>
</fieldset>
</td></tr></table>
</div>
</td></tr></table>| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

