Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data-original-content and data-original-title #92

Closed
rmalenko opened this issue Jun 3, 2013 · 3 comments
Closed

Add data-original-content and data-original-title #92

rmalenko opened this issue Jun 3, 2013 · 3 comments

Comments

@rmalenko
Copy link

rmalenko commented Jun 3, 2013

Hi!
May you add possibility to use 'data-original-content' and 'data-original-title' like bootstrap options?
I think it make more simply to use a translation method in html for multilingual sites.

Regards,
Rostyslav

@ghost ghost assigned LostCrew Jun 4, 2013
@LostCrew
Copy link
Contributor

LostCrew commented Jun 4, 2013

hi rmalenko,

i'm sorry, i personally don't really understand the question. the reason why bootstrap swap the attribute title to data-original-title is because browsers create native tooltips and they would interfere with the custom popover/tooltip shown.
it would be better for me to understand if you provide me a real-case. thanks.

@rmalenko
Copy link
Author

rmalenko commented Jun 5, 2013

Hi LostCrew,

Our developers use Kohana. I made a lot of popover to use bootstrap. Popover have options data-content= which can be used in html. Exsample:
<a href="#" id="example" class="btn btn-success" rel="popover" data-content="It's so simple ....!" data-original-title="Twitter Bootstrap Popover">hover for popover</a>
Our project is multilingual. If I want I should use like this code for translation:
<a href="#" id="example" class="btn btn-success" rel="popover" data-content="<?php echo __('It's so simple ....!'); ?>"" data-original-title="<?php echo __('Twitter Bootstrap Popover'); ?>"">hover for popover</a>

Unfortunately I can't add this code <?php echo __('Twitter Bootstrap Popover'); ?>"
directly into

...
        title: lang.bartertourone_t,
        content: lang.bartertourone_m,
...
        }); 

I should write additional method for translate and insert into bootstrap tour although use data-content= from html code may be simple way.

@emmenko
Copy link
Contributor

emmenko commented Jun 11, 2013

You could just simply inject it in the constructor that way:

tour.addStep({
  element: "#example",
  title: $("#example").data("original-title"),
  content: $("#example").data("content")
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants