X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Compiled Language Templates-->Now Won't Let Me Edit Label (https://forum.x-cart.com/showthread.php?t=5837)

janetallard 01-03-2004 10:39 AM

Compiled Language Templates-->Now Won't Let Me Edit Label
 
Help-
I compiled the language templates down to just English using the post:
LANGUAGE SELECTION MENU

Now I cannot edit any of my labels...they revert back to the original no matter how many times I "update." It says I can RESTORE FILES but it will do it to ALL of my templates. Is there any way to isolate just the language file. The typos and grammar are driving me nuts!!!

Thanks,
Janet A. :?

adpboss 01-03-2004 10:55 AM

I would like to help but I do not understand this

Quote:

I compiled the language templates down to just English using the post:
LANGUAGE SELECTION MENU

janetallard 01-03-2004 11:23 AM

Sorry- I should have posted this in the "Internationalization & Localization" forum but I was having trouble figuring it out. There is a post under this forum titled: Language Menu Selection by Mikeread that I was trying to reference to. I haven't figured out how to use the "quote" feature like you just did. Anyway, this is where I got the info from.
Does that help?

Let me know.
Janet

adpboss 01-03-2004 11:31 AM

I don't know why you would use this feature but...

Did you check your template files to see what exactly was changed? Did it compile all of your templates with the current language values in the database or are the smarty tags still there?

{$lng.txt_bla_bla} for example?

Quote:

If you do not need the multi-language templates you can perform compilation (i.e. automatically replacing language variables with the values). This would be very helpful in editing templates process.

If this command alters your template files you are in a wee bit of a mess.

