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

クリボウの Blogger Tips

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

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

1 comments に違和感がある人に

Posted at: 2005-07-22 87

投稿されたそれぞれの記事の最後には 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:87

  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. 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
  8. 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
  9. 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
  10. I went over this website and I believe you have a lot of wonderful information, saved to my bookmarks 토토사이트

    ReplyDelete
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. ou need to be a part of a contest for one of the highest quality sites on the 토토사이트. I most certainly will recommend this site!

    ReplyDelete
  27. 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
  28. This is one very interesting post. I like the way you write and I will bookmark your blog to my favorites.메이저놀이터

    ReplyDelete
  29. I really thank you for the valuable info on this great subject and look forward to more great posts. ufabet168

    ReplyDelete
  30. Great work! That is the type of information that are meant to be shared
    around the net. Shame on the seek engines for no longer positioning this publish upper!
    Come on over and discuss with my site . Thanks
    =)

    Here is my webpage; 부산오피


    ReplyDelete
  31. Looking at this article, I miss the time when I didn't wear a mask. 먹튀검증업체 Hopefully this corona will end soon. My blog is a blog that mainly posts pictures of daily life before Corona and landscapes at that time. If you want to remember that time again, please visit us.

    ReplyDelete
  32. I've been looking for photos and articles on this topic over the past few days due to a school assignment, Bóngđộ and I'm really happy to find a post with the material I was looking for! I bookmark and will come often! Thanks :D

    ReplyDelete
  33. Personally I think overjoyed I discovered the blogs. I would recommend my profile is important to me, I invite you to discuss this topic. ufabet168

    ReplyDelete
  34. I like your blogs, they are authentic and full of useful materials. Good job, Impressive work, Keep it up. ufabet168

    ReplyDelete
  35. I've been searching for hours on this topic and finally found your post. Tàixỉu, 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
  36. Easily, the article is actually the best topic on this related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantastic lucidity in your writing. ยูฟ่า168

    ReplyDelete
  37. I’m very happy to discover this web site. I need to to thank you for ones time for this particularly wonderful read!! I definitely enjoyed every part of it and i also have you book-marked to check out new information on your web site. 안전놀이터순위

    ReplyDelete
  38. I'm writing on this topic these days, , but I have stopped writing because there is no reference material. Then I accidentally found your article. I can refer to a variety of materials, so I think the work I was preparing will work! Thank you for your efforts. 먹튀사이트

    ReplyDelete
  39. Kansas City General Contractor
    We are a General Contractor in Kansas City specializing in tenant fit-ups, metal stud and drywall fit-ups. Bathroom Remodel Kansas City

    ReplyDelete
  40. First of all, thank you for your post. Your posts are neatly organized with the information I want, so there are plenty of resources to reference. I bookmark this site and will find your posts frequently in the future. Thanks again ^^ phimsex

    ReplyDelete
  41. When you make a decision to install an inground pool, the next step is figure out what the finish around the pool is going to look like. Concrete company

    ReplyDelete
  42. Hi there, I simply hopped over in your website by way of StumbleUpon. Now not one thing I’d typically learn, but I favored your emotions none the less. Thank you for making something worth reading. 먹튀검증업체

    ReplyDelete
  43. Hello, I read the post well. 안전놀이터추천 It's a really interesting topic and it has helped me a lot. In fact, I also run a website with similar content to your posting. Please visit once

    ReplyDelete
  44. Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job! 메이저토토사이트 Thank you very much. Can I refer to your post on my website? Your post touched me a lot and helped me a lot. If you have any questions, please visit my site and read what kind of posts I am posting. I am sure it will be interesting.

    ReplyDelete
  45. Nice post. I learn something totally new and challenging on blogs I stumbleupon everyday. It’s always useful to read through content from other authors and use something from other sites. alobong88

    ReplyDelete
  46. 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
  47. Great article, Thanks for writing about that. It’s really helpful for me. Keep it up your writing. www.concretecontractorsinhouston.com

    ReplyDelete
  48. Yes, this is a good post without any doubts. You really do a great job. I inspired by you. So keep it up!! www.sanfranciscoconcretecontractor.com

    ReplyDelete
  49. Yes, this is a good post without any doubts. You really do a great job. I inspired by you. So keep it up!! http://www.bakersfieldconcretecontractors.com

    ReplyDelete
  50. You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. www.alamedaplumbingcontractors.com/

    ReplyDelete
  51. Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job.
    토토사이트
    경마
    온라인경마

    ReplyDelete
  52. What’s up, just wanted to mention, I liked
    this post. It was practical. Keep on posting!
    바카라
    사설토토

    ReplyDelete
  53. 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
  54. Many thanks for the article, I have a lot of spray lining knowledge but always learn something new. Keep up the good work and thank you again. 메이저사이트모음

    ReplyDelete
  55. Hello, I am one of the most impressed people in your article. sòng bạc I'm very curious about how you write such a good article. Are you an expert on this subject? I think so. Thank you again for allowing me to read these posts, and have a nice day today. Thank you.


    ReplyDelete
  56. Thanks for sharing! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. www.kcityconcretecontractors.com/

    ReplyDelete
  57. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. life insurance for terminally ill

    ReplyDelete
  58. When I read your article on this topic, the first thought seems profound and difficult. There is also a bulletin board for discussion of articles and photos similar to this topic on my site, but I would like to visit once when I have time to discuss this topic. sòng bạc


    ReplyDelete
  59. 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
  60. Good morning!! I am also blogging with you. In my blog, articles related to are mainly written, and they are usually called 메이저사이트. If you are curious about , please visit!!

    ReplyDelete
  61. I’m very pleased to discover this site. I want to to thank you for ones time for this particularly wonderful read! come my web site only 안전놀이터

    ReplyDelete
  62. is one very interesting post. 메이저사이트I like the way you write and I will bookmark your blog to my favorites.


    ReplyDelete
  63. Totosite has various subscription codes depending on the ability of the verification site. The safety code of a food and dash verification expert provides the most reliable environment to use Totosite games in private Toto.
    사이트 주소

    ReplyDelete
  64. This Game in Korea is a game where the winning amount is paid out at a dividend rate after investing in online sports betting. Sports betting is available on Toto sites, which focus on popular sports games such as Overseas Soccer, MLB and NBA.
    good website

    ReplyDelete
  65. Toto Game in Korea is a game in which the winning amount is paid according to the dividend rate after investing in betting money online in sports games. Sports betting is available on Toto sites, focusing on famous sports games such as overseas soccer, MLB, and NBA.
    visit now

    ReplyDelete
  66. 엠카지노 카지노사이트 온라인카지노 Dealer Role-play | Personal Attention | Trigger Sounds

    ReplyDelete
  67. his is very interesting, You are a very skilled blogger. I've joined your rss feed and look forward to seeking more of your wonderful site info for you 사설토토

    ReplyDelete
  68. Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, nice info for you 신불자대출

    ReplyDelete
  69. I finally found what I was looking for! I'm so happy. 사설토토사이트 Your article is what I've been looking for for a long time. I'm happy to find you like this. Could you visit my website if you have time? I'm sure you'll find a post of interest that you'll find interesting.

    ReplyDelete
  70. Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. 먹튀검증

    ReplyDelete
  71. Excellent blog you have here.. It's hard to find good quality writing like yours these days. I truly appreciate individuals like you! Take care! 사설토토사이트

    ReplyDelete
  72. Interesting! I was thinking the same thing as you. Your article explains my vague thoughts very clearly. Thank you. I have a lot of interesting ideas. I want you to look at the post I wrote :D 먹튀검증사이트

    ReplyDelete
  73. It’s relaxing to think, hanging out with your family while drinking your favorite beverage on your patio. Or splashing water on your newly built swimming pool surrounded by pavers. | Patio Paver Services

    ReplyDelete
  74. We have a skilled number of contractor who can help you mend and fix you broken and leaking gutter. | Patio Paver Services

    You can also visit here Book Gutter Cleaning

    ReplyDelete
  75. Identifying what types of reverse mortgage is right for you. Is proprietary reverse mortgage suits you? | Proprietary Reverse Mortgage

    See more here
    Proprietary Reverse Loan

    ReplyDelete
  76. Looking for an affordable and effective options to for full or partial dentures? Here at our dental clinic we can help you achieve the naturally looking smile you've been missing. - Book appointment

    Visit our partner site check website

    ReplyDelete
  77. Contact Us today for an immediate appointment request. - Immediate Denture Tulsa

    You can also our friends at Denture Repair

    ReplyDelete
  78. I get pleasure from, cause I found just what I used to be having a look for.
    You’ve ended my four day long hunt! God Bless you man. Have a nice day.

    카지노사이트

    ReplyDelete

Comments on Google+:

© 2005-2014 Kuribo. Powered by Blogger.