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

Tool titles should be displayed in user's prefered language/locale

    XMLWordPrintable

    Details

    • Type: Task
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.x
    • Fix Version/s: 2.7.x
    • Component/s: Kernel
    • Labels:

      Description

      As a sub-task and first step towards completely and dynamically localizing page and tool titles, apply Mark Norton's SAK-8908 branch that localizes tool titles.

        • Implementation notes from Mark Norton **

      After extensive experimentation, I have checked a fix into the SAK-8908 branch of the kernel. Several different methods were attempted to provide tool title localization. Problems with reaching resource bundles in tool packages vs. the central shared space prevented ResourceLoader from being used.

      Implementation Design:

      Local tool titles are put in a file named using the format of [toolId][_][localCode].properties in the /tool/ directory of a Sakai application. Title properties have a key of "title".
      The ToolListener was modified to detect the above files and add them to a map in the Tool manager implementation via a new API method called setResourceBundle(). This method was added to the ToolMaanager API, both covers (ToolManager and ActiveToolManager) and implemented in ToolComponent. The implementation maintains a Map of locale codes to Properties objects. The default properties set is called DEFAULT.
      A three tier access method is implemented in Tool.getTitle:

      1. If a central tool resource bundle exists, return that localized title.
      2. If a localized tool resource exists, return that localized title.
      3. Otherwise default to the tool title in the tool registration file (not localized).

      Additionally, a change was made to the Placement implementation. Placement maintains a copy of the tool title and is initialized in the register() methods of the ToolManager before the ToolListener loads local tool resources. The order of fetching the title was reversed. It now checks for a tool title using getTitle() before using the local copy.

      In all, the following files were modified for this fix:

      kernel-impl/src/main/java/org/sakaiproject/tool/impl/ToolComponent.java
      kernel-util/src/main/java/org/sakaiproject/util/Tool.java
      kernel-util/src/main/java/org/sakaiproject/util/Placement.java
      api/src/main/java/org/sakaiproject/tool/api/ToolManager.java
      api/src/main/java/org/sakaiproject/tool/cover/ActiveToolManager.java
      api/src/main/java/org/sakaiproject/tool/cover/ToolManager.java
      api/src/main/java/org/sakaiproject/util/ToolListener.java

      These were checked into SVN as revs 51546 to 51552.

      NOTE: These changes only localize tool titles. They do not attempt to localize page names, which is a harder problem. Furthermore, tool descriptions are not currently localized.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bkirschn Beth Kirschner
                  Reporter:
                  bkirschn Beth Kirschner
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code