Derby
  1. Derby
  2. DERBY-5878

Add message argument names, as comments, to English message file produced by MessageBuilder.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.10.1.1
    • Fix Version/s: 10.10.1.1
    • Component/s: Build tools
    • Labels:
      None
    • Urgency:
      Normal

      Description

      The MessageBuilder program turns messages.xml into two output files:

      1) The DITA source for the Reference Guide section on error messages.

      2) The messages_en.properties file of engine messages.

      All of the translators I have dealt with want to use (2) as the English input for their translations. I believe this is because translators have written their own tools and those tools expect to work on properties files.

      Messages may have arguments. Those arguments appear as sub-elements of the messages in messages.xml. The arguments turn up in (1) but are thrown away when MessageBuilder produces (2). We can help translators do a better job by also writing the arguments as comments in (2).

      1. derby-5878-01-aa-argsAsComments.diff
        1 kB
        Rick Hillegas
      2. derby-5878-02-aa-commentElements.diff
        3 kB
        Rick Hillegas
      3. derby-5878-03-aa-addBracketedArgNumbersToComments.diff
        0.6 kB
        Rick Hillegas
      4. derby-5878-04-aa-updateMessageDTD.diff
        0.5 kB
        Rick Hillegas

        Issue Links

          Activity

          Hide
          Rick Hillegas added a comment -

          Attaching derby-5878-04-aa-updateMessageDTD.diff. This adds the <comment> element to the grammar description of messages.xml so that the dtd agrees with the changes introduced by derby-5878-02-aa-commentElements.diff. Committed at subversion revision 1371234.

          Touches the following file:

          M java/engine/org/apache/derby/loc/messages.dtd

          Show
          Rick Hillegas added a comment - Attaching derby-5878-04-aa-updateMessageDTD.diff. This adds the <comment> element to the grammar description of messages.xml so that the dtd agrees with the changes introduced by derby-5878-02-aa-commentElements.diff. Committed at subversion revision 1371234. Touches the following file: M java/engine/org/apache/derby/loc/messages.dtd
          Hide
          Rick Hillegas added a comment -

          Attaching derby-5878-03-aa-addBracketedArgNumbersToComments.diff. Committed at subversion revision 1369040.

          The translators asked me to add bracketed argument numbers to the comments in the generated English properties file. So, instead of generating

          1. Arguments:
            #
          2. connectionName
            #

          ...we now generate

          1. Arguments:
            #
          2. {0}

            = connectionName
            #

          Touches the following file:

          M java/build/org/apache/derbyBuild/MessageBuilder.java

          Show
          Rick Hillegas added a comment - Attaching derby-5878-03-aa-addBracketedArgNumbersToComments.diff. Committed at subversion revision 1369040. The translators asked me to add bracketed argument numbers to the comments in the generated English properties file. So, instead of generating Arguments: # connectionName # ...we now generate Arguments: # {0} = connectionName # Touches the following file: M java/build/org/apache/derbyBuild/MessageBuilder.java
          Hide
          Rick Hillegas added a comment -

          Attaching derby-5878-02-aa-commentElements.diff. This patch adds the ability to add comment blocks to English messages in messages.xml. These comments are copied to messages_en.properties to help translators understand the messages better. Committed at subversion revision 1367230.

          Touches the following files:

          --------------

          M java/build/org/apache/derbyBuild/MessageBuilder.java

          Added code to look for <comment> sub-elements of <msg> elements. When they are found, they are prefixed as a comment header on the corresponding English property in messages_en.properties.

          --------------

          M java/engine/org/apache/derby/loc/messages.xml

          Added a header comment noting that comments can now be added to message descriptors.

          Show
          Rick Hillegas added a comment - Attaching derby-5878-02-aa-commentElements.diff. This patch adds the ability to add comment blocks to English messages in messages.xml. These comments are copied to messages_en.properties to help translators understand the messages better. Committed at subversion revision 1367230. Touches the following files: -------------- M java/build/org/apache/derbyBuild/MessageBuilder.java Added code to look for <comment> sub-elements of <msg> elements. When they are found, they are prefixed as a comment header on the corresponding English property in messages_en.properties. -------------- M java/engine/org/apache/derby/loc/messages.xml Added a header comment noting that comments can now be added to message descriptors.
          Hide
          Rick Hillegas added a comment -

          Tests passed cleanly for me on derby-5878-01-aa-argsAsComments.diff. Committed at subversion revision 1365552.

          Show
          Rick Hillegas added a comment - Tests passed cleanly for me on derby-5878-01-aa-argsAsComments.diff. Committed at subversion revision 1365552.
          Hide
          Rick Hillegas added a comment -

          Attaching derby-5878-01-aa-argsAsComments.diff. This patch changes MessageBuilder so that it writes message arguments into messages_en.properties. I will run regression tests.

          Here is a sample message from messages_en.properties BEFORE applying the patch:

          08004.C.9=Missing permission for user ''

          {0}'' to shutdown system [{1}].

          Here is the same message AFTER applying this patch:

          # Arguments:
          #
          # authorizationID
          # exceptionMsg
          #
          08004.C.9=Missing permission for user ''{0}

          '' to shutdown system [

          {1}

          ].

          Touches the following file:

          M java/build/org/apache/derbyBuild/MessageBuilder.java

          Show
          Rick Hillegas added a comment - Attaching derby-5878-01-aa-argsAsComments.diff. This patch changes MessageBuilder so that it writes message arguments into messages_en.properties. I will run regression tests. Here is a sample message from messages_en.properties BEFORE applying the patch: 08004.C.9=Missing permission for user '' {0}'' to shutdown system [{1}] . Here is the same message AFTER applying this patch: # Arguments: # # authorizationID # exceptionMsg # 08004.C.9=Missing permission for user ''{0} '' to shutdown system [ {1} ]. Touches the following file: M java/build/org/apache/derbyBuild/MessageBuilder.java

            People

            • Assignee:
              Rick Hillegas
              Reporter:
              Rick Hillegas
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development