Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4293229

RFE: Need better handling/documentation of single quotes in MessageFormat

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.4.0
    • solaris_8, solaris_9, 1.2.1, 1.2.2, 1.3.0, 1.4.0
    • core-libs
    • beta
    • generic, x86, sparc
    • generic, solaris_7, solaris_8, windows_2000



      Name: dbT83986 Date: 11/20/99


      java version "1.2.2"
      Classic VM (build JDK-1.2.2-U, native threads, symcjit)


      In Internationalization, the Java tutorial
        http://java.sun.com/docs/books/tutorial/i18n/index.html
      recommends using java.util.PropertyResourceBundle files to contain
      constant strings of localized messages.
      It recommends using java.text.MessageFormat to format messages
      containing variable data. It recommends storing the message format
      string for variable data in the Properties file accessed by the
      PropertyResourceBundle.

      For constant strings accessed by java.util.ResourceBundle.getString,
      single quotes (') have no special meaning and are returned as is, and
      do not need to be treated specially in the properties file.

      For MessageFormat pattern strings, single quote is a special character,
      and is used to quote braces in pattern strings.

        From the point of view of the localization person (translator), this
      presents a problem, because in a properties file sometimes single
      quote is left alone and sometimes it must be doubled.

      I realize that this is a result of interaction between two different
      parts of the Java class libraries, but they are parts that are designed
      to work together, and the emergent property of using them together
      is a screw case.

      I realize that it is too late to change the API for MessageFormat for
      quoting rules, but it may be possible for you to fix this in the future,
      or at least document it in the tutorial and the extensive API documentation
      on PropertyResourceBundle and MessageFormat.
      (Review ID: 98087)
      ======================================================================

            nlindenbsunw Norbert Lindenberg (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: