Hi there,
On Jun 2, 5:41 am, jitka <[EMAIL PROTECTED]> wrote:
> 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 watchhttps://trac.cakephp.org/changeset/
Yes I know that things could change. Only thinng is I have a project
that needs this kind of functionality on short term.
>
> 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
Sorry that new to me as a beginner
> 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)
Thanks, I was wondering what the default language string were
> 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
Yes, I know. It was just a prove off concept. In my project language
will be stored in a user session.
> 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
$this->set('siteVars', $this->Conf->get('site.*'));
$this->set('title_for_layout', $this->Conf->get('site.name'));
This is some other code that was floating around in my code. It has
nothing to do with this issue. It should have been stripped from the
post
>
> 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).
I agree.
Thanks for your comments
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---