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

Translation of button captions to other languages #108

Closed
ilkerarslan opened this issue Aug 2, 2017 · 3 comments
Closed

Translation of button captions to other languages #108

ilkerarslan opened this issue Aug 2, 2017 · 3 comments

Comments

@ilkerarslan
Copy link

I am trying to prepare R tutorials in Turkish but I couldn't find a way to translate button captions like ""Run Code", "Solution", "Start Over" etc. I believe it would be great if there was a way to customize these labels.

@HeidiSeibold
Copy link

I'd be interested in that, too 👍

@takewiki
Copy link

@ilkerarslan @HeidiSeibold I have solved this problem by modifying the file:
learnr -->inst-->lib-->tutorial-->tutorial.js
1)change caption for Run Code button:
original code (near line 901 )
var run_button = add_submit_button("fa-play", "btn-success", "Run Code", false);
modified one :
' var run_button = add_submit_button("fa-play", "btn-success", "your_caption_text_here1", false);'
2) change caption for Solution/Hint buttion
original code (near line 1135)
var button = addHintButton(caption);
modified one
var button = addHintButton('your_caption_text_here2');
3)change caption for Start Over
original code (near line 1067)
var startOverButton = addHelperButton("fa-refresh", "Start Over");
modified one
'var startOverButton = addHelperButton("fa-refresh", "your_caption_text_here3");'

the final result for buttion caption translated into chinese as follow:
buttion_caption_in_chinese

@gadenbuie
Copy link
Member

Support for internationalization was added in #456 with help from @ColinFay!

We currently provide English and French translations and would happily accept translations for other languages as well. If you would like to contribute a translation for your native language, please read vignette("multilang", package = "learnr") for instructions, or submit a PR modifying i18n_translations() following the example for English.

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

No branches or pull requests

4 participants