Home »
Imported messages »
comp.lang.php »
Adding the translate function to existing code.
Adding the translate function to existing code. [message #178486] |
Fri, 22 June 2012 22:36 |
Nene
Messages: 1 Registered: June 2012
Karma:
|
Junior Member |
|
|
Hi,
Sorry I'm not a PHP guy.
I have this piece of PHP code that has this dialog box that has the
following code but I want to add the ability for Tar BZip2 , Tar GZip
radio button names to translate to another language using the
translate function. Below is the code. At the bottom of the page, I
have code that has the translate function and it works.
<div id="dlgCompress" class="yui-pe-content">
<div class="hd"><label id="dlgcompress_header"></label></div>
<div class="bd">
<form name="formCompressDlg">
<span class="compressMsg">
<label id="dlgcompress_msg"><?php echo $this-
> translate('DlgLabelNewArchName');?></label>
<input type="text" id="dlgcompressFileName"
name="dlgcompress_filename" size="32" maxlength="255" value="" /><br /
> <br />
<input type="radio" name="dlgcompress_type" value="Zip"
style="vertical-align: middle;" checked onclick="var o =
document.getElementById( 'dlgcompressFileName' ); if ( o ) if
( this.checked ) o.value = o.value.replace( /\..*$/, '' ) +
'.zip';"> Zip Archive
<!-- input type="radio" name="dlgcompress_type" value="Tar"
style="vertical-align: middle;" onclick="var o =
document.getElementById( 'dlgcompressFileName' ); if ( o ) if
( this.checked ) o.value = o.value.replace( /\..*$/, '' ) +
'.tar';"> Tar File -->
<input type="radio" name="dlgcompress_type" value="Tar"
style="vertical-align: middle;" onclick="var o =
document.getElementById( 'dlgcompressFileName' ); if ( o ) if
( this.checked ) o.value = o.value.replace( /\..*$/, '' ) +
'.tgz';"> Tar GZip
<input type="radio" name="dlgcompress_type" value="Tar"
style="vertical-align: middle;" onclick="var o =
document.getElementById( 'dlgcompressFileName' ); if ( o ) if
( this.checked ) o.value = o.value.replace( /\..*$/, '' ) +
'.tar.bz2';"> Tar BZip2
<input type="hidden" id="dlgCompressFileId"
name="dlgcompress_fileid" size="32" maxlength="255" value="0" /></
span>
<br/>
</form>
</div>
<div class="ft"> </div>
</div>
######
Here is an example that has the Zend_translate and it works.
<div class="bd">
<form name="formFileProp" class="yui-dialog">
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelFileName');?></label></span>
<input type="text" name="dlgprop_filename" class="rCol"
size="32" maxlength="255"><br/>
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelFileType');?></label></span>
<label id="dlgprop_filetype" class="rCol"></label>
<hr/>
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelLocation');?></label></span>
<label id="dlgprop_fileloc" class="rCol"></label><br/>
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelSize');?></label></span>
<label id="dlgprop_filesize" class="rCol">0 bytes</label>
<hr/>
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelModified');?></label></span>
<label id="dlgprop_modified" class="rCol"></label><br/>
<span><label class="lCol"><?php echo $this-
> translate('DlgLabelAccessed');?></label></span>
<label id="dlgprop_accessed" class="rCol"></label>
<hr/>
<span style="white-space: nowrap;">
<span style="margin-left: 95px; display: inline-block; white-
space: nowrap;">
<label class="permUserHdr"><?php echo $this-
> translate('DlgLabelUser');?></label>
<label class="permGroupHdr"><?php echo $this-
> translate('DlgLabelGroup');?></label></span><br/>
<label class="permChkLabel" style="white-space: nowrap;"><?php
echo $this->translate('DlgLabelOwnership');?></label>
<select name="dlgprop_users" style="margin-left: 20px; width:
100px; display: inline-block;"></select>
<select name="dlgprop_groups" style="width: 100px; display:
inline-block;"></select></span>
<hr/>
<div>
<div>
<span style="white-space: nowrap; margin-left: 95px;">
<span style="width: 68px;"><label><?php echo $this-
> translate('DlgLabelRead');?></label></span>
<span style="width: 68px;"><label><?php echo $this-
> translate('DlgLabelWrite');?></label></span>
<span style="width: 68px;"><label><?php echo $this-
> translate('DlgLabelExecute');?></label></span></span>
</div>
<div>
<span><label class="permChkLabel"><?php echo $this-
> translate('lgLabelAccessOwner');?></label></span>
<input name="dlgprop_owner_read_access" style="width:
70px;" type="checkbox">
<input name="dlgprop_owner_write_access" style="width:
70px;" type="checkbox">
<input name="dlgprop_owner_exec_access" style="width:
70px;" type="checkbox">
</div>
|
|
|
Goto Forum:
Current Time: Mon Nov 25 22:13:18 GMT 2024
Total time taken to generate the page: 0.05277 seconds