Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-39515

Create a standard way for reading i18n properties from JS that works with the ResourceLoader

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Previous Issue Keys:
      KNL-1122

      Description

      This would be useful to roster2, gb2, datepicker, and other tools and technologies that make heavy use of Javascript. By standardizing around the ResourceLoader insure that functionality like dynamic loading, and anything else that may come along can work consistently across all of Sakai.

      One possible solution from Matthew Jones:

      I was wondering if it would be easier to just write a simple direct point with custom actions for i18n.so we don't have to keep rewriting this?

      Would something like this work? Then the i18n files would just have to be deployed in the usual place.

      /direct/i18n/string/bundleName/key (GET) – Returns a specific string json/xml/html encoded

      getString(bundleName,key)

      { return ResourceLoader.getBundle(bundleName, getUserPreferredLocale()).getString(key); }

      /direct/i18n/bundle/bundleName (GET) – Returns all strings in the bundle json/xml/html encoded

      getBundle(bundleName)

      { return ResourceLoader.getBundle(bundleName, getUserPreferredLocale()); }

      There may be some changes needed in ResourceLoader so that a method for getting a bundle by name and locale is available. They are standard methods for ResourceBundle but not ResourceLoader.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  jbush John Bush
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code