What is a theme???

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

What is a theme???

Post by alex.barylski »

What do you think a theme should encompass???

I personally have always included the following:

- Layout Images
- HTML Templates w/ CSS, JScript, etc...

However now that i'm branching into the world of making my web apps multi-language I'm contemplating moving language files into the theme's directory as well...

Reason being, some themes may use icons and others may use text or include verbose descriptions...

So I figured perhaps language files would also be theme specific, causing quite a bit of redundancy, but required...

so...

What do you think as a programmer you would prefer?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

I'd keep language seperate, have a language directory and have each language have a folder, with an index in each folder that includes all the other .php files for that language, inside the language's php files you have a bunch of defines,

then when your theme outputs something like a welcome message you do

Code: Select all

echo (LANG_WELCOME);
This way you can let the user change their language in their control panel or what not, and just include the corresponding language definitions for each user
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: What is a theme???

Post by Roja »

Hockey wrote:However now that i'm branching into the world of making my web apps multi-language I'm contemplating moving language files into the theme's directory as well...
I generally make the game language independent first, and do theming second. By doing so, I ensure that the language files aren't theme-specific.

Language files, which are output text, are data. It doesn't belong with themes (layout and style).
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Language files, which are output text, are data. It doesn't belong with themes (layout and style).
I'd have to argue it "depends". We all know about the "depends" argument - all those odd exceptions and references to a "developer's preferences", et all. ;)

Text is content, content is? Static? What if you want to change some content - just for kicks lets say, between themes? Point I'm trying to make (in my usual merry-go-round fashion) is that you can simply leave language mixed up in HTML in language specific sub-directories of a theme.

It has its issues, everything does, but is there anything technically wrong with having a bunch of simple html (with content) files rather than a bunch of html (with placeholders) files and language file(s), needing to be linked? What if the html needs language specific adjustments? What if it needs specific CSS changes?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Maugrim_The_Reaper wrote:
Language files, which are output text, are data. It doesn't belong with themes (layout and style).
I'd have to argue it "depends". We all know about the "depends" argument - all those odd exceptions and references to a "developer's preferences", et all. ;)

Text is content, content is? Static? What if you want to change some content - just for kicks lets say, between themes? Point I'm trying to make (in my usual merry-go-round fashion) is that you can simply leave language mixed up in HTML in language specific sub-directories of a theme.

It has its issues, everything does, but is there anything technically wrong with having a bunch of simple html (with content) files rather than a bunch of html (with placeholders) files and language file(s), needing to be linked? What if the html needs language specific adjustments? What if it needs specific CSS changes?
Sweet :)

Thats all I needed to continue the madness...

Thing is...my app supports themes and mutli-language support

Currently have two themes (each requires a seperate language pack)...

Here is the reason behind having theme specific language tables...

Each theme targets a different user...one theme is mostly icons for advanced users...the other is more textual - very verbose!!! for newbies :)

Besides...I figure how difficult can it be to keep on track of simple string tables :)

Cheers :)
d_d
Forum Commoner
Posts: 33
Joined: Wed Jul 07, 2004 4:56 pm
Location: UK

Post by d_d »

Keeping themes and language files separate will make it easier for non programmers to do translations. Since you may have to explain the process to people who don't speak English as their first language the simpler it is the better.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

Keeping themes and language files separate will make it easier for non programmers to do translations
Except themes are generally a mix of HTML and CSS - the only PHP will (or should) be presentation logic. This logic rarely needs changing for varying languages, while the HTML/CSS may. Do you need to be a programmer to read HTML?
Post Reply