Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    isc.i18nMessages undefined

    We need to read the values of properties set in frameworkMessages.properties. We load the frameworkMessages.properties file in our jsp using:

    <SCRIPT SRC="isomorphic/locales/frameworkMessages.properties"></SCRIPT>

    Using an inline script in the same jsp, when we try to read the values using isc.i18nMessages.date_shortDateFormat. We get isc.i18nMessages is undefined.
    We are using smartclient 10.0 and have copied the frameworkMessages.properties for all locales into our web application under isomorphic/locales. Please suggest what is the right way to achieve this.

    #2
    If you navigate directly to the isomorphic/locales/frameworkMessages.properties URL, is the file present? If not, check the path -- the relative path to the file may be incorrect.
    Since you're in a JSP, you could also use the loadISC tag and simply include a 'locale' specification in the attribute.

    The documentation here goes over the basics of localization and internationalization in more detail and may also be useful

    Regards
    Isomorphic Software

    Comment


      #3
      Thanks for your reply. I tried using loadISC tag and also tried the below as an alternate:
      isc.FileLoader.loadLocale("en"); With both I see that frameworkMessages.properties is getting loaded(based on http response I see in the network tab in browser console). I also checked that isomorphic/locales/frameworkMessages.properties is right and I can see the properties file in that path. I can also access it by hitting this path in the url. Even then isc.i18nMessages is coming undefined. I want to get the value of date_shortDateFormat that is set in frameworkMessages.properties. Is there any other way in which I can access this value from the isc object. I checked isc.Date, but could not locate how to access date_shortDateFormat value from here. Thanks for your help.

      Comment


        #4
        Despite its ".properties" suffix, this file is really just a standard JavaScript file being loaded in a web page, which defines the isc.i18nMessages object on its first line.
        If it's being loaded by the browser as you indicate there's no clear reason why the object wouldn't be present on the loaded page, (unless the script failed to execute due to a syntax error or something, which you'd presumably be seeing in your browser console).
        As such, it's not clear from our end how this object can be missing.

        Having said all that - if your goal is to override the specified date format yourself, you could simply call the relevant API in your own code. In this case isc.DateUtil.setShortDisplayFormat(shortDateFormat) would work.

        Comment

        Working...
        X