Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Add I18n support #163

Open
ghost opened this issue Jun 28, 2014 · 11 comments
Open

Add I18n support #163

ghost opened this issue Jun 28, 2014 · 11 comments

Comments

@ghost
Copy link

ghost commented Jun 28, 2014

spree_static_content would provide greater support for international shops if the extension supports spree_I18n. Especially I'm lacking translations of paths for a static page, e.g. '/welcome', '/willkommen', '/bienvenue'.

One way to handle this is to create several pages, which makes updating through tools like Locale a clunky job. The spree products creation process is a good role model for creating a static page with translations:

  • add static page first through backend
  • click on (missing) button 'translations'
  • add translation for all fields, such as title, path, contents, etc.

What is your opinion about the idea? How do you guys handle static pages and I18n?

@nunopolonia
Copy link

I implemented the i18n support in my fork of this gem (https://github.com/nunopolonia/spree_static_content)
It works exactly as you describe but in order to do it it adds spree_i18n as a dependency which is a big gem.
If the core team feels it makes sense to have it by default, I can make a pull request. If not, perhaps it's better to extract this functionality into a gem of it's own like spree_static_content_i18n or something like this.

@j540
Copy link

j540 commented Oct 29, 2014

@nunopolonia , It would be great to also have a translation for the 'LAYOUT' field

@nunopolonia
Copy link

@j540 can you open an issue on my fork and I will implement it ASAIC?

@j540
Copy link

j540 commented Nov 2, 2014

I must be missing something, but it seems that issues are disabled on your fork.

@nunopolonia
Copy link

You're right @j540. They're up now

@futhr
Copy link

futhr commented Dec 3, 2014

@nunopolonia nice i18n support in your fork, the problem is just how to deal with the migration if someone don't want to use spree_i18n. The rest of the code can be conditionally applied. Spree i18n gem use Globalize that is good if you need to support a lot of languages, for regular Rails projects with 2-3 locales I prefer traco gem to avoid the extreme n+1 queries that comes with Globalize (and many other chained issues that comes with it).

But I think this gem can be more globally useful if it has i18n support per default and use spree_i18n as a runtime dependency. What you think @peterberkenbosch ?

@francesco-carrella
Copy link

Hello, any chance to see @nunopolonia code in the main repo?

@lucamonfredo
Copy link

👍 on this one. Please add support for spree_i18n and spree_globalize.
ping @futhr , @nunopolonia : any news?

@futhr
Copy link

futhr commented Jun 22, 2015

Hi, spree_i18n seems to be in status of some major changes where the globalize part probably going to be extracted to its own gem but its still unclear related to how and when. The commits in @nunopolonia's fork are a good starting point, but there are lots of other work that has to be done to make it mergeable. If anyone up for it you welcome to cherry pick his commits and continue the labour.

@Whelton
Copy link

Whelton commented Sep 24, 2015

Hi all, encountered as I wanted to use in my localised Spree store.

Thank you @nunopolonia, your work was a great starting point and I just forked the latest of this repo, copied his changes, then did some relevant tweaks to the versions I use in my project:

You can see here my fork here: https://github.com/Whelton/spree_static_content

To update anyone else, they abstracted the model translation bits out of spree-contrib/spree_i18n and put them in a separate gem spree-contrib/spree_globalize

The only caveat I can see is that in my version of spree_globalize the namespace is Spree::Globalize, however that was recently changed to SpreeGlobalize, as of this PR merge spree-contrib/spree_globalize@8c6546f

Happy to make an update to be good with SpreeGlobalize master and make a PR, if others like!

@futhr
Copy link

futhr commented Sep 25, 2015

Nice work @Whelton

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants