Closed ghost closed 6 years ago
Will that be <button>Close</button>
in html? That should work out of the box.
It's rendered as:
<button id="btn" data-dojo-type="dojox/mobile/Button" data-dojo-props="label: 'Close'" class="mblButton mblSimpleDialogButton unselectable" localized="" tabindex="0" widgetid="btn" style="user-select: none;">Close</button>
I discovered the translation works only if I remove the attribute data-dojo-props
, placing the text outside the attribute section:
button#btn.mblSimpleDialogButton(data-dojo-type="dojox/mobile/Button") Close
Of course, if I can I will change my code like that. I don't know if Dojo has any caveats on declaring widgets in this way.
You can also try adding data-dojo-props
to the translateAttributes
array on init: https://github.com/i18next/i18nextify#initialize-with-options that way those will get translated too
Yes, but it will translate the whole attribute and it's not very handy because the attribute might contain a lot of other properties, i.e.:
data-dojo-props="iconClass:'dijitEditorIcon dijitEditorIconCut', showLabel: false, label:'Cut'"
and I cannot ask to the translator to maintain all the other fields... and it would be a pain if I need to change any of them.
Anyway, for my current needs, it was enough to fix the syntax as described in the previous post.
Hi, I'm trying to translate a row like this:
button#btn.mblSimpleDialogButton(data-dojo-type="dojox/mobile/Button" data-dojo-props="label: 'Close'")
How would you translate only the 'Close' word?