Jump to content

Quick HTML query


Diogo Ribeiro

Recommended Posts

For those who are knowledgable of HTML in general, I have a quick question. I have been tinkering with the HTML code of a site, and while I think I've finally changed it to my ignorant but happy heart's contempt, I can't seem to make a small change - turning a comments system's display from English into another language.

 

The original system is basically in English but I want to change the display of "comment" and "comments" into something else. The portion of the original code that handled this read:

 

<$BlogItemCommentCount$> comments

 

I've replaced the line with:

 

<script type="text/javascript">var a = <$BlogItemCommentCount$>; if(a == 0) {document.write('No comment');} else if(a == 1)
{document.write('1 comment');} else {document.write(a+' comments');}</script>

 

Where any displayed instance of 'comment' or 'comments' will be changed to what I want. Now the problem is that while I've tested this with dummy sites and managed to have them work, it won't work on the one I want (which for reference its this one). No matter how much I change the code it will retain the original use of the words in English.

 

I've been told the problem could be solved if I placed the new line outside of the <MainPage> and </MainPage> or <ItemPage> and </ItemPage> conditional tags.... Only problem is, I don't know where I should put them. I don't know if this will fix it, or if there is anything else in there that doesn't allow it to be changed.

 

Thoughts?

Link to comment
Share on other sites

...

<script type="text/javascript">var a = <$BlogItemCommentCount$>; if(a == 0) {document.write('No comment');} else if(a == 1)
{document.write('1 comment');} else {document.write(a+' comments');}</script>

 

Where any displayed instance of 'comment' or 'comments' will be changed to what I want. Now the problem is that while I've tested this with dummy sites and managed to have them work, it won't work on the one I want (which for reference its this one). No matter how much I change the code it will retain the original use of the words in English.

 

I've been told the problem could be solved if I placed the new line outside of the <MainPage> and </MainPage> or <ItemPage> and </ItemPage> conditional tags.... Only problem is, I don't know where I should put them. I don't know if this will fix it, or if there is anything else in there that doesn't allow it to be changed.

 

Thoughts?

Sorry, I'm not 100% clear on what the issue is. Are you trying to translate the word "comment" into another language?

 

You can specify the language of any and every XHTML element, e.g.:

<p xml:lang="fr" lang="fr">

 

Or is the javscript code not correctly managing the number of the noun?

:)

OBSCVRVM PER OBSCVRIVS ET IGNOTVM PER IGNOTIVS

ingsoc.gif

OPVS ARTIFICEM PROBAT

Link to comment
Share on other sites

I was trying to replace:

 

<script type="text/javascript">var a = <$BlogItemCommentCount$>; if(a == 0) {document.write('No comment');} else if(a == 1)
{document.write('1 comment');} else {document.write(a+' comments');}</script>

 

with

 

<script type="text/javascript">var a = <$BlogItemCommentCount$>; if(a == 0) {document.write('[b]N
Link to comment
Share on other sites

To add more power to my rejection of claims I'm intelligent, I figured out the problem. There were two "<$BlogItemCommentCount$> comments" lines that needed to be replaced by the new code. It's fixed now, until the next Big Code Fubar.

 

Thanks for the help :thumbsup:

Link to comment
Share on other sites

That's okay (I didn't really do anything) it sometimes helps to explain the problem to someone else, because you are forced to summarise it from first principles, which invaraibly highlights potential hazards and generally leads to a swift and successful conclusion.

 

:blink:

OBSCVRVM PER OBSCVRIVS ET IGNOTVM PER IGNOTIVS

ingsoc.gif

OPVS ARTIFICEM PROBAT

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...