kolber / stacey

Cheap & easy content management
http://staceyapp.com
MIT License
1.04k stars 132 forks source link

Stacey Multi-Lang #53

Open joachimesque opened 12 years ago

joachimesque commented 12 years ago

Hello,

(I'm kinda new to github. also I'm a graphic designer, so dev is not my forte)

I've toyed a bit with Stacey last month, and discovered recently the version 3, with support for TWIG and such. I haven't looked at it in details yet, but I'd be interested to know if there's the possibility to build a multi-language website with Stacey...

Ideally it would mean having a project at example.com/en/project/example but at the same time, the same images would be used for other languages

I guess it would mean 3 different YML for each folder, like en.project.yml, fr.projet.yml and de.projekt.yml each being called by a different template...

Do you think such a thing could be possible? If it's not doable right away, would you consider that an hypothetical feature in the future?

Thank you :)

lunelson commented 12 years ago

The ML question has been on the Stacey GetSatisfaction board for a long time as well; so until a solution emerges for Stacey, and at the risk of sounding like a troll, I'll point out that there's another system called Kirby, superficially very similar to Stacey, which implements this.

http://getkirby.com/

joachimesque commented 12 years ago

Thanks for the answer, I'll look into Kirby :)

Would you think it possible to make a multi-lang Stacey site without URL localization?

lunelson commented 12 years ago

I really don't know. It's beyond my expertise, otherwise I'd have done
it. Would love to have been able to contribute that to Stacey...

joachimesque commented 12 years ago

I gave it a try, and I miserably failed.

I guess a first step would be to have the Twig i18n extension working in Stacey http://twig.sensiolabs.org/doc/extensions/i18n.html Then, a way to select which text file is loaded (every text file begining with the lang code, e.g. en.project.yml Sadly it's way over my abilities...

lunelson commented 12 years ago

Ah, interesting. Well, maybe someone will pick that up

kolber commented 12 years ago

Does Kirby do this? I can't find any information to suggest it does?

I havent messed around with setting up multi-language sites before, so I'm not sure the best solution here. Switching content files based on language-type seems appropriate, but how does one set the language to begin with?

Through a dropdown visible on the site? A cookie? Strictly through the URL?

lunelson commented 12 years ago

It's a branch of the github repo. This blog post explains it

http://getkirby.com/blog/multilang-preview

joachimesque commented 12 years ago

The default language could be picked up with the help of the .htaccess... My only experience in a ML site was to use +MultiViews to switch between French and English :

# Language Configuration
#
AddLanguage fr .fr
AddLanguage fr-fr .fr
AddLanguage fr-ca .fr
AddLanguage en .en
Options +Multiviews
LanguagePriority en fr
ForceLanguagePriority Fallback

This will redirect all the French visitors to index.html.fr, and the rest to index.html.en. I don't know if it would be a good solution for Stacey.

I guess a better way to redirect the visitor would be through a cookie and a RewriteRule.

adriencater commented 12 years ago

What i've done for a site that needed this (http://inner-space.ch/) was to customize the templates, defining content_en: and content_fr: fields, and then using JQuery to display the appropriate language. It's not extraordinarily elegant, but it got the job done. JS code is in the page source, you can have a look.

luisnicg commented 11 years ago

I made some modifications to implement multi language support.

This is the sample code: https://github.com/luisnicg/staceyCMS_multilanguage