Well, it seems like deadline of your project doesn't allow wait for
cake's solution for reading records with fallback to default locale ;)
Ok, I can live with it. So I'll not comment your own solution at all -
I assume that you know that things may change in development version
and you're prepared to watch https://trac.cakephp.org/changeset/
But now when I know that you're cake newbie, I would like to make few
points (from fast review of your NewsArticlesController), which are
probably a bit 'off topic':
1. I don't see line with parent::beforeFilter(); in beforeFilter()
method
2. you're messing together terms 'language' and 'locale' - those are
different things (see next point)
3. you're using different locales, then cake, see L10n::$__l10nMap
(locale => language)
4. if you want your application (not only db translation, but also
i18n functions for reading of gettext files) use some locale (and not
use autodetection from browser), Configure::write('Config.language',
'fr') (or same key in session) is enough - TranslateBehavior will use
locale for this language automatically
5. $this->set('title_for_layout', ...); could be replaced with $this-
>pageTitle = ...;
6. variables 'siteVars' and title for page are used only for rendered
output (and as I can see they doesn't vary with called action) so
initialization of them imo belongs to beforeRender() callback
And btw: I don't like ?language=xx in url (if you do, don't read rest
of this paragraph), I prefer keep selected language in session
(probably combined with cookie, and with invisible links for search
engines), or in url like example.com/en/controller/action (nothing
special, just few lines in routes.php).
Just my 2 cents.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---