Tell me you have a backup please... :(

You want to be careful what you do on this board because ANYONE can post anything, anytime. That doesn't necessarily make them right. The only safe path is to constantly backup before attempting anything.

janetallard 01-03-2004 12:06 PM

OK-
This is what I have under /admin/main/languages.tpl

{include file="location.tpl" last_location="Edit languages"}
{capture name=dialog}
<TABLE border=0 cellpadding=5 cellspacing=5>
<TR>
<FORM method=GET action="languages.php" name=language_form>
<TD>
Language: <SELECT name=language onChange='javascript: document.language_form.submit()'>
<OPTION value=""{if $smarty.get.language eq ""} selected{/if}>Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $smarty.get.language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</FORM>
<FORM method=GET action="languages.php" name=dl_form>
<TD>
{if $smarty.get.language ne ""}
<INPUT type=hidden name=mode value="">
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
{if $lang_disabled eq "Y"}
<INPUT type=button value="Enable" onClick="javascript: self.location='languages.php?language={$smarty.get .language|escape:"html"}&mode=change'">
{else}
<INPUT type=button value="Disable" onClick="javascript: self.location='languages.php?language={$smarty.get .language|escape:"html"}&mode=change'">
{/if}
{literal}
<INPUT type=button value="Delete" onClick="javascript: if (confirm('Are you sure?')) {document.dl_form.mode.value='del_lang'; document.dl_form.submit();}">
{/literal}
</TD>
</TR>
<TR><TD>
CSV delimiter: {include file="provider/main/ie_delimiter.tpl"}
</TD>
<TD>
<INPUT type=button value="Export ..." onClick="javascript: document.dl_form.mode.value='export'; document.dl_form.submit();">
{/if}
</TD>
</TR>
{if $smarty.get.language ne ""}
<TR><TD>
Charset: <INPUT type=text name="charset" value="{$default_charset}">
</TD>
<TD>
<INPUT type=button value="Change" onClick="javascript: document.dl_form.mode.value='update_charset'; document.dl_form.submit();">
</TD>
</FORM>
</TR>
{/if}
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Edit language" extra="width=100%"}


{if $smarty.get.language ne ""}
Note: To enter the values of language variables in the correct charset please select the desired language from the dropdown box at the top of this page.

<FORM method=GET action="languages.php" name=topic_form>
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
Select topic:
<SELECT name=topic onChange='javascript: document.topic_form.submit();'>
{section name=ti loop=$topics}
<OPTION value="{$topics[ti]}"{if $smarty.get.topic eq $topics[ti]} selected{/if}>{$topics[ti]}</OPTION>
{/section}
</SELECT>


Apply Filter:
<INPUT type=text size=16 name=filter value="{$smarty.get.filter|escape:"html"}"><INPUT type=submit value="Go">
</FORM>
{include file="customer/main/navigation.tpl"}
<FORM action="languages.php" method=POST>
<INPUT type=hidden name=mode value=update>
<INPUT type=hidden name=page value="{$smarty.get.page|escape:"html"}">
<INPUT type=hidden name=topic value="{$smarty.get.topic|escape:"html"}">
<INPUT type=hidden name=filter value="{$smarty.get.filter|escape:"html"}">
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
{capture name=dialog}
<TABLE border=0>
<TR bgcolor="#CCCCCC">
<TD>Variable</TD>
<TD>Description</TD>
<TD>Value</TD>
<TD></TD>
</TR>
{section name=di loop=$data}
<TR valign=top>
<TD align=left>{$data[di].name}<INPUT type=hidden name=var_name[] value="{$data[di].name}"></TD>
<TD align=left><INPUT type=text value="{$data[di].descr}" name=var_descr[{$data[di].name}]></TD>
<TD align=left><TEXTAREA cols=25 rows=3 name=var_value[{$data[di].name}]>{$data[di].value}</TEXTAREA></TD>
<TD><INPUT type=button onClick="javascript: self.location='languages.php?mode=delete&language= {$smarty.get.language|escape:"html"}&topic={$smart y.get.topic|escape:"html"}&page={$smarty.get.page| escape:"html"}&filter={$smarty.get.filter|escape:" html"}&var={$data[di].name}';" value="Delete"></TD>
</TR>
{/section}
<TR>
<TD colspan=4><FONT class=AdminTitle>Add new entry</FONT></TD>
</TR>
<TR valign=top>
<TD align=right><INPUT type=text size=25 name=new_var_name></TD>
<TD><INPUT type=text size=25 name=new_var_descr></TD>
<TD><TEXTAREA cols=25 rows=3 name=new_var_value></TEXTAREA></TD>
<TD></TD>
</TR>
<TR>
<TD colspan=4><INPUT type=submit value="Apply changes"></TD>
</TR>
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Edit language entries" extra="width=100%"}
</FORM>
{/if}
{capture name=dialog}
<TABLE border=0>
<FORM method=POST action=languages.php>
<TR>
<TD>Default customer language:</TD>
<TD>
<SELECT name=new_customer_language>
<OPTION value="">Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $config.default_customer_language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
<TR>
<TD>Default admin language:</TD>
<TD>
<SELECT name=new_admin_language>
<OPTION value="">Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $config.default_admin_language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
<TR>
<TD colspan=2><INPUT type=submit value="Update"></TD>
</TR>
<input type=hidden name=mode value=change_defaults>
<input type=hidden name=language value="{$smarty.get.language|escape:"html"}">
</FORM>
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Default languages" extra="width=100%"}



{capture name=dialog}
<FORM method=POST action=languages.php enctype="multipart/form-data">
<INPUT type=hidden name=mode value="add_lang">
<TABLE border=0>
<TR>
<TD>Choose language:</TD>
<TD>
<SELECT name=new_language>
<OPTION value="">Select one...</OPTION>
{section name=ni loop=$new_languages}
<OPTION value="{$new_languages[ni].code}">{$new_languages[ni].language}</OPTION>
{/section}
</SELECT>
</TD></TR>
<TR><TD>Import file (optional):</TD><TD><INPUT type=file name=import_file></TD></TR>
<TR><TD>CSV delimiter:</TD><TD>{include file="provider/main/ie_delimiter.tpl"}</TD></TR>
</TABLE>



Note: the fields in import file must be in the following order: Name, Value, Description, Topic



<INPUT type=submit value="Add/Update language">

</FORM>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title='Add new language' extra="width=100%"}



And this is what I have under this file: /admin/mains_PREV/language.tpl

