Really weird bug after creating a new style
cosmin 269
From: -
From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
And now it would seem I have to wait for 2.2 because you say its localization method isn't compatible with 2.1.
You can still translate the templates itself or translate the templates with the current language pack feature. Already translated Contentteller 2.0/2.1 templates will work in 2.2.
The only limitation is that you can't change the language of an old template set on the fly because of the missing language placeholders.
Can I at least begin working on a design? Or will 2.2 break that as well and I'm better off ...sigh... waiting some more?
Contentteller is always backward compatible. You can reuse 2.0 or 2.1 templates in 2.2
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
I got it working following the private message. But yes, I am a bit irritated. It took a week to get this issue solved. Not only that but just as I had translated half the language pack, out comes 2.1 and I have to go back to do it again, because sync-ing the two files was not possible. And now it would seem I have to wait for 2.2 because you say its localization method isn't compatible with 2.1. Can I at least begin working on a design? Or will 2.2 break that as well and I'm better off ...sigh... waiting some more?
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
I am getting this (attachment) after applying the patch above. Why are you not translating the templates itself? This should be a lot easier.
As a said before the current language pack system will be completely revamped in 2.2. The current 2.0/2.1 implementation is incompatible with 2.2, which means that it is almost pointless to create a language pack now. However, translated templates are working just fine in 2.2+ as well.
Don't get irritated by the version numbers. A version 2.2 indicates only templates and database changes, it doesn't mean that it is going to be a huge release that takes another 18 months, in fact, 2.2 will be a pretty small release compared to 2.1.
As a said before the current language pack system will be completely revamped in 2.2. The current 2.0/2.1 implementation is incompatible with 2.2, which means that it is almost pointless to create a language pack now. However, translated templates are working just fine in 2.2+ as well.
Don't get irritated by the version numbers. A version 2.2 indicates only templates and database changes, it doesn't mean that it is going to be a huge release that takes another 18 months, in fact, 2.2 will be a pretty small release compared to 2.1.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Open /cadmin/templates/admindoaddset.php in an editor and find:
$language_search[ ] = $templatelangsnip_search;
$language_replace[ ] = $templatelangsnip_replace;
and add this before:
if( strlen( $templatelangsnip_search ) < 3 )
{
$templatelangsnip_search = " " . $templatelangsnip_search . " ";
$templatelangsnip_replace = " " . $templatelangsnip_replace . " ";
}
This will add additional spaces on short words like "on" or "by"
You know, maybe you should try going through my steps. I'll give you the language file, you install it and then create a style based on default and romanian and see if it does the same for you. I've tried your latest fix and it doesn't seem to work (although I'm not sure I put the lines where they should have been).
I've also tried creating a style based on default templates and the original XML file you gave me (deutsch). It still does the same.
You should try duplicating my steps. Import the Romanian XML language file (it's attached in one of my earlier posts) and then go to "Manage templates" -> Create a new template set using template set default and language Romanian (although it doesn't work with Deutsch either) and then enable all users to switch styles, and switch to the newly created style. You should get something like in the attached picture. And then take a look at the HTML source.
Please get to the bottom of this, I feel like throwing my monitor out the window. I've spent an insane amount of time waiting for 2.0 because ST didn't meet my needs and now this showbreaker happens.
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
Open /cadmin/templates/admindoaddset.php in an editor and find:
and add this before:
This will add additional spaces on short words like "on" or "by"
$language_search[ ] = $templatelangsnip_search;
$language_replace[ ] = $templatelangsnip_replace;
and add this before:
if( strlen( $templatelangsnip_search ) < 3 )
{
$templatelangsnip_search = " " . $templatelangsnip_search . " ";
$templatelangsnip_replace = " " . $templatelangsnip_replace . " ";
}
This will add additional spaces on short words like "on" or "by"
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Even after deleting the strings inside the templates I mentioned, it still doesn't work. Sometimes the strings are correct, sometimes they are not. Your script is too complex for me to know where to start looking.
This is a serious bug that needs fixing now, because it renders the script unusable. Just take a look at the messy code it generates (many essential templates are affected - i'll just post part of it because the whole style based on Romanian is 2 MB in size):
<template_name>files_comment_form_iconrow</template_name>
<template_html><![CDATA[<!-- Template: files_comment_form_icamrow -->
<input type="radio" name="input_icam" value="{$insert['messageicam_id']}" {$insert['messageicam_checked']}/>
<img src="https://www.contentteller.com/images/icams/{$insert['messageicam_image']}" alt="{$insert['messageicam_name']}" />
{$insert['messageicam_break']}]]></template_html>
<template_php><![CDATA[]]></template_php>
<template_date>1196957263</template_date>
</template>
<template>
<template_name>files_comment_form_securitycode</template_name>
<template_html><![CDATA[<!-- Template: files_comment_form_securitycode -->
Geben Sie <img src="https://www.contentteller.com/contentteller{$insert['param_ext']}{$insert['param_ct']}files{$insert['param_actiam']}securityimage" alt="" /> ein: <input name="input_securitycode" size="8" value="{$insert['input_securitycode']}" /><br />]]></template_html>
<template_php><![CDATA[]]></template_php>
<template_date>1196957263</template_date>
</template>
And here's part of the generated HTML source:
<script type="text/javascript">
<!--
function themejump(id)
{
window.location.href = "index.php?ct=core&action=theme&id="+document.getElementById("thistheme").value+"&query=www.cinemaexpres.ro%2F";
}
//-->
</script>
<select id="thistheme" onchange="themejump(1)"><option value="0">-</option><option value="1">Default</option><option value="8" selected="selected">cinemaexpres_light</option></select>
</div>
<br />
</div>
<div class="mainpage" id="content">
<!-- Template: site_login_anam -->
<h4>Bine ai venit</h4>
<h5>Utilizatorii inregistrati au mai multe avantaje. Te rugam <a href="https://www.contentteller.com/contentteller.php?/userslogin/index.html" rel="nofollow">Login</a> sau <a href="https://www.contentteller.com/contentteller.php?/usersregistratiam/index.html" rel="nofollow">inregistreaza-te</a>. Inscrierea este gratuita si dureaza doar cateva minute.</h5>
<br />
This is a serious bug that needs fixing now, because it renders the script unusable. Just take a look at the messy code it generates (many essential templates are affected - i'll just post part of it because the whole style based on Romanian is 2 MB in size):
<template_name>files_comment_form_iconrow</template_name>
<template_html><![CDATA[<!-- Template: files_comment_form_icamrow -->
<input type="radio" name="input_icam" value="{$insert['messageicam_id']}" {$insert['messageicam_checked']}/>
<img src="https://www.contentteller.com/images/icams/{$insert['messageicam_image']}" alt="{$insert['messageicam_name']}" />
{$insert['messageicam_break']}]]></template_html>
<template_php><![CDATA[]]></template_php>
<template_date>1196957263</template_date>
</template>
<template>
<template_name>files_comment_form_securitycode</template_name>
<template_html><![CDATA[<!-- Template: files_comment_form_securitycode -->
Geben Sie <img src="https://www.contentteller.com/contentteller{$insert['param_ext']}{$insert['param_ct']}files{$insert['param_actiam']}securityimage" alt="" /> ein: <input name="input_securitycode" size="8" value="{$insert['input_securitycode']}" /><br />]]></template_html>
<template_php><![CDATA[]]></template_php>
<template_date>1196957263</template_date>
</template>
And here's part of the generated HTML source:
<script type="text/javascript">
<!--
function themejump(id)
{
window.location.href = "index.php?ct=core&action=theme&id="+document.getElementById("thistheme").value+"&query=www.cinemaexpres.ro%2F";
}
//-->
</script>
<select id="thistheme" onchange="themejump(1)"><option value="0">-</option><option value="1">Default</option><option value="8" selected="selected">cinemaexpres_light</option></select>
</div>
<br />
</div>
<div class="mainpage" id="content">
<!-- Template: site_login_anam -->
<h4>Bine ai venit</h4>
<h5>Utilizatorii inregistrati au mai multe avantaje. Te rugam <a href="https://www.contentteller.com/contentteller.php?/userslogin/index.html" rel="nofollow">Login</a> sau <a href="https://www.contentteller.com/contentteller.php?/usersregistratiam/index.html" rel="nofollow">inregistreaza-te</a>. Inscrierea este gratuita si dureaza doar cateva minute.</h5>
<br />
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
I'm still waiting for a solution, Phillipp.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Well that's the problem, I'm going to need the news templates and some of the others. No offense but what you're proposing is only a very crude workaround. Until you complete version 2.2 you need to change the pattern matching to only replace full words not inside words.
I mean not the way it does now where it replaces the word "on" and it also replaces "on" when it's inside a word like in 'donatello'. All those templates I've mentioned above have the word "on/an" inside them.
I suppose I could delete the word "on" from those templates for now so it doesn't trigger the matching engine, but you need to consider this issue when you redesign the localization.
I mean not the way it does now where it replaces the word "on" and it also replaces "on" when it's inside a word like in 'donatello'. All those templates I've mentioned above have the word "on/an" inside them.
I suppose I could delete the word "on" from those templates for now so it doesn't trigger the matching engine, but you need to consider this issue when you redesign the localization.
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
Well, you really need to fix your template system. It still does the same. I found out that there are templates as well that replace on with am
The problem is that the current German language pack was never made to process all template at once. Basically, the language pack is split over multiple files (one for each module) that's why there are many repetitions.
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
files_archive_file
files_comment_edit_notice
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
Do I delete all of these?
Yes, delete everything you doesn't need
Also, when I update the language file, do I need to delete the style and recreate it or is updated automatically?
No, you need to recreate the template set each time.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Well, you really need to fix your template system. It still does the same. I found out that there are templates as well that replace on with am
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
files_archive_file
files_comment_edit_notice
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
Do I delete all of these?
Other snippets may cause problems as well, such as:
<snippet>
<templatelangsnip_name>files_comment_history_post</templatelangsnip_name>
<templatelangsnip_search><![CDATA[by]]></templatelangsnip_search>
<templatelangsnip_replace><![CDATA[von]]></templatelangsnip_replace>
</snippet>
The problem is that they replace the two letters inside words as well, instead of treating the two letters as a word.
I can't help but wonder if the words such as "No" won't cause similar problems, meaning it would mess up all the words that contain "no".
Also, when I update the language file, do I need to delete the style and recreate it or is updated automatically?
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
files_archive_file
files_comment_edit_notice
news_story_header
news_archive_frontpage
news_story_comment_edit_notice_5a7c
articles_overview_summary_55cd
knowledgebase_entry_1d41
knowledgebase_entry_header_a418
Do I delete all of these?
Other snippets may cause problems as well, such as:
<snippet>
<templatelangsnip_name>files_comment_history_post</templatelangsnip_name>
<templatelangsnip_search><![CDATA[by]]></templatelangsnip_search>
<templatelangsnip_replace><![CDATA[von]]></templatelangsnip_replace>
</snippet>
The problem is that they replace the two letters inside words as well, instead of treating the two letters as a word.
I can't help but wonder if the words such as "No" won't cause similar problems, meaning it would mess up all the words that contain "no".
Also, when I update the language file, do I need to delete the style and recreate it or is updated automatically?
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
I've added them using the interface in cadmin. this is the initial version. but this is the one that didn't work anyway. And now I see why it didn't (articles_summary_header_a418).
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
I don't see the three snippets in your language file. You could also remove the snippet articles_summary_header_a418 that rewrite on to am.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Here is the language file.
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
Or do you it could be something wrong with the language file I created?
Can you attach your language pack in the next post, so I can take a look.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
I've added the three snippets you said, the script is still broken. Your script really seems to have something against those two letters: on gets replaced with am everywhere. And it even ignores the new snippets. Content still gets replaced by camtent. This is definitely a bug. Or do you it could be something wrong with the language file I created?
See this:
<h5>Utilizatorii inregistrati au mai multe avantaje. Te rugam <a href="https://www.contentteller.com/camtentteller.php?/userslogin/index.html" rel="nofollow">Login</a> sau <a href="https://www.contentteller.com/camtentteller.php?/usersregistratiam/index.html" rel="nofollow">inregistreaza-te</a>. Inscrierea este gratuita si dureaza doar cateva minute.</h5>
<br />
<div style="text-align: center;"></div><!-- Template: news_layout_main -->
<!-- Template: news_header -->
<div class="camtent">
<a href="https://www.contentteller.com/ http://www.cinemaexpres.ro">Cinema Expres</a> ยป <a href="https://www.contentteller.com/camtentteller.php?/news/index.html">News</a>
</div>
<br />
See this:
<h5>Utilizatorii inregistrati au mai multe avantaje. Te rugam <a href="https://www.contentteller.com/camtentteller.php?/userslogin/index.html" rel="nofollow">Login</a> sau <a href="https://www.contentteller.com/camtentteller.php?/usersregistratiam/index.html" rel="nofollow">inregistreaza-te</a>. Inscrierea este gratuita si dureaza doar cateva minute.</h5>
<br />
<div style="text-align: center;"></div><!-- Template: news_layout_main -->
<!-- Template: news_header -->
<div class="camtent">
<a href="https://www.contentteller.com/ http://www.cinemaexpres.ro">Cinema Expres</a> ยป <a href="https://www.contentteller.com/camtentteller.php?/news/index.html">News</a>
</div>
<br />
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Yes I understand how it works, but since the script replaces on with am when it shouldn't, I'd say it's a bug.
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
I have to say it's one strange "limitation". Why would the script need to replace letters like this?
Because the current language pack based on search & replace but this will change in the next major release. Contentteller 2.2 will have a real language pack, which means that the language is indeed separated from the templates.
Couldn't I just export the template, replace the wrong words directly inside it and import it back?
Yes, but you need to export the entire template set. Why not edit the template in the template editor? This should be the easiest way.
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
Couldn't I just export the template, replace the wrong words directly inside it and import it back?
1 Re: Really weird bug after creating a new style
cosmin
OP
269
From: -
From: -
I have to say it's one strange "limitation". Why would the script need to replace letters like this?
1 Re: Really weird bug after creating a new style
Philipp Esselbach
From: -
Editor
0From: -
Not really bug but a limitation of the current way how languages packs works.
To workaround this, add the following language snippets:
Snippet name: camtent
Search for: camtent
and replace with: content
Snippet name: ransitiamal
Search for: ransitiamal
and replace with: ransitional
Snippet name: camtentteller
Search for: camtentteller
and replace with: contentteller
Snippet name: actiam
Search for: actiam
and replace with: action
To workaround this, add the following language snippets:
Snippet name: camtent
Search for: camtent
and replace with: content
Snippet name: ransitiamal
Search for: ransitiamal
and replace with: ransitional
Snippet name: camtentteller
Search for: camtentteller
and replace with: contentteller
Snippet name: actiam
Search for: actiam
and replace with: action
I created a new style based on Default and Romanian (which is based on the german XML file you gave me).
Now once the script is configured to use that style, something weird happens:
the page loses CSS styling and I think it's because , looking at the source somehow wherever the two letters "on" appear, they are replaced by "am" making the html code unreadable for the browser.
Like this (see bold text):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiamal//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitiamal.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta camtent="text/html; charset=UTF-8" http-equiv="camtent-type" />
<meta name="generator" camtent="Esselbach Seitenteller CMS" />
<meta name="descriptiam" camtent="" />
<meta name="keywords" camtent="filme 2010, filme 2009, filme noi, film, filme, 2010, programe tv, program cinema, premiere cinema, trailere filme" />
<base href="https://www.contentteller.com/ http://www.cinemaexpres.ro/" />
<title>Cinema Expres</title>
<!-- Template: news_rss -->
<link href="https://www.contentteller.com/ http://www.cinemaexpres.ro/camtentteller.php?/newsrss" rel="alternate" type="applicatiam/rss+xml" title="Aktuelle News von Cinema Expres" />
<link rel="stylesheet" type="text/css" href="https://www.contentteller.com/camtentteller.php?ct=core&actiam=css&id=3" title="Theme #3" />
</head>
<body>
<!-- Template: site_header -->
<div class="pageborder">
<div class="pageheader">
<div class="centerborder">
<h1><a href="https://www.contentteller.com/ http://www.cinemaexpres.ro"><img src="https://www.contentteller.com/images/logos/contentteller_logo.gif" alt="" /></a></h1>
<h2>CONTENTTELLER CMS</h2>
</div>
<div class="colleft" id="menu1">
<!-- Template: site_block -->
<h1>Main Menu</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>News</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>What's New</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>News Channels</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>News Tags</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>Online Users</h1>
<div class="camtent">
</div>
<br />
<div style="text-align: center;">
<!-- Do not remove -->
<a href="https://www.contentteller.com/ http://www.contentteller.com"><img src="https://www.contentteller.com/index.php" alt="Contentteller(R) Professional Edition" /></a>
HERE IT SEEMS UNAFFECTED
<!-- Do not remove -->
</div>
</div>
<div class="colright" id="menu2">
<!-- Template: site_block -->
<h1>Latest News</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>Top News</h1>
<div class="camtent">
</div>
<br /><!-- Template: site_block -->
<h1>Latest Poll</h1>
<div class="camtent">