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 Mon, 01 Nov 2010 14:23:24 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: engine-messages.diff

Here's a patch that fixes the problems I found by grepping the engine messages. It simply
changes all single single-quotes to double single-quotes, as that seemed to be the correct
handling of all the cases I found.

For the drda and tools messages, the solution won't be that simple. That's because they get
the messages through LocalizedResource, which handles messages with arguments in a different
way than messages with no arguments. The messages that have arguments will be passed through
MessageFormat, and therefore require escaping. The messages with no arguments are taken literally,
and therefore shouldn't be escaped.

I'm leaning towards changing LocalizedResource to always go through MessageFormat (just like
MessageService does with the engine messages). That means we would have to escape single-quotes
in all tools messages and drda messages, but that sounds easier to maintain than having some
messages that should be escaped and some that shouldn't.

> 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:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: engine-messages.diff
> 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.

View raw message