Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-2109

Media Files page shows texts that inconsistent with user's language

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 5.1.2
    • None
    • None

    Description

      In MediaFileView class, it saves some text messages in static variables as follows:

      // Search criteria - drop-down for file type
      private static List<KeyValueObject> FILE_TYPES = null;
      
      // Search criteria - drop-down for size filter
      private static List<KeyValueObject> SIZE_FILTER_TYPES = null;
      
      // Search criteria - drop-down for size unit
      private static List<KeyValueObject> SIZE_UNITS = null;
      

      They will be initialized inside myPrepare() method as follows:

      if (SIZE_FILTER_TYPES == null) {
      
          SIZE_FILTER_TYPES = Arrays.asList(new KeyValueObject(
                  "mediaFileView.gt", getText("mediaFileView.gt")),
                  new KeyValueObject("mediaFileView.ge",
                          getText("mediaFileView.ge")), new KeyValueObject(
                          "mediaFileView.eq", getText("mediaFileView.eq")),
                  new KeyValueObject("mediaFileView.le",
                          getText("mediaFileView.le")), new KeyValueObject(
                          "mediaFileView.lt", getText("mediaFileView.lt")));
      
          FILE_TYPES = Arrays.asList(new KeyValueObject("mediaFileView.any",
                  getText("mediaFileView.any")), new KeyValueObject(
                  "mediaFileView.others", getText("mediaFileView.others")),
                  new KeyValueObject("mediaFileView.image",
                          getText("mediaFileView.image")),
                  new KeyValueObject("mediaFileView.video",
                          getText("mediaFileView.video")),
                  new KeyValueObject("mediaFileView.audio",
                          getText("mediaFileView.audio")));
      
          SIZE_UNITS = Arrays.asList(new KeyValueObject(
                  "mediaFileView.bytes", getText("mediaFileView.bytes")),
                  new KeyValueObject("mediaFileView.kb",
                          getText("mediaFileView.kb")), new KeyValueObject(
                          "mediaFileView.mb", getText("mediaFileView.mb")));
      
          SORT_OPTIONS = Arrays.asList(new KeyValueObject("name",
                  getText("generic.name")), new KeyValueObject(
                  "date_uploaded", getText("mediaFileView.date")),
                  new KeyValueObject("type", getText("mediaFileView.type")));
      }
      

      This makes Roller to use only one language in those messages. I think that this class must stop saving those texts in static variables, and get suitable messages for each request according to user's language.

      Attachments

        1. roller-bug-ss.png
          144 kB
          Kohei Nozaki

        Activity

          People

            Unassigned Unassigned
            xkylex Kohei Nozaki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: