pepelsbey / darkbox

Simple but powerful jQuery plugin for viewing images
http://pepelsbey.github.com/darkbox/
79 stars 12 forks source link

Locale detection for the close button title #2

Open pepelsbey opened 14 years ago

pepelsbey commented 14 years ago

Current code:

<div class="darkbox-button" title="Close"></div>

It could be localized via UA string sniffing. Or even better, via <html lang="en-US"> attribute. English will be fallback in lack of lang attribute.

jahson commented 14 years ago

There is serious differences in these methods. UA sniffing will detect locale of browser user. lang attribute from <html lang="en-US"> will determine locale for site. So, we need to decide which one is better.

pepelsbey commented 14 years ago

I would prefer lang="en-US" method because DarkBox script is a part of a site, but not browser.

jahson commented 14 years ago

If DarkBox is part of a site then there is another way - make close button title customizable via options $( 'a[rel=darkbox] ).darkbox({ closeButtonTitle: 'С глаз долой' }); with english variant as default title. But this way will require some actions from DarkBox users.

nashbridges commented 13 years ago

Please review my PR, It covers this issue.