Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook startup functions on on_page_view event instead of on_start #47

Merged
merged 1 commit into from
Jul 2, 2015

Conversation

hissy
Copy link
Contributor

@hissy hissy commented Feb 21, 2014

Setup translation language before startup/process.php.
Related commit: concretecms/concretecms@4fdea7e

It even works fine on before 5.6.3, but I want to more testing about this change by others.

Setup translation language before startup/process.php. Related concretecms/concretecms@4fdea7e
@hissy
Copy link
Contributor Author

hissy commented Feb 21, 2014

@mlocati
Copy link
Contributor

mlocati commented Feb 21, 2014

What about tools? In dispatcher.php require($cdir . '/startup/tools.php'); comes before Events::fire('on_page_view', $c, $u);...

The source of the problem is that the localization must be initialized as soon as possible.
That's why I suggested concrete5#1375 + addon_internationalization#39

My solution would fix locale-dependent constants and setup the correct locale at a very early step of the dispatcher.

@hissy
Copy link
Contributor Author

hissy commented Feb 21, 2014

I totally agree with early initialize localization, but maybe we need more discussion about add warm up method... Anyway, this change will fix some problem in Internationalization after core 5.6.3 released.

@mlocati
Copy link
Contributor

mlocati commented Feb 21, 2014

Yes, it fixes some problems by initializing multilingual a bit earlier (but as I stated above it should be initialized a lot earlier)

@mlocati
Copy link
Contributor

mlocati commented Mar 10, 2014

Another problem with this approach is that package localizations does not get loaded:
setupPackageLocalization in called before the on_page_view event...

@Remo
Copy link
Contributor

Remo commented May 8, 2014

@mlocati package localizations get loaded after the last few changes you've made, don't they? The only problem left is the tools related issue? I believe this PR doesn't have any negative effects but fixes an important bug and should therefore be merged.

@mlocati
Copy link
Contributor

mlocati commented May 8, 2014

Yes. Packages localization gets loaded at Localization initialization and when Localization::changeLocale is called.

@Remo
Copy link
Contributor

Remo commented May 15, 2014

@tylerryan Any chance this can get merged? I'd still prefer to have the whole i18n stuff in the core where we could initialize it even earlier, but this pull request fixes one rather annoying bug.

@Remo
Copy link
Contributor

Remo commented Jul 1, 2015

@mlocati @hissy I've got write access to this repo.. We've been using a custom version of this add-on with this PR applied. Any objections about merging it?

@mlocati
Copy link
Contributor

mlocati commented Jul 2, 2015

If it works I can't see any reasons to not merge this 😉

Remo added a commit that referenced this pull request Jul 2, 2015
Hook startup functions on on_page_view event instead of on_start
@Remo Remo merged commit 9737b49 into concretecms:master Jul 2, 2015
@Remo
Copy link
Contributor

Remo commented Jul 2, 2015

it does work for me and as long as no one else complains I'm good, thanks (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants