Forum: Rails I18n Advice for image folders in an i18n app

73c04e9ef9ca435c5b19a2e765ae6d20?d=identicon&s=25 Max Williams (max-williams)
on 2010-01-31 22:42
Hey all.  I'm starting my first i18n app and pondering how to organise
my images and stylesheets.  I can think of a couple of ways but thought
that this problem has probably already been solved many times by people
much more experienced than me.  Here's what i have so far anyway, i'm
grateful for any advice.

option 1 - complete duplication.

english images in /images/en
german images in /images/de

all images, even the ones that don't have any text in them, are saved in
every folder.

stylesheets are also duplicated, so you load eg
/stylesheets/en/admin.css and that points to images in /images/en

To deal with this duplication i'd probably have a master folder
containing all the images that are the same in all languages, and a
master stylesheet, and then a script to copy images to the various
localised folders and to duplicate the stylesheets around, gsubbing (eg)
/images/locale to /images/en or whatever.

This seems very complicated but in terms of what each user can see it's
pretty easy to get your head around.

option 2 - shared global folder and localised folders.
have a structure like
/images/global
  - all the images with no text
/images/en
  - english specific images
/images/de
  - german specific

This is harder to deal with from a stylesheet point of view, although
again i could have a script which copies a master stylesheet to various
localised versions with 'locale' replaced by the actual locale.
This topic is locked and can not be replied to.