Cognos Analytics

 View Only
  • 1.  Home view tab extension: multilingual label

    IBM Champion
    Posted 6 days ago

    Hey experts,

    I know how to add custom tabs to the home and content view of Cognos 12 by uploading an extension. Our users would like to have the "My content" and "Team content" also visible right on the home view. My problem is that in the json file of the extension I have to state a static label for each tab. I don't want to pur a static label for these two tabs as they are already translated by default in Cognos 12. 

    Can I use these multilingual texts in the extensions?

    Sample: Here my users expect that they see the .my folders path as tab on the home view but translated corresponding to their product language they have set up (EN, DE, FR, NL, CN etc.)

      "containerId": "com.ibm.bi.caHome.navigator",
                  "id": "com.ibm.bi.content.navigator.myContent",
                  "legacyId": "com.ibm.bi.contentApps.myContent",
                  "name": "My Folders",
                  "label": "My Folders",
                  "stateId": "myFoldersView",
                  "weight": 1,
                  "properties": {
                    "path": ".my_folders",
    


    ------------------------------
    Robert Dostal
    Team Leader BI
    GEMÜ Gebr. Müller Apparatebau GmbH & Co. KG
    Ingelfingen
    ------------------------------


  • 2.  RE: Home view tab extension: multilingual label

    IBM Champion
    Posted 3 days ago

    Hi Robert,

    I believe this is not a documented feature. However, you can have a look to LearningPanel.zip shipped with the product. There are multiple translations and languages, you will easily find how to adapt this code.

    Best regards,



    ------------------------------
    Patrick Neveu
    Collaboration Betters The World (CBTW)
    IBM Champion
    ------------------------------



  • 3.  RE: Home view tab extension: multilingual label

    IBM Champion
    Posted 2 days ago

    Hi Robert,

    Patrick is correct - there isn't any "documented" support for dealing with translated strings. However, besides the lead he provided ( with the LearningPanel.zip file), I'll throw out another couple potential ideas.

    The perspectives that come by default in CA are defined basically the same way extensions are defined. You can find the JSON for these in the install folder in the  <ca_installdir>/perspectives/ folder. Inside the perspectives folder is a folder for each perspective. Inside each of these is an application.json file (which is pretty similar to the spec.json file in your extension),  a contrib subfolder, and usually a locale subfolder. The contrib folder has other json files which contribute to the perspective's application.json, when the perspective is served up. If you look in the application.json files (or the json files in the contrib folders), you'll see instead of string constants for some of the attributes (e.g. "label") , instead of the actual string, there will be a string that starts with a "%" - such as "%discoveryBrowser_label". The "%" prefix tells the system to lookup this token (e.g. in this case "discoveryBrowser_label") in the locales subfolder and replace it with the respective language string for this token. What I don't remember 100%, is if your extension uses a %<label> for a string attribute, where <label> is defined for this perspective (in the perspectives locale subfolder), will it do the translation for an extension (but you could try it! ;-)  )

    (In fact, if you create a new folder named "foo" under perspectives/ folder, and put an appropriate application.json file in it, then you'll have added a new perspective to your CA install, called "foo" - which you can open at "http://<cognos-server>:9300/bi/?perspective=foo (or whatever gateway you have for your CA installation.)

    ---

    On a related note, you can build your own locale specifics into your extension, using the product locale setting which you can retrieve from the UserProfile service. In your extensions javascript, you can  retrieve the product locale and and add you logic to use this locale, with a line line this: 

        this.text = __glassAppController.glassContext.getCoreSvc('.UserProfile').preferences.productLocale.startsWith("fr")
          ? "Ceci est le texte de la clause de non-responsabilité pour l'utilisation de ces données."
          : "This is the text for the disclaimer for using this data.";

    Regards,

        Jim



    ------------------------------
    Jim Boland

    LinkedIn: https://www.linkedin.com/in/jimboland
    Website: https://coreinsightz.com
    Email: jimboland@coreinsightz.com
    ------------------------------