Re: bc_include_once() chicken & egg problem
Jean-Christophe Michel <jc.michel-/aRvmaKoZxNWk0Htik3J/[email protected]> Thu, 24 Mar 2005 22:36:34 +0100
| Newsgroups | gmane.comp.lib.binarycloud.devel |
|---|---|
| Message-ID | <[email protected]> |
Manuel Holtgrewe wrote:
> Hi
>
> I have a problem with the translating and caching bc_include_once()
> function. The dependency tree for bc_include_once() is as follows:
>
> * I18n (to get the currently active locale)
> * Log
> * Conf
> * Session
> * Timer
> * Translation XML parser class
> * Translation XML cache
>
> This means that we cannot have translation in any of the classes named
> above.
Anyway, what would there be to translate in these ? Exceptions and Log
messages ?
Maybe a better design on how services are started would be:
Page is requested (uri)
1. $uri_lang passed through GET is retrieved, if any
2. $client_lang from Client preferences (browser) is retrieved
together with $preferred_locales
3. Translation service can receive a first default lang from these
two values
4. Conf is started, tries to read files
5. Translation service receives the default i18n lang if it had none
6. Log is configured
7. Session is retrieved
8. Timer is launched
9. Perm/User
10. i18n initiates the lang from either User+session or $uri_lang
or $client_lang
11. Translation service receives the definitive lang value.
So we would have more chances to present to the user messages in the
"right" lang:
1. Request depends on nothing; there is one Log::entry call, a test
could avoid a warning here
2. this would be done by a function in functions.php
4. if Conf has an exception to raise, Translation service has a first
default lang to use; it can try to read in cached values in this lang,
default with 'en', and if nothing, print the string.id.
Once Conf is launched, Translation can load its preferences and know how
to retrieve all values, even if not in cache
6. if Log has an exception to raise, Translation now knows the i18n conf
value for default locale & lang.
--
Jean-Christophe Michel
_______________________________________________
dev mailing list
dev-PnctHDZWAvB/Cz2I37pSEPZ4XP/[email protected]
http://lists.binarycloud.com/mailman/listinfo/dev