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

Using intro.js in multilingual angular 2 page #693

Closed
peyman-ghasemi opened this issue Mar 12, 2017 · 7 comments
Closed

Using intro.js in multilingual angular 2 page #693

peyman-ghasemi opened this issue Mar 12, 2017 · 7 comments
Labels

Comments

@peyman-ghasemi
Copy link

peyman-ghasemi commented Mar 12, 2017

Hi there !
I am developing a multilingual web page using angular 2 .
I wanted to add some guide for my users using intro.js ( consider that I am using DefinitelyTyped library ) . it is okay when I write my guides in single language for example by this line :

<div data-step="1" data-intro="some text" >

but when I try to have multilingual guides using ng2-translate , I get nothing. here is my code :

<div data-step="1" data-intro=" 'dashboard.welcome' | translate " >

in data-intro property, I have tested combination of {{ }} , " " or ' ' to see if the syntax is wrong but none of them solved my problem. I wonder if some one can help me .

@millerscout
Copy link

millerscout commented Mar 17, 2017

Hello,
intro.js, doesn't watch/observe the attributes after the bind, you need either
refresh intro.js manually or use a service to do so.

a possible solution is: start the intro after binding the translated texts.

i'm currently writing ng2-introjs, you may fork and make what you need.

p.s.: i'm still learning angular 2 on free time, so it's not my main task yet

@peyman-ghasemi
Copy link
Author

thank you for your answer
but in your solution we can not switch between different languages
and angular 2 doesn't allow to use variables.
so restarting intro or moving it into ngAfterInit can not solve multilingual problem.

@vibingopal
Copy link

Hi,

Would you please let me know how you imported intro js module into angular 2 CLI app?

Thanks

@peyman-ghasemi
Copy link
Author

Hi,
I have just adopted javascript library in my angular 2 project.

@khurshed52
Copy link

Try this one

<div data-step="1" [attr.data-intro]=" 'dashboard.welcome' | translate " >

Thanks

@ebarreraso
Copy link

The solution proposed by khurshed52 is the correct one
Just replace data-intro = '' with [attr.data-intro] = ''

@stale
Copy link

stale bot commented Oct 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 13, 2020
@stale stale bot closed this as completed Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants