Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Multilingual Image Support in Fuel

  • I need to add support for multiple languages in a project.  I have the text part down no problem thanks to the docs and a few great articles I found including this one (http://www.marcopace.it/blog/2012/12/fuelphp-i18n-internationalization-of-a-web-application).

    Now I need to add image support.  I did not find anything for it in my searches in the docs.

    If not where do you think makes more sense, extending Lang or extending Assets.

    Basically I will simply look for a fr/my_image.jpg or cn/my_image.jpg based on current Lang and if not found simply use my_image.jpg.

    Nothing hard but don't want to reinvent the wheel if it's already there and I simply did not find it. 

    Thanks,
    Mike
  • HarroHarro
    Accepted Answer
    You don't need to extend anything.

    Get yourself an Asset instance, and use add_path() to add the language dependent asset path. That will also provide you with a fallback, if the language specific file isn't found, it will load the generic one (if pressent).

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion