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

クリボウの Blogger Tips

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

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

1 comments に違和感がある人に

Posted at: 2005-07-22 58

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

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

    ReplyDelete
  10. 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
  11. 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
  12. 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
  13. 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
  14. I really thank you for the valuable info on this great subject and look forward to more great posts. ufabet168

    ReplyDelete
  15. 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
  16. 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
  17. I like your blogs, they are authentic and full of useful materials. Good job, Impressive work, Keep it up. ufabet168

    ReplyDelete
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. Great article, Thanks for writing about that. It’s really helpful for me. Keep it up your writing. www.concretecontractorsinhouston.com

    ReplyDelete
  24. 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
  25. 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
  26. 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
  27. 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
  28. What’s up, just wanted to mention, I liked
    this post. It was practical. Keep on posting!
    바카라
    사설토토

    ReplyDelete
  29. 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
  30. 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
  31. 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
  32. 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
  33. 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
  34. is one very interesting post. 메이저사이트I like the way you write and I will bookmark your blog to my favorites.


    ReplyDelete
  35. 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
  36. 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
  37. 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
  38. 엠카지노 카지노사이트 온라인카지노 Dealer Role-play | Personal Attention | Trigger Sounds

    ReplyDelete
  39. 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
  40. 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
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. Contact Us today for an immediate appointment request. - Immediate Denture Tulsa

    You can also our friends at Denture Repair

    ReplyDelete
  49. 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.