Select to view content in your preferred language

set tab title from nls

2158
16
Jump to solution
05-10-2017 02:47 PM
LefterisKoumis
Frequent Contributor

I am trying to assign a title to a tab from the nls.strings, however I get this error. The only way is to assign the title is by using the widget.js? Thanks.

HTML:

<div data-dojo-type="dijit/layout/TabContainer" style=" height: 700px; width: 630px; " >
<div data-dojo-type="dijit/layout/ContentPane" title=${nls.subjectA} >

nls.strings.js

define({
  root: ({
    subjectA: "Subject A",
-------
--------

0 Kudos
16 Replies
LefterisKoumis
Frequent Contributor

The actual widget is 3 times bigger so I created this smaller version so I can send it to you. The original widget does not have any syntax errors but it seems when I created these two files in the smaller version, I rushed. The original string.js and  widget.html have the same scripts as the ones you posted here and I get the error that I stated in my original posting.

Thank you.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

  Well I really can't help if you not providing your actual widget code. When I made those changes to the widget code you provided the tabs appeared with the text just fine.

0 Kudos
LefterisKoumis
Frequent Contributor

ok. The code I provided to you without the syntax errors still shows the same error as the actual code. If you don't see the same "dijit._WidgetsInTemplateMixin template:nls.subjectA" error then I can't explain what's wrong with it. Thank you anyway.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   So you must have an error in your code still then. Here is the widget you send me working:

LefterisKoumis
Frequent Contributor

Thank you. I posted the zip file you provided to me and no errors appear!! This is bizarre. I run the notepad++ compare module and saw no differences between original versions of strings.js and widget.htm and the same ones in the zip filel!!! 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

check the manifest.json. you had haslocale as false.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Don't forget to mark this question as answered by clicking on the "Correct Answer" link on the reply that answered your question.

0 Kudos