Carl McDade wrote:
There should be an effort to externalize all english text into default variables. It makes a great step towards true internatiolization. Does not cost anything in terms of performance or matainance. What it does do is make the code that uses hard coded strings open and more resuable.
-function message_access() { - return t('You are not authorized to access this page.'); +function message_access($message = 'You are not authorized to access this page.') { + return t($message); }
I do not see how this helps with translation, internationalization and localization efforts. Could you clarify? I do know the following: 1. Using code like this probably results in PHP making a copy of each string into a variable, and that costs execution resources. 2. Currently all strings that can be translated or localized are wrapped in calls to t(), making such translation and localization fairly straight forward. 3. Drupal has been translated and localized into a bunch of different languages and countries around the world, even some east Asian counties. 4. The choices for what represents the messages to be translated are limited to one of two classes: (1) a natural language, or (2) a symbol. In the case of (2) symbols, the development of the software is equally difficult and clumsy for all developers. I've actually worked on such a commercial project, with good tools, and it was still cumbersome and annoying. In the case of (1), the question becomes which natural language do you choose? No matter which one, some developers will be handicapped somewhat. However, choosing English, as Drupal has, handicaps the fewest developers, as English is widely used. It's not a perfect solution, but I have not seen any better ones. Or if I put on my systems analyst hat, I am led to ask this: What is the real problem you are trying to solve? Sometimes a proposed solution to a perceived problem blinds us to other possibilities. Could you state the larger problem you have encountered for which this is a proposed solution? -- Chris Johnson