[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nuxeo-localizer] Updating to Localizer 0.8.1
From: |
Juan David Ibáñez Palomar |
Subject: |
Re: [Nuxeo-localizer] Updating to Localizer 0.8.1 |
Date: |
Thu, 28 Feb 2002 15:21:18 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214 |
Garikoitz Araolaza wrote:
Hi!
I'm trying to update to Localizer 0.8.1
I'm having a couple of problems:
__First:__
I did exactly as described in the UPGRADE.txt file, but I've found
that I have to call :
<dtml-with locale><dtml-var "folder.logo()"></dtml-with>
to get it working.
Am I right or is it something special with my site?
You're right, the UPGRADE.txt file is wrong, apologies. Another way to
type it:
<dtml-with "locale.folder"><dtml-var logo></dtml-with>
If you prefer you also can create a local attribute named "logo" and
copy each
logo from "Localizer/<lang>/logo" to "locale/logo_<lang>", then you could
type:
<dtml-with locale><dtml-var logo></dtml-with>
I've fixed the UPGRADE.txt file (and another bug related to cookies) and
uploaded
the tgz to SourceForge. People that are using Localizer 0.8.1 should
download the
new "tgz" (if you need changeLanguage*). Apologies.
Gari, what do you think about the new LocalFolder meta type, compared
with the
old way to do it?
_Second:__
Where is SELECTED_LANGUAGE ? I "complained" some days ago about my
upgrades and downgrades with other methods... It was my fault
finally... :-) because I downgraded from a CVS version...
I've put this snippet in my default_template file so that users don't
get surprised when they found a LocalContent object in a different
language:
<dtml-if "get_selected_language(property='body')!=SELECTED_LANGUAGE">
<dtml-var "gettext('Sorry, but we don't have this page in your
language')">
</dtml-if>
Now that Localizer object is gone, I don't have SELECTED_LANGUAGE...
So, how could I detect if I give the user his SELECTED_LANGUAGE
version or not?
SELECTED_LANGUAGE is an undocumented (and dirty) feature that I think only
you know and use. In the CVS it has been completely removed.
In your case I recommend to use the CVS, then you'll be able to type:
<dtml-unless
"USER_PREF_LANGUAGES.select_language(get_available_languages())">
<dtml-var "gettext('Sorry, but we don't have this page in your
language')">
</dtml-unless>
However, this is not the best thing, I'll probably implement a better
solution
when I figure it out.
Another advantage (for you) to moving to the CVS is that it gives you more
power to change "USER_PREF_LANGUAGES", so you'll be able to implement,
for example "possitive discrimination of a given language".
Another advantage (for me) is that I'll get feedback to know wether the
new changes
are in the right direction ;-)
Cheers,
--
J. David Ibáñez, Nuxeo.com
Libre Software zealot (http://www.fsf.org)