You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Kohei Nozaki (JIRA)" <ji...@apache.org> on 2016/12/11 08:41:58 UTC

[jira] [Created] (ROL-2109) Media Files page shows texts that incosistent with user's language

Kohei Nozaki created ROL-2109:
---------------------------------

             Summary: Media Files page shows texts that incosistent with user's language
                 Key: ROL-2109
                 URL: https://issues.apache.org/jira/browse/ROL-2109
             Project: Apache Roller
          Issue Type: Bug
          Components: User Interface - General
    Affects Versions: 5.1.2
            Reporter: Kohei Nozaki
            Assignee: Roller Unassigned
            Priority: Minor


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

{noformat}
// 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;
{noformat}

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

{noformat}
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")));
}
{noformat}

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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)