Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6410 > unrolled thread
| Started by | Nene <rodbass63@gmail.com> |
|---|---|
| First post | 2012-06-22 15:36 -0700 |
| Last post | 2012-06-23 17:12 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.php
Adding the translate function to existing code. Nene <rodbass63@gmail.com> - 2012-06-22 15:36 -0700
Re: Adding the translate function to existing code. Jerry Stuckle <jstucklex@attglobal.net> - 2012-06-22 19:25 -0400
Re: Adding the translate function to existing code. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-06-23 17:12 +0200
| From | Nene <rodbass63@gmail.com> |
|---|---|
| Date | 2012-06-22 15:36 -0700 |
| Subject | Adding the translate function to existing code. |
| Message-ID | <f1fd575d-fb70-46bd-be0c-39f0c525f848@m24g2000yqh.googlegroups.com> |
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>
[toc] | [next] | [standalone]
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Date | 2012-06-22 19:25 -0400 |
| Message-ID | <js2utl$a4o$1@dont-email.me> |
| In reply to | #6410 |
On 6/22/2012 6:36 PM, Nene wrote: > 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. > <snip code> Impossible to tell from your code. The translate function is a member of a class, but not one supplied by PHP. It's hard telling what it's doing. If you don't know PHP, I would recommend you hire a PHP programmer to help you with it. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ==================
[toc] | [prev] | [next] | [standalone]
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
|---|---|
| Date | 2012-06-23 17:12 +0200 |
| Message-ID | <a4m4n8Fq2hU1@mid.uni-berlin.de> |
| In reply to | #6410 |
Am 23.06.2012 00:36, schrieb Nene: > 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. > --unreadable code cut-- Looks like you have to add the label text with the translate function, you will probably have to add the entries to the message catalog as well. Then you have to extend the code to handle the new selections. No problem for a PHP programmer who knows Zend. /Str.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web