Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Issue with apostrophes and NLS
Issue with apostrophes and NLS [message #464732] Wed, 14 March 2007 14:36 Go to next message
Anders Skarby is currently offline Anders SkarbyFriend
Messages: 7
Registered: July 2009
Junior Member
Hey guys (and girls),

I'm having a major headache, concerning using Eclipse's NLS mechanism,
with text-strings containing 2 or more apostrophes.

Take this example:
------------------

an entry, eg.

Class.SOME_ENTRY=This is the dog's bone's arch nemesis

gets returned through the NLS mechanism as the String:

"This is the dogs bones arch nemesis"

When only one apostrophe is in the String, it returns the String as
expected (that is, including the apostrophe).

Can someone help me out, here?

PS: Running Eclipse 3.2
Re: Issue with apostrophes and NLS [message #464755 is a reply to message #464732] Thu, 15 March 2007 08:38 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Anders Skarby wrote:

> Hey guys (and girls),
>
> I'm having a major headache, concerning using Eclipse's NLS mechanism,
> with text-strings containing 2 or more apostrophes.
>
> Take this example:
> ------------------
>
> an entry, eg.
>
> Class.SOME_ENTRY=This is the dog's bone's arch nemesis
>
> gets returned through the NLS mechanism as the String:
>
> "This is the dogs bones arch nemesis"
>
> When only one apostrophe is in the String, it returns the String as
> expected (that is, including the apostrophe).
>
> Can someone help me out, here?
>
> PS: Running Eclipse 3.2

This works for me i.e. the NLS wizard creates this entry in the
properties file:
Key=This is the dog's bone's arch nemesis

Dani
Re: Issue with apostrophes and NLS [message #464784 is a reply to message #464755] Thu, 15 March 2007 11:54 Go to previous messageGo to next message
Anders Skarby is currently offline Anders SkarbyFriend
Messages: 7
Registered: July 2009
Junior Member
Daniel Megert skrev:
> Anders Skarby wrote:
>
>> Hey guys (and girls),
>>
>> I'm having a major headache, concerning using Eclipse's NLS mechanism,
>> with text-strings containing 2 or more apostrophes.
>>
>> Take this example:
>> ------------------
>>
>> an entry, eg.
>>
>> Class.SOME_ENTRY=This is the dog's bone's arch nemesis
>>
>> gets returned through the NLS mechanism as the String:
>>
>> "This is the dogs bones arch nemesis"
>>
>> When only one apostrophe is in the String, it returns the String as
>> expected (that is, including the apostrophe).
>>
>> Can someone help me out, here?
>>
>> PS: Running Eclipse 3.2
>
> This works for me i.e. the NLS wizard creates this entry in the
> properties file:
> Key=This is the dog's bone's arch nemesis
>
> Dani

And what is your result, if you print it to the Console? I do also get
the correct entry in the properties file, this is not where the problem
lies - it's the output that's the issue.
Re: Issue with apostrophes and NLS [message #464867 is a reply to message #464784] Fri, 16 March 2007 14:56 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Anders Skarby wrote:

> Daniel Megert skrev:
>
>> Anders Skarby wrote:
>>
>>> Hey guys (and girls),
>>>
>>> I'm having a major headache, concerning using Eclipse's NLS
>>> mechanism, with text-strings containing 2 or more apostrophes.
>>>
>>> Take this example:
>>> ------------------
>>>
>>> an entry, eg.
>>>
>>> Class.SOME_ENTRY=This is the dog's bone's arch nemesis
>>>
>>> gets returned through the NLS mechanism as the String:
>>>
>>> "This is the dogs bones arch nemesis"
>>>
>>> When only one apostrophe is in the String, it returns the String as
>>> expected (that is, including the apostrophe).
>>>
>>> Can someone help me out, here?
>>>
>>> PS: Running Eclipse 3.2
>>
>>
>> This works for me i.e. the NLS wizard creates this entry in the
>> properties file:
>> Key=This is the dog's bone's arch nemesis
>>
>> Dani
>
>
> And what is your result, if you print it to the Console? I do also get
> the correct entry in the properties file, this is not where the
> problem lies - it's the output that's the issue.

Do you run that string through MessageFormat? If so, you need to double
quote it i.e. put '' instead of ''

Dani
Re: Issue with apostrophes and NLS [message #464905 is a reply to message #464867] Tue, 20 March 2007 07:57 Go to previous messageGo to next message
Anders Skarby is currently offline Anders SkarbyFriend
Messages: 7
Registered: July 2009
Junior Member
Daniel Megert skrev:
> Anders Skarby wrote:
>
>> Daniel Megert skrev:
>>
>>> Anders Skarby wrote:
>>>
>>>> Hey guys (and girls),
>>>>
>>>> I'm having a major headache, concerning using Eclipse's NLS
>>>> mechanism, with text-strings containing 2 or more apostrophes.
>>>>
>>>> Take this example:
>>>> ------------------
>>>>
>>>> an entry, eg.
>>>>
>>>> Class.SOME_ENTRY=This is the dog's bone's arch nemesis
>>>>
>>>> gets returned through the NLS mechanism as the String:
>>>>
>>>> "This is the dogs bones arch nemesis"
>>>>
>>>> When only one apostrophe is in the String, it returns the String as
>>>> expected (that is, including the apostrophe).
>>>>
>>>> Can someone help me out, here?
>>>>
>>>> PS: Running Eclipse 3.2
>>>
>>>
>>> This works for me i.e. the NLS wizard creates this entry in the
>>> properties file:
>>> Key=This is the dog's bone's arch nemesis
>>>
>>> Dani
>>
>>
>> And what is your result, if you print it to the Console? I do also get
>> the correct entry in the properties file, this is not where the
>> problem lies - it's the output that's the issue.
>
> Do you run that string through MessageFormat? If so, you need to double
> quote it i.e. put '' instead of ''
>
> Dani

Nope, I don't run it through a MessageFormat, I use the String in a
ContentProvider - no formatting is used, what so ever.

Anders
Re: Issue with apostrophes and NLS [message #464965 is a reply to message #464905] Wed, 21 March 2007 09:31 Go to previous message
Anders Skarby is currently offline Anders SkarbyFriend
Messages: 7
Registered: July 2009
Junior Member
Anders Skarby skrev:
> Daniel Megert skrev:
>> Anders Skarby wrote:
>>
>>> Daniel Megert skrev:
>>>
>>>> Anders Skarby wrote:
>>>>
>>>>> Hey guys (and girls),
>>>>>
>>>>> I'm having a major headache, concerning using Eclipse's NLS
>>>>> mechanism, with text-strings containing 2 or more apostrophes.
>>>>>
>>>>> Take this example:
>>>>> ------------------
>>>>>
>>>>> an entry, eg.
>>>>>
>>>>> Class.SOME_ENTRY=This is the dog's bone's arch nemesis
>>>>>
>>>>> gets returned through the NLS mechanism as the String:
>>>>>
>>>>> "This is the dogs bones arch nemesis"
>>>>>
>>>>> When only one apostrophe is in the String, it returns the String as
>>>>> expected (that is, including the apostrophe).
>>>>>
>>>>> Can someone help me out, here?
>>>>>
>>>>> PS: Running Eclipse 3.2
>>>>
>>>>
>>>> This works for me i.e. the NLS wizard creates this entry in the
>>>> properties file:
>>>> Key=This is the dog's bone's arch nemesis
>>>>
>>>> Dani
>>>
>>>
>>> And what is your result, if you print it to the Console? I do also
>>> get the correct entry in the properties file, this is not where the
>>> problem lies - it's the output that's the issue.
>>
>> Do you run that string through MessageFormat? If so, you need to
>> double quote it i.e. put '' instead of ''
>>
>> Dani
>
> Nope, I don't run it through a MessageFormat, I use the String in a
> ContentProvider - no formatting is used, what so ever.
>
> Anders

Okay, two '' did the trick, even though I'm not running it through a
MessageFormat.

You saved my day - thanks for the persistant support. I greatly
appreciate it.

Anders, over-and-out!
Previous Topic:Plugin Templates
Next Topic:eclipse plugin classpath and JDBC access
Goto Forum:
  


Current Time: Fri Sep 20 23:33:00 GMT 2024

Powered by FUDForum. Page generated in 0.04773 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top