David, thank you. It's working in tigris. I had to rename the file to
Messages_fr.properties like you said as it had the property in question.
Now, You mentioned that this resource bundle is implemented only in
tigris and blueocean. I looked around and couldn't find were the code
is. I need to implement the resource bundle in my own, and I need to
follow an example. Can you please point me in the right direction ?
Thank you.
David Sean Taylor wrote:
On Sep 8, 2008, at 8:47 PM, Mansour Al Akeel wrote:
David Sean Taylor wrote:
On Sep 6, 2008, at 1:43 PM, Mansour Al Akeel wrote:
Sorry, not enough details in my previous email.
I have created my own velocity page layout. However, I need to
localize it. So I copied the resources directory from the
"blueOcean" layout and tried to access the properties in the way
you mentioned.
<b>$rootFragment.decoration.getResourceBundle($preferedLocale,$JS2RequestContext).getString("desktop.pageeditor.dialog.labels.deletepage")</b>
However, this is not working. The object $rootFragment.decoration.
is defined but,
$rootFragment.decoration.getResourceBundle($preferedLocale,$JS2RequestContext)
is not.
Can you please let me know if I am doing something wrong?
Not sure. I tried this with the 2.1.3 installer, with both Tigris
and Blueocean page decorators. Both cases the expression:
<b>$rootFragment.decoration.getResourceBundle($preferedLocale,$JS2RequestContext).getString("desktop.pageeditor.dialog.labels.deletepage")</b>
evaluates to:
"Are you sure you want to delete this page"
Did you try it with other decorators. I wrote my own decorator from
scratch. I am not sure if there's something else I need to include in
the pages before using the line:
We only implemented resource bundles for two of the page decorators
(tigris, blueocean). You have to follow the examples...placing
resources bundles in the resources directory of the decorator
<b>$rootFragment.decoration.getResourceBundle($preferedLocale,$JS2RequestContext).getString("desktop.pageeditor.dialog.labels.deletepage")</b>
I trid to copy the resource directory from Tigris over to my
decorator and tried to use the exact same property, but the page is
breaking with message:
"content not available"
A quick search shows that this exact property exists only in
tigris/resources/Messages.properties and not in any of the
localization files (ie, Messages_fr.properties ...etc.). So if I
moved this message from the the default properties file
(Messages.properties) to another resource file like
(Messages_en.properties) it will never work. In this case, how can I
do the localization in a decorator ? And before that How can I access
even the default properties file (Messages.properties) from my new
decorator?
I don't follow your argument. Why wouldn't it work? Isn't that how
resource bundles work, just append the language code and it will
correctly load the bundle? Im trying that now for "tigris" .... it works:
cp Messages.properties Messages_fr.properties
replace this line
desktop.pageeditor.dialog.labels.deletepage=Are you sure you want to
delete this page?
with this line
desktop.pageeditor.dialog.labels.deletepage=Etes-vous sur de vouloir
supprimer cette page?
then save
go back to the page with the <b> test string in the decorator, and use
the change language portlet to change the language to "fr" and you
will see the new string displayed in the "fr" language
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]