How do I translate custom buttons and custom buttons in a collection?
How do I translate custom buttons and custom buttons in a collection?
adjenks
Posts: 22Questions: 6Answers: 0
How do I translate custom buttons and custom buttons in a collection?
Here is an example:
http://live.datatables.net/jetucedi/1/
How do I get the "Untranslated" elements to show up as "Translated".
Thank you.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm afraid I don't understand your question. Do you mean you want to translate the column titles in the column visibility collection? If so, that isn't something that is built into Buttons since it is just showing the title text from the columns in your table. You'd need to translate the text there and it would automatically be reflected in the buttons.
Allan
No, nothing about the column titles, or the column data.
I'm referring to the text on the buttons, custom buttons in particular.
If you look in this example:
http://live.datatables.net/jetucedi/2/edit
What configuration do I need to translate the untranslated custom buttons? I thought that the "name" key of a button was the translation reference key. But it appears not to be.
Thank you for your feedback.
No, it shouldn't since you have explicitly set it to be:
text: "Colection Demo Untranslated",
.If you want it to take the value from your
language.buttons
object, you should use:http://live.datatables.net/jetucedi/3/edit
The same applies to the other points.
Regards,
Allan
Oh! Fabulous. I didn't realize that it could accept a function. I was wondering how to use the i18n function if the table didn't exist yet, but now I understand.
I now see: https://datatables.net/reference/option/buttons.buttons.text
I thought that text was the fallback text if i18n text was not available and name was the key. My mistake, I don't know why I thought that.
Thank you very much.