Jump to content

Match Languages to button sets


Guest Mark

Recommended Posts

OK, lets say I have English and Spanish in my language selector.

When a user changes to Spanish, all the content changes, as it should so.

However, the buttons do not, this means my skin list looks like this:
Skin 1(English)
Skin 1(Spanish)
Skin 2(English)
Skin 2(Spanish)


This is silly, there should be an option that says "If user's language is set to *** use which image directory?"

Or do something like this:

In style_images, let's say we currently have:

skin1_en
skin2_en
skin1_sp
skin2_sp


Our skins are called:

skin1
skin2


In lang_cache we have:

en
sp

I think if the system is using the lang foler "en" and the skin is set to "skin1" - the system should automatically match up skin1 with en and use "skin1_en".

Link to comment
Share on other sites

I think this is a good idea. I would simply leave the skin options as is (marking the selected style images directory as the "default" one) though and add some new options to the language areas. Scratch that I would simply have the language look for a "default_imgdir"_en /_sp etc on load and if it doesn't exist load the default.

Link to comment
Share on other sites

  • 2 months later...

+1
Absolutely needed! for multi-language forums like mine.

1) Images sets linked to skin sets

2) Dates
Something also missing, is the ability to get dates correctly displayed in each language set.
Because, once you setuped the date in the ACP, in english for example, all users using a diffrent language pack are sticked to english dates...

3) Help pages, in multiple languages:
When your help pages are for example in english, all users , despite they choose another languages, will read help pages in english... too bad ;-)

This 3 things would make multilanguage boards really multi-language!

Link to comment
Share on other sites

Well there would be no need to change the image set folder at all. What needs to be done is add a sub-folder to the image folder according to the language pack. Like style_images/1/en/ or style_images/1/sp/. All the images with some type of language, like buttons, would be in there and everything else would stay the same. It's not very hard to do at all actually. All the graphics with language are setup as macros. All you would need to do is add the variable for the language being used in the path. The problem is the Macro's are replace on-the-fly. They need to be replaced in the cache so you can drop a variable like that into it. Or simply adding a find-and-replace on the skin output called <~LANG~> to use in the macro's would work. That would actually be an easy modification.

+1 for sure

Link to comment
Share on other sites

Here is a one line modification that should suit your needs:

Open up /sources/ipsclass.php

FIND:

$this->ipsclass->skin['_wrapper'] = str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $this->ipsclass->skin['_wrapper'] );

ADD BEFORE:

$this->ipsclass->skin['_wrapper'] = str_replace( "<#LANG_ID#>", $this->ipsclass->lang_id, $this->ipsclass->skin['_wrapper'] );

Save and Upload Then open up your AdminCP and in the drop down go to "Edit Replacement Macros" on every skin. Go through all the graphics that have language in them and replace:

/<#IMG_DIR#>/

With:

/<#IMG_DIR#>/<#LANG_ID#>/



After that move all these graphics to a sub-directory according to the language packs. For example for the english language pack you would use "/en/".

Very simple, and a worthy change.

If something like this were built into IPB, I would rather have these replacements be made to the cache instead of on-the-fly. It would require you to rebuild templates that have these macros when you edit them, but it may be worth it on the board-end.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

Many thanks to Luke!
That's a great idea/fix that would have saved me from numerous skin changes, if I just had seed this post earlier. :(
Let me say that in 2.3.6 the definition should go to sources/classes/class_display.php
I surely hope a similar feature will be added in IPB3.0.
Furthermore, unfortunately not EVERY button is added as a replacement macro (some are added in skin_templates, source files or in javascript),
I hope there will be improvements in this aspect in IPB 3.0.

Link to comment
Share on other sites

This topic is almost 3 years old... I do find it interesting reading posts I made before I became a staff member...

Anywhoo, In IP.Board 3.0, the buttons aren't images, and thus they change with the language selection :)

Link to comment
Share on other sites


Anywhoo, In IP.Board 3.0, the buttons aren't images, and thus they change with the language selection :)



Wow! Thanks!
I didn't notice that as well! Well the guy that designed all these images for so many skins to support
both languages is really going to have a big party tonight :D
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...