Recent Topics

[2.x] Skin Localization

Started by on Jun 10, 2009 – Contents updated: Jun 10, 2009

Jun 10, 2009 12:24    

My b2evolution Version: 2.x

Is it posible to localize (translate) a skin? By this I don't mean to use already translated strings (which are in the global localization files) in a skin, but to provide a skin with its own set of translation, in its own _global.php file the same way we can do with plugins.

The case scenario is like this: my main site has a spanish and an english blogs, using the same skin. This skin has several custom texts, for instance rules for commenting and so forth. I could duplicate the skin, translate and assign the translated version to the other blog, but this is not so elegant, isn't it?

It would be much more elegant if could have a skins/<my-skin>/locales/es_VE/ directory the same way we have for Plugins. Is this possible?

(OFF TOPIC) BTW: What happens with the "Preview" button in this forum? It doesn't appear when posting new entries.

Jun 10, 2009 13:31

If this can not currently be done then it most certainly should be the number one feature to add.

Imagine a single installation with 4 bloggers each with their own locale selection and blog. Customizing the skin fully would be much cleaner if translation were automagically done to skin content that doesn't match the core text.

Sep 03, 2009 22:25

It can be done in 3.3.x, BTW. I've translated my skin's strings (currently limited to "Powered by" and the meta links) to Esperanto and Spanish, and now have a clean Esperanto locale without skin-specific strings. It took me a while to figure out how to utilize the skin's translation, but I finally figured it out. You do like this:
<?php echo $Skin->T_('String to translate'); ?>

Sep 03, 2009 23:37

I like how a skin can now carry translations, but for the text "Powered by" you could have used the very simple

Code

<?php echo T_('Powered by'); ?>
Only because that string is already part of the translation packages.

Again though one of the few features in 3.* I like is translatability of skins. This way the designer can (sort of) pick some text not typically part of the package.

Sep 05, 2009 05:06

EdB wrote:

I like how a skin can now carry translations, but for the text "Powered by" you could have used the very simple

Code

<?php echo T_('Powered by'); ?>
Only because that string is already part of the translation packages.

Yeah, I probably should rewrite how it's done. My skin is actually a ported version of the theme I was using in WordPress, which was just a souped up version of WordPress's Classic theme. It works by using a formatted string rather than simply translating "Powered by" and following it with the app name and app version.

"Powered by" by itself is nowhere in messages.pot in 3.3.1 (maybe it is in CVS; I miss the old days when everyone used CVS and you didn't have to install a thousand version-control systems to participate in projects).

Sep 05, 2009 05:45

zooplah wrote:

... "Powered by" by itself is nowhere in messages.pot in 3.3.1 ...

Well that's pretty stupid, but then again it actually makes sense. Ever since having a plain old boring html linkback wasn't good enough there is no need for that simple bit of text in the package. Instead your linkbacks are all driven by the database, which in turn gets them from headquarters when you let your back office call home. And when does that happen? Every time you hit an admin page!

spyware generating spammy linkbacks. gotta love it. another reason to not touch v3.* with a ten foot pole :(

Sep 05, 2009 06:39

EdB wrote:

your linkbacks are all driven by the database, which in turn gets them from headquarters when you let your back office call home. And when does that happen? Every time you hit an admin page!

spyware generating spammy linkbacks. gotta love it. another reason to not touch v3.* with a ten foot pole :(

Wow, I was actually reading [url=http://wonderwinds.com/hackblog.php/2009/04/29/stopping-spyware-from-infecting-your-b2e]a blog post about that[/url] the other day. Why do they do it?


Form is loading...

Advanced CMS – This forum is powered by b2evolution CMS, a complete engine for your website.