Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Multilingual Image Support in Fuel
mikepmtl
November 2013
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
Harro
November 2013
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).
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
November 2013