Language.class.php File Reference
Go to the source code of this file.
Detailed Description
- Developer log entry:
- Necdet Can Atesman (2009-05-12): Where do we store translation information by default? The language must somehow be retrieved from the L10n object in the current environment (see today's devlogs of spunQ class). If the database module is really going to be part of the core (today's devlogs of spunQ_IPeerDescription), all translations/L10ns can be stored in the db somewhere, this would mean that all translations are to be found there (even the ones from templates), which would have the positive side effect that all translations can be found on a single page.
After a small brainstorming with Martin, we found out that this would make it impossible to copy-paste the gui of a module. This again means that wording files are to be stored in the same folder as their templates, as defined previously.
The next question is: Where do we put our localization definitions? These are part of the whole application, not part of a single template. The answer depends on the data to be stored. Let's start the Locale class and see.
- Developer log entry:
- Necdet Can Atesman (2009-06-09): There are two distinct sources for locales. One is the database containing spunQ.language.Locale objects, and the other one is the file system containing translation files. The latter have already been implemented and unfortunately are mutually exclusive with those in the database: The language translations need to be loaded before the database during initialization of the framework. It will also lead to inconsistencies due to StorableObjects that don't have id's, etc, so we're leaving the Language class as-is and introducing the new spunQ_Locale class independently.
- Developer log entry:
- Necdet Can Atesman (2009-11-09): Having the two locales is very confusing. The single problem is that the system language needs to be initialized at a point where we don't have a database connection. So we'll add a getSystemLocale() function to spunQ_Locale that doesn't connect to the database to eliminate this problem.
Definition in file Language.class.php.