db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4796) Missing escape for apostrophes in many messages
Date Tue, 09 Nov 2010 13:38:09 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Knut Anders Hatlen updated DERBY-4796:
--------------------------------------

    Attachment: tools-drda-messages.diff
                tools-drda-messages.stat

Attaching a patch to fix the tools and drda messages. I haven't run any tests yet.

The patch makes the following changes:

M       java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java

Send all messages through java.text.MessageFormat for orthogonality, also the messages that
don't have parameters.

M       build.xml
A       java/build/org/apache/derbyBuild/MessageVetter.java

Added code to sanity check the message files at build-time. MessageVetter goes through every
message and checks (1) that they don't contain lone single-quote characters, and (2) that
no exception is raised when constructing a java.text.MessageFormat using the message. Exceptions
from (1) were added for three messages in which single-quotes were needed to quote curly braces
that should appear literally in the message. For these messages, MessageVetter checks that
single-quotes either are doubled (to produce an apostrophe) or placed adjacent to curly braces.

M       java/tools/org/apache/derby/loc/*.properties
M       java/drda/org/apache/derby/loc/drda/*.properties

Doubled occurrences of lone single-quotes. Also added single-quotes around curly braces where
that was needed.

M       java/engine/org/apache/derby/loc/messages_it.properties

Fixed a malformed parameter marker, noticed by MessageVetter.

> Missing escape for apostrophes in many messages
> -----------------------------------------------
>
>                 Key: DERBY-4796
>                 URL: https://issues.apache.org/jira/browse/DERBY-4796
>             Project: Derby
>          Issue Type: Bug
>          Components: Localization
>    Affects Versions: 10.6.1.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: engine-messages.diff, tools-drda-messages.diff, tools-drda-messages.stat
>
>
> The properties file format requires that single-quote characters are escaped with an
extra single-quote. A number of messages don't follow this rule.
> Take this example from the Italian localization:
> 42X34=Esiste un parametro ? nell'elenco di selezione.  Ci\u00F2 non \u00E8 consentito.
> Note that there's only a single apostrophe in "nell'elenco" above. When this message
is printed, the apostrophe will be omitted:
> $ LC_ALL=it_IT.UTF-8 java -jar derbyrun.jar ij
> Versione ij 10.6
> ij> connect 'jdbc:derby:db;create=true';
> ij> select ? from sys.systables;
> ERRORE 42X34: Esiste un parametro ? nellelenco di selezione.  Ciò non è consentito.
> We should go through the message files and add extra apostrophes where they are missing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message