0

Is it possible to use i18next with razor? If not, any other ideas about how to translate labels using razor? The only option I think is to keep the html tags instead of razor.

Example:

@Html.LabelFor( model => model.Name, new { @class = "control-label col-md-3", @data-18n = "test.name" } )

It gives me an error on @data-i18n saying it does not exists in the current context.

Will
  • 307
  • 4
  • 12
  • Are you just wanting to add the attribute `data-18n="someValue"` to the label element? –  Feb 05 '16 at 03:40
  • Then its `new { data_18n = "someValue" }` i.e. underscore character - razor translates that to a hyphen when the html is generated –  Feb 05 '16 at 03:43
  • Oh man, I would never realize that. Thank you a lot! @StephenMuecke – Will Feb 05 '16 at 03:45

0 Answers0