>--> 1 comments に違和感がある人に | クリボウの Blogger Tips

クリボウの Blogger Tips

Google Blogger の使い方、カスタマイズ方法、各種ツールなど、
Blogger 関連の役立つ情報を紹介しています。

> 1 comments に違和感がある人に

1 comments に違和感がある人に

Posted at: 2005-07-22 79

投稿されたそれぞれの記事の最後には 0 comments, 1 comments, 2 comments という風に、コメント数が表示されていますよね。
これを正しい英語にこだわって、ブログ上でも no comment, 1 comment, 2 comments と表記させようというのが今回の目的。

といってもクリボウが考えたのではないのです。
僕としてはそんなに 1 comments に違和感も感じず、したがって問題意識もナシナシなのですが、やはり海外の人でこれにこだわっている人がいます。

BLOGGER TEMPLATES > Personalize the comments link

ここでは JavaScript の変数 a にコメント数を代入して、その a によって表記を切り替えるということをしています。
このコメント数を代入、というところでテンプレートタグが使われているんですね。

この仕組みを使うときには、BloggerHacks-ja さんが紹介されているように、<noscript> を書いて、JavaScript が OFF の場合に従来の表記をさせるということも大事かと思います。


従来の表記に違和感を感じないと書きつつ、カッコつけて取り入れてみたクリボウでした。

ちなみに、<a> の中の改行は 1 comment  の最後のように、ブラウザによってはスペースとして扱われる場合があるので、注意が必要かと。


追記

結局、クリボウの場合は <head> 内に

<script type="text/javascript">
  function writeCommentCount(cnt,low) {
    var str = ((cnt == 0)? "No":"" + cnt) + " Comment" + ((cnt > 1)? "s":"");
    if (low) str = str.toLowerCase();
    document.write(str);
  }
</script>

を書き、コメント数表記(<a> の中)の部分には

<script type="text/javascript">writeCommentCount(<$BlogItemCommentCount$>,true);</script><noscript><$BlogItemCommentCount$> comments</noscript>

と書くことにしました(改行なしの1行です)。
コメント数による条件分岐の部分を使いまわして、ちょっとでもページのサイズを小さくしようという魂胆なのでした。

ちなみに上記赤字の部分を false に変えると、No Comment のように単語の頭が大文字になります。クリボウはメイン・アーカイブページと、アイテムページとで、(あまり意味はないけれど)大文字小文字を使い分けています。


スポンサードリンク:
お願い:
「この記事役に立った!」と思ったら、ぜひフィード登録をお願いします。 

