FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Adding the translate function to existing code.
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Adding the translate function to existing code. [message #178486] Fri, 22 June 2012 22:36 Go to previous message
Nene is currently offline  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';">&nbsp;Zip Archive &nbsp;&nbsp;&nbsp;&nbsp;
<!-- 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';">&nbsp;Tar File &nbsp;&nbsp;&nbsp;&nbsp; -->
<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';">&nbsp;Tar GZip &nbsp;&nbsp;&nbsp;&nbsp;
<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';">&nbsp;Tar BZip2 &nbsp;&nbsp;&nbsp;
<input type="hidden" id="dlgCompressFileId"
name="dlgcompress_fileid" size="32" maxlength="255" value="0" /></
span>
<br/>
</form>
</div>
<div class="ft">&nbsp;</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>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: can't modify include path
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Oct 20 23:27:25 GMT 2024

Total time taken to generate the page: 0.04761 seconds