>
1 comments に違和感がある人に
を書き、コメント数表記(
と書くことにしました(改行なしの1行です)。
コメント数による条件分岐の部分を使いまわして、ちょっとでもページのサイズを小さくしようという魂胆なのでした。
ちなみに上記赤字の部分を false に変えると、No Comment のように単語の頭が大文字になります。クリボウはメイン・アーカイブページと、アイテムページとで、(あまり意味はないけれど)大文字小文字を使い分けています。
スポンサードリンク:
お願い:
投稿されたそれぞれの記事の最後には 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>
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 のように単語の頭が大文字になります。クリボウはメイン・アーカイブページと、アイテムページとで、(あまり意味はないけれど)大文字小文字を使い分けています。
スポンサードリンク:
「この記事役に立った!」と思ったら、ぜひフィード登録をお願いします。
初めまして。さくらと申します。
ReplyDeleteこれずっと探していたのです!
海外のサイトで一度だけ直っているサイトをちらっとみかけたのですが、どこだったかわからなくなってしまって検証できずじまいで忘れてしまっていました。
クリボウ様に本当に感謝しております。
ありがとうございました。
どういたしまして。
ReplyDelete自分の書いた記事が人の役に立ったようで、僕もうれしいです。
コメントありがとうございます。
This comment has been removed by the author.
ReplyDeleteはじめまして。ボンボンバカボンと申します。
ReplyDelete> コメント数表記(<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>
にあたるかと思うのですが...
どうぞ、よろしくお願いします。
This comment has been removed by the author.
ReplyDeleteEarlier 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
ReplyDeletemulberry bags
ReplyDeletejuicy couture tracksuit
toms outlet
louis vuitton outlet stores
ugg outlet
montblanc pens
coach outlet online
adidas wings
longchamp
ugg outlet online
jianbin1206
ReplyDeletemulberry bags
juicy couture tracksuit
toms outlet
louis vuitton outlet stores
ugg outlet
montblanc pens
coach outlet online
adidas wings
longchamp
ugg outlet online
20170523 junda
ReplyDeletelongchamp handbags
michael kors outlet
camisetas futbol baratas
oakley sunglasses sale
longchamp outlet
coach outlet
nike shoes
louis vuitton outlet
cleveland cavaliers jerseys
louis vuitton
ReplyDeleteคาสิโนออนไลน์
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! 메이저놀이터
ReplyDeleteI 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
ReplyDeleteI went over this website and I believe you have a lot of wonderful information, saved to my bookmarks 토토사이트
ReplyDeleteI 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 토토사이트
ReplyDeleteHello ! 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?
ReplyDeleteI am just pretty happy to sign up ones부산오피
ReplyDeleteown 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.
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! 야플렉스
ReplyDeletecome on!
Nice Blog. Thanks for sharing with us. Such amazing information.
ReplyDeleteOnly Blog
Guest Blogger
Guest Blogging Site
Guest Blogging Website
Guest Posting Site
curry shoes
ReplyDeleteyeezy 350
kyrie 6 shoes
retro jordans
curry 5 shoes
golden goose
jordan shoes
jordan shoes
kyrie 7
curry 6
I really thank you for the valuable info on this great subject and look forward to more great posts. ufabet168
ReplyDeleteGreat work! That is the type of information that are meant to be shared
ReplyDeletearound 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; 부산오피
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
ReplyDeleteI like your blogs, they are authentic and full of useful materials. Good job, Impressive work, Keep it up. ufabet168
ReplyDeleteThank you for this nice sharing. 온라인슬롯
ReplyDeleteEasily, 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
ReplyDeleteKansas City General Contractor
ReplyDeleteWe are a General Contractor in Kansas City specializing in tenant fit-ups, metal stud and drywall fit-ups. Bathroom Remodel Kansas City
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
ReplyDeleteHi 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. 먹튀검증업체
ReplyDeleteI'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.
ReplyDeleteGreat article, Thanks for writing about that. It’s really helpful for me. Keep it up your writing. www.concretecontractorsinhouston.com
ReplyDeleteYes, 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Đặt vé máy bay tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ khứ hồi
khi nào có vé máy bay từ mỹ về việt nam
vé máy bay từ đức về việt nam giá rẻ
vé máy bay từ nga về tphcm
bay từ anh về việt nam
máy bay từ pháp về việt nam
Chuyen bay cho chuyen gia nuoc ngoai
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
ReplyDeleteYou 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/
ReplyDeleteThank 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토토사이트
경마
온라인경마
What’s up, just wanted to mention, I liked
ReplyDeletethis post. It was practical. Keep on posting!
바카라
사설토토
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.
ReplyDeleteThanks for sharing! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. www.kcityconcretecontractors.com/
ReplyDeleteThis 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
ReplyDeleteWhen 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
ReplyDeleteI’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 안전놀이터
ReplyDeleteis one very interesting post. 메이저사이트I like the way you write and I will bookmark your blog to my favorites.
ReplyDeleteTotosite 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사이트 주소
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.
ReplyDeletegood website
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.
ReplyDeletevisit now
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 사설토토
ReplyDeleteThank 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 신불자대출
ReplyDeleteExcellent 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. 먹튀검증
ReplyDeleteExcellent blog you have here.. It's hard to find good quality writing like yours these days. I truly appreciate individuals like you! Take care! 사설토토사이트
ReplyDeleteInteresting! 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 먹튀검증사이트
ReplyDeleteHow the 스윗포인트 Takes Your Money
ReplyDeleteIt’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
ReplyDeleteWe have a skilled number of contractor who can help you mend and fix you broken and leaking gutter. | Patio Paver Services
ReplyDeleteYou can also visit here Book Gutter Cleaning
Identifying what types of reverse mortgage is right for you. Is proprietary reverse mortgage suits you? | Proprietary Reverse Mortgage
ReplyDeleteSee more here
Proprietary Reverse Loan
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
ReplyDeleteVisit our partner site check website
Contact Us today for an immediate appointment request. - Immediate Denture Tulsa
ReplyDeleteYou can also our friends at Denture Repair
I get pleasure from, cause I found just what I used to be having a look for.
ReplyDeleteYou’ve ended my four day long hunt! God Bless you man. Have a nice day.
카지노사이트