{include file="location.tpl" last_location="Edit languages"}
{capture name=dialog}
<TABLE border=0 cellpadding=5 cellspacing=5>
<TR>
<FORM method=GET action="languages.php" name=language_form>
<TD>
Language: <SELECT name=language onChange='javascript: document.language_form.submit()'>
<OPTION value=""{if $smarty.get.language eq ""} selected{/if}>Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $smarty.get.language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</FORM>
<FORM method=GET action="languages.php" name=dl_form>
<TD>
{if $smarty.get.language ne ""}
<INPUT type=hidden name=mode value="">
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
{if $lang_disabled eq "Y"}
<INPUT type=button value="Enable" onClick="javascript: self.location='languages.php?language={$smarty.get .language|escape:"html"}&mode=change'">
{else}
<INPUT type=button value="Disable" onClick="javascript: self.location='languages.php?language={$smarty.get .language|escape:"html"}&mode=change'">
{/if}
{literal}
<INPUT type=button value="Delete" onClick="javascript: if (confirm('Are you sure?')) {document.dl_form.mode.value='del_lang'; document.dl_form.submit();}">
{/literal}
</TD>
</TR>
<TR><TD>
CSV delimiter: {include file="provider/main/ie_delimiter.tpl"}
</TD>
<TD>
<INPUT type=button value="Export ..." onClick="javascript: document.dl_form.mode.value='export'; document.dl_form.submit();">
{/if}
</TD>
</TR>
{if $smarty.get.language ne ""}
<TR><TD>
Charset: <INPUT type=text name="charset" value="{$default_charset}">
</TD>
<TD>
<INPUT type=button value="Change" onClick="javascript: document.dl_form.mode.value='update_charset'; document.dl_form.submit();">
</TD>
</FORM>
</TR>
{/if}
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Edit language" extra="width=100%"}


{if $smarty.get.language ne ""}
Note: To enter the values of language variables in the correct charset please select the desired language from the dropdown box at the top of this page.

<FORM method=GET action="languages.php" name=topic_form>
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
Select topic:
<SELECT name=topic onChange='javascript: document.topic_form.submit();'>
{section name=ti loop=$topics}
<OPTION value="{$topics[ti]}"{if $smarty.get.topic eq $topics[ti]} selected{/if}>{$topics[ti]}</OPTION>
{/section}
</SELECT>


Apply Filter:
<INPUT type=text size=16 name=filter value="{$smarty.get.filter|escape:"html"}"><INPUT type=submit value="Go">
</FORM>
{include file="customer/main/navigation.tpl"}
<FORM action="languages.php" method=POST>
<INPUT type=hidden name=mode value=update>
<INPUT type=hidden name=page value="{$smarty.get.page|escape:"html"}">
<INPUT type=hidden name=topic value="{$smarty.get.topic|escape:"html"}">
<INPUT type=hidden name=filter value="{$smarty.get.filter|escape:"html"}">
<INPUT type=hidden name=language value="{$smarty.get.language|escape:"html"}">
{capture name=dialog}
<TABLE border=0>
<TR bgcolor="#CCCCCC">
<TD>Variable</TD>
<TD>Description</TD>
<TD>Value</TD>
<TD></TD>
</TR>
{section name=di loop=$data}
<TR valign=top>
<TD align=left>{$data[di].name}<INPUT type=hidden name=var_name[] value="{$data[di].name}"></TD>
<TD align=left><INPUT type=text value="{$data[di].descr}" name=var_descr[{$data[di].name}]></TD>
<TD align=left><TEXTAREA cols=25 rows=3 name=var_value[{$data[di].name}]>{$data[di].value}</TEXTAREA></TD>
<TD><INPUT type=button onClick="javascript: self.location='languages.php?mode=delete&language= {$smarty.get.language|escape:"html"}&topic={$smart y.get.topic|escape:"html"}&page={$smarty.get.page| escape:"html"}&filter={$smarty.get.filter|escape:" html"}&var={$data[di].name}';" value="Delete"></TD>
</TR>
{/section}
<TR>
<TD colspan=4><FONT class=AdminTitle>Add new entry</FONT></TD>
</TR>
<TR valign=top>
<TD align=right><INPUT type=text size=25 name=new_var_name></TD>
<TD><INPUT type=text size=25 name=new_var_descr></TD>
<TD><TEXTAREA cols=25 rows=3 name=new_var_value></TEXTAREA></TD>
<TD></TD>
</TR>
<TR>
<TD colspan=4><INPUT type=submit value="Apply changes"></TD>
</TR>
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Edit language entries" extra="width=100%"}
</FORM>
{/if}
{capture name=dialog}
<TABLE border=0>
<FORM method=POST action=languages.php>
<TR>
<TD>Default customer language:</TD>
<TD>
<SELECT name=new_customer_language>
<OPTION value="">Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $config.default_customer_language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
<TR>
<TD>Default admin language:</TD>
<TD>
<SELECT name=new_admin_language>
<OPTION value="">Select one...</OPTION>
{section name=li loop=$languages}
<OPTION value="{$languages[li].code}"{if $config.default_admin_language eq $languages[li].code} selected{/if}>{$languages[li].language}</OPTION>
{/section}
</SELECT>
</TD>
</TR>
<TR>
<TD colspan=2><INPUT type=submit value="Update"></TD>
</TR>
<input type=hidden name=mode value=change_defaults>
<input type=hidden name=language value="{$smarty.get.language|escape:"html"}">
</FORM>
</TABLE>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title="Default languages" extra="width=100%"}



{capture name=dialog}
<FORM method=POST action=languages.php enctype="multipart/form-data">
<INPUT type=hidden name=mode value="add_lang">
<TABLE border=0>
<TR>
<TD>Choose language:</TD>
<TD>
<SELECT name=new_language>
<OPTION value="">Select one...</OPTION>
{section name=ni loop=$new_languages}
<OPTION value="{$new_languages[ni].code}">{$new_languages[ni].language}</OPTION>
{/section}
</SELECT>
</TD></TR>
<TR><TD>Import file (optional):</TD><TD><INPUT type=file name=import_file></TD></TR>
<TR><TD>CSV delimiter:</TD><TD>{include file="provider/main/ie_delimiter.tpl"}</TD></TR>
</TABLE>



Note: the fields in import file must be in the following order: Name, Value, Description, Topic



<INPUT type=submit value="Add/Update language">

</FORM>
{/capture}
{include file="dialog.tpl" content=$smarty.capture.dialog title='Add new language' extra="width=100%"}


Sorry-but I am not a programmer. Is this the files that you were requesting?

Thanks...I appreciate your time.

Janet

adpboss 01-03-2004 12:16 PM

Can you post help.tpl (it's in the root of your templates directory)

Select all of the code that you pasted and click the square CODE button.

It will make your text stand out in the forum post by putting code tags around it.

So in your next post a reply

paste text
select all pasted text
click square CODE button above the text input window

That's how you quote or show code. When you paste code normally like before it's darn hard to read.

Post the contents of help.tpl. That will answer my question.

janetallard 01-03-2004 12:35 PM

Sorry-It took me awhile. I have a MAC and it's a little different.

Code:

{* $Id: help.tpl,v 1.15 2003/03/28 08:26:08 svowl Exp $ *}
{capture name=menu}
Recover Password

Contact Us

Privacy Statement

Terms & Conditions

{include file="pages_menu.tpl"}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_help.gif" menu_title="Help" menu_content=$smarty.capture.menu link_href="help.php"}



Janet

adpboss 01-03-2004 12:57 PM

S'okay, I'm used to waiting for Mac users. ;) (joke)

Mine


Yours


What that command did was as I feared. It went through ALL of your templates and replaced the Smarty Tags {$lng.lbl_recover_password} with the value (at the time you did this) for that language variable.

So basically when you try to update the value in the admin, it is updating the database, but the templates are no longer going to the database for the value. It has been HARD coded into the template.

I can see some (but little) value in this.

So... if you want to change any text now you will have to edit the template directly. You cannot just update from the admin. The big issue is that if you want to edit text that is common throughout the site, you no longer make one change in the admin. You have to change every single instance of that text in the templates.

Please tell me you have a backup. I don't think this is what you wanted to do. My belief is that you wanted to eliminate all languages except English.

janetallard 01-03-2004 01:51 PM

I have a backup but I don't know how old it is. I will need to check in to it ASAP.

Thanks,
Janet :cry:

janetallard 01-05-2004 06:33 PM

Hi adpboss-
Could you help me out one more time please? When I restore the backup, do I need to do the database, html or both?

Thanks...
Janet


All times are GMT -8. The time now is 02:43 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.