Comments:79

  1. 初めまして。さくらと申します。
    これずっと探していたのです!
    海外のサイトで一度だけ直っているサイトをちらっとみかけたのですが、どこだったかわからなくなってしまって検証できずじまいで忘れてしまっていました。
    クリボウ様に本当に感謝しております。
    ありがとうございました。

    ReplyDelete
  2. どういたしまして。
    自分の書いた記事が人の役に立ったようで、僕もうれしいです。
    コメントありがとうございます。

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. はじめまして。ボンボンバカボンと申します。

    > コメント数表記(<a> の中)の部分には

    ><script type="text/javascript">writeCommentCount(<$BlogItemCommentCount$>,true);</script><noscript><$BlogItemCommentCount$> comments</noscript>

    >と書くことにしました(改行なしの1行です)。

    とのことですが、「<a>の中の部分」をもう少し詳しく教えて頂けないでしょうか? 私のでは、

    <a class='comment-link' expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'><b:if
    cond='data:post.numComments == 1'>1 <data:top.commentLabel/><b:else/><data:post.numComments/> <data:top.commentLabelPlural/></b:if></a>

    にあたるかと思うのですが...

    どうぞ、よろしくお願いします。

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Earlier this week we reported that menswear designer John Elliott was working on a special NIKEiD of the Nike LeBron Soldier X (10). Today, the shoe was officially unveiled by Nike with some words from John Elliott on LeBron James.John Elliott first worked on a Cheap KD Shoes LeBron shoe in 2015 with the Nike LeBron 12. The designer featured his work, an all white take of LeBron’s twelfth signature model, in his debut to the New York NBA Store fashion runway. Elliott’s second chance to work on a LeBron shoe comes with the opportunity to work on the Nike LeBron Soldier X. This release marks yet another date in Kobe 9 history as the shoe will be one of the exclusive releases to be sold at Nike’s new New York SoHo store. The Nike LeBron Soldier X by John Elliott features KD Trey 5 a white mesh upper, sublimation print on the upper straps, 3M tabs, a glow in the dark outsole, and orange accents. On the insoles, John Elliott and NIKEiD can be LeBron soldier 9 seen printed on each foot.Elliott noticed LeBron James well before his signature shoe days and shares with Nike his past experiences.I remember being in college and watching his high school KD 7 games like with my friends in like small, almost like dorm-room, style apartments. Watching a high school kid thinking — you know, because I played at junior college — “Wow, Curry Shoes I can’t believe all of us are literally huddled watching this high school kid.” The stuff that he did…it was undeniable that he was going to be a transformative athlete KD 6 even when he was in high school.He was “can’t miss.” And, stylistically, he bridged the gap between the previous generation of athletes and a new era. He has been in Jordan Shoes my basketball life for over a decade, and sometimes when I think back to where it all started, it can take me back to those college apartments. It’s kind of LeBron 13 cool.I bought the Zoom Generation. I think it was the first time for me in my life that I ever bought a shoe made for someone who was younger than Golden State Warriors Jerseys me. I can remember thinking like, “Whoa. This is a real paradigm shift.” The LeBron 8 is definitely a favorite of mine too. I had friends that hooped Curry 3

    ReplyDelete



  7. شركة تنظيف خزانات بالمدينة المنورة وشقق بالمدينة المنورة شركة غسيل خزانات ومكافحة حشرات بالمدينة المنورة ونقل عفش بالمدينة المنورة مؤسسة صفوة المدينة
    شركة تنظيف خزانات بالمدينة المنورة
    تنظيف خزانات بالمدينة المنورة
    http://www.atar-almadinah.com/cleaning-medina.html
    شركة تنظيف خزانات بالمدينة المنورة

    ReplyDelete
  8. Vantaggi dell'esternalizzazione dei servizi di pulizia commerciale
    شركة صيانة وغسيل المكيفات بالرس
    شركة غسيل مكيفات بالقصيم
    شركة تنظيف مكيفات بالقصيم
    شركة تنظيف وصيانة مكيفات بعنيزة
    Quando assumi un detergente per la residenza ci sono cose specifiche che dovresti essere pronto a fare insieme ad altre cose che vanno ben oltre ciò che dovresti aspettarti. La maggior parte delle grandi catene di pulizie domestiche sono troppo costose e non si sa mai chi arriva in casa da un giorno all'altro. Pulizia dell'ufficio, pulizia della finestra di casa o diramazione verso un organizzatore specializzato. Un'azienda di questo tipo è specializzata nel mantenere pulita una casa con l'aiuto di un semplice furgone, di un ottimo equipaggiamento (paletta, spazzola, aspirapolvere, ecc.) E di un personale qualificato.
    أسعار شركات تنظيف المكيفات ببريدة
    شركة تصليح مكيفات ببريدة
    شركة تنظيف وصيانة المكيفات بالبكيرية
    شركة غسيل وصيانة مكيفات بالبدائع

    ReplyDelete
  9. Hello ^^
    The season when the car winds are back.
    Are you all working hard to prepare for your visit to Korea? Beware of colds and beware of corona
    I came in to see your site and I liked a lot of useful and good content!
    I also run a site, so will you come and see it?
    I think I would be very grateful for your feedback. Bye^^
    My site address: 토토사이트

    ReplyDelete
  10. I have read your excellent post. This is a great job. I have enjoyed reading your post first time. I want to say thanks for this post. Thank you... 먹튀검증

    ReplyDelete
  11. Amazing experience after visiting this site which is really full of information and someone have information for.And also you could buy some cosplay costumes from http://www.cosjj.com/ in high quality. news update for latest updates in urdu language this is best . Just have fun. 메이저사이트

    ReplyDelete
  12. Interesting and interesting information can be found on this topic here profile worth to see it. 먹튀검증커뮤니티

    ReplyDelete
  13. Wow, superb blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your site is magnificent, as well as the content! 메이저놀이터

    ReplyDelete
  14. I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help buy web traffic

    ReplyDelete
  15. I have read your article, it is very informative and helpful for me. I admire the valuable information you offer in your articles. Thanks for posting it 먹튀폴리스

    ReplyDelete
  16. I went over this website and I believe you have a lot of wonderful information, saved to my bookmarks 토토사이트

    ReplyDelete
  17. I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post 토토사이트

    ReplyDelete
  18. I got a web site from where I be capable of really obtain valuable information regarding my study and knowledge.
    Great Article… Good Job… Thanks For Sharing…

    Website:풀싸롱

    ReplyDelete
  19. Hello! Nice to meet you, I say . The name of the community I run is 안전놀이터, and the community I run contains articles similar to your blog. If you have time, I would be very grateful if you visit my site .

    ReplyDelete
  20. My curiosity was solved by looking at your writing. Your writing was helpful to me.카지노사이트I want to help you too.

    ReplyDelete
  21. Good day! This post could not be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this page to him. Pretty sure he will have a good read. Thanks for sharing. 먹튀검증

    ReplyDelete
  22. Hello
    Thank you for giving me useful information.
    Please keep posting good information in the future
    I will visit you often. Thank you.
    I am also running the site. 안전놀이터 This is a related site, so please visit once.
    Have a niceday!

    ReplyDelete
  23. Thank you and thank you so much. I'll share you useful information.토토사이트

    ReplyDelete
  24. I accidentally searched and visited your site. I still saw several posts during my visit, but the text was neat and readable. I will quote this post and post it on my blog. Would you like to visit my blog later? 온라인홀덤

    ReplyDelete
  25. Congratulation for this successful project. 토토사이트 Can you please share some pictures of the your project. I am going to share this post with my friends.

    ReplyDelete
  26. It was an awesome post to be sure. I completely delighted in understanding it in my noon. Will without a doubt come and visit this blog all the more frequently. A debt of gratitude is in order for sharing. 토토사이트

    ReplyDelete
  27. Hello
    Thank you for giving me useful information.
    Please keep posting good information in the future
    I will visit you often. Thank you.
    I am also running the site. 메이저놀이터 This is a related site, so please visit once.
    Have a niceday!

    ReplyDelete
  28. As soon as I noticed this internet site I went on reddit to share some of the love with them. 안전놀이터

    ReplyDelete
  29. Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and 안전놀이터 has same topic together with your article. Thanks, nice share.Hello ! I am a student writing a report on the subject of your post.Your article is an article with all the content and topics. I've ever wanted . Thanks to this, it will be of great help to the report I am preparing now.Thanks for your hard work. And if you have time, please visit my site as well. The site name is 토토사이트.

    ReplyDelete
  30. Your article was very impressive to me. It was unexpected information,but after reading it like this 메이저토토사이트, I found it very interesting.I think a lot of articles related to 메이저사이트 are disappearing someday. That's why it's very hard to find, but I'm very fortunate to read your writing. When you come to my site, I have collected articles related to this. My site name is .

    ReplyDelete
  31. This is a very interesting post. Thank you for posting a lot of interesting posts. And please visit my site!~! The name of the site is 안전놀이터.

    ReplyDelete
  32. I am very impressed with your writing온라인포커 I couldn't think of this, but it's amazing! I wrote several posts similar to this one, but please come and see!

    ReplyDelete
  33. I've been troubled for several days with this topic. 토토사이트, But by chance looking at your post solved my problem! I will leave my blog, so when would you like to visit it?

    ReplyDelete
  34. I will bookmark this site and come to it from time to time. Your writing has been of great help to me.먹튀신고

    ReplyDelete
  35. Hello ! I am the one who writes posts on these topics 메이저놀이터 I would like to write an article based on your article. When can I ask for a review?

    ReplyDelete
  36. It's always a pleasure to read your magnificent articles on this site. You are among the top writers of this generation, and there's nothing you can do that will change my opinion on that. My friends will soon realize how good you are. 토토사이트

    ReplyDelete
  37. It's very interesting. And it's fun. This is a timeless article. I also write articles related to , and I run a community related to 안전놀이터. For more information, please feel free to visit !!

    ReplyDelete
  38. I am just pretty happy to sign up ones부산오피

    own guestbook these days,Your own feedback and listed below are excellent in my opinion,incidentally I should say also definitely will teach some great supplements for your needs every.

    ReplyDelete
  39. Youre so right. Im there with you. Your weblog is definitely worth a read if anyone comes throughout it. Im lucky I did because now Ive received a whole new view of this. 토토사이트

    ReplyDelete
  40. Thank you and thank you so much. I'll share you useful information.토토사이트

    ReplyDelete
  41. Hello
    Thank you for giving me useful information.
    Please keep posting good information in the future
    I will visit you often. Thank you.
    I am also running the site. 메이저놀이터 This is a related site, so please visit once.
    Have a niceday!

    ReplyDelete
  42. Your ideas inspired me very much. 토토커뮤니티It's amazing. I want to learn your writing skills. In fact, I also have a website. If you are okay, please visit once and leave your opinion. Thank you.

    ReplyDelete
  43. I learned a lot from you.토토사이트 I have a hobby similar to yours.

    ReplyDelete
  44. Hey, you used to write fantastic, but the last several posts have been kinda boring… I miss your tremendous writings. Past several posts are just a little bit out of track! 야플렉스

    come on!

    ReplyDelete
  45. I will bookmark this site and come to it from time to time. Your writing has been of great help to me.먹튀신고

    ReplyDelete
  46. This is the perfect post. It helped me a lot. If you have time, 토토사이트 I hope you come to my site and share your opinions. Have a nice day.

    ReplyDelete
  47. I’m very pleased to discover this site. I want to to thank you for ones time for this particularly wonderful read!! I definitely savored every part of it and i also have you saved as a favorite to see new information on your blog. 토토사이트

    ReplyDelete
  48. I am very impressed with your writing 메이저놀이터 I couldn't think of this, but it's amazing! I wrote several posts similar to this one, but please come and see!

    ReplyDelete
  49. We stumbled over here by a different website and thought I might check things out. I like what I see so now i am following you. Look forward to finding out about your web page again. 안전놀이터

    ReplyDelete
  50. I found the answer I was looking for in your article. I'm going to quote your article and write it on a blog. 바카라사이트

    ReplyDelete
  51. Your information was very useful to me. That's exactly what I've been looking for 카지노사이트!

    ReplyDelete
  52. When I read an article on this topic, 온라인바둑이 the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

    ReplyDelete
  53. When did it start? The day I started surfing the Internet to read articles related to . I've been fond of seeing various sites related to 안전놀이터 around the world for over 10 years. Among them, I saw your site writing articles related to and I am very satisfied.

    ReplyDelete
  54. That's a really good piece of writing. It's been a lot of help. I'll help you.토토사이트

    ReplyDelete
  55. The assignment submission period was over and I was nervous, 메이저놀이터 and I am very happy to see your post just in time and it was a great help. Thank you ! Leave your blog address below. Please visit me anytime!

    ReplyDelete
  56. I've been searching for hours on this topic and finally found your post. 먹튀검증, I have read your post and I am very impressed. We prefer your opinion and will visit this site frequently to refer to your opinion. When would you like to visit my site?

    ReplyDelete
  57. Simply unadulterated brilliance from you here. I have never expected something not as much as this from you and 먹튀검증 have not confounded me by any reach out of the inventive vitality. I acknowledge you will keep the quality work going on.

    ReplyDelete
  58. First of all, thank you for letting me see this information. I think this article can give me a lot of inspiration. I would appreciate 메이저토토사이트 if you could post more good contents in the future.

    ReplyDelete
  59. What a post I've been looking for! I'm very happy to finally read this post about 메이저사이트. Thank you very much. Your post was a great help to me. If you are interested in the column I wrote, I would appreciate it if you visit my site .

    ReplyDelete
  60. I have been looking for articles on these topics for a long time. 먹튀검증 I don't know how grateful you are for posting on this topic. Thank you for the numerous articles on this site, I will subscribe to those links in my bookmarks and visit them often. Have a nice day.

    ReplyDelete
  61. I'm so happy to finally find a post with what I want. You have inspired me a lot. If you are satisfied, 토토사이트 please visit my website and leave your feedback.

    ReplyDelete
  62. Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. 온라인포커

    ReplyDelete
  63. I was looking for another article by chance and found your article 토토사이트 I am writing on this topic, so I think it will help a lot. I leave my blog address below. Please visit once.!

    ReplyDelete
  64. In the meantime, I wondered why I couldn't think of the answer to this simple problem like this. Your article is an article that gives the answer to all the content I've been contemplating. 메이저토토사이트

    ReplyDelete

Comments on Google+:

© 2005-2014 Kuribo. Powered by Blogger.