Why in a standard rails application locales are in config directory and not in assets? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
How are these files assets? They''re not served to the end user, but are rather used by the backend to display information in different languages to the end-user, thereby making them configuration. On Wednesday, 4 April 2012 at 2:54 PM, Alexey wrote:> Why in a standard rails application locales are in config directory > and not in assets? > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
This sounds like it could be more of a feature request than a complaint. Compiling yaml files for translation (Or whatever store) down to maybe json for use might lend towards the more pro client-side views crowd. I haven''t even thought out the implications of such a thing, but it might be really cool to do that. ~Johnneylee On Wed, Apr 4, 2012 at 3:57 PM, Ryan Bigg <radarlistener@gmail.com> wrote:> How are these files assets? They''re not served to the end user, but are > rather used by the backend to display information in different languages to > the end-user, thereby making them configuration. > > On Wednesday, 4 April 2012 at 2:54 PM, Alexey wrote: > > Why in a standard rails application locales are in config directory > and not in assets? > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
That''s quite an interesting twist on it. I never thought of doing it that way, but now it would make sense to be able to have these made available to client-side applications which can then use them to translate... but what are the translation libraries like on the client-side these days? On Wednesday, 4 April 2012 at 3:00 PM, Johnneylee Rollins wrote:> This sounds like it could be more of a feature request than a complaint. > > Compiling yaml files for translation (Or whatever store) down to maybe json for use might lend towards the more pro client-side views crowd. I haven''t even thought out the implications of such a thing, but it might be really cool to do that. > > ~Johnneylee > > On Wed, Apr 4, 2012 at 3:57 PM, Ryan Bigg <radarlistener@gmail.com (mailto:radarlistener@gmail.com)> wrote: > > How are these files assets? They''re not served to the end user, but are rather used by the backend to display information in different languages to the end-user, thereby making them configuration. > > > > On Wednesday, 4 April 2012 at 2:54 PM, Alexey wrote: > > > > > Why in a standard rails application locales are in config directory > > > and not in assets? > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > > > > > > > > > > > > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core%2Bunsubscribe@googlegroups.com). > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
This library does exactly what you''re talking about here: https://github.com/fnando/i18n-js It''s a small library to provide the I18n translations on the Javascript. It comes with Rails support. It is for sure worth to take a look. -- At. Carlos Antonio On Wednesday, April 4, 2012 at 5:05 PM, Ryan Bigg wrote:> That''s quite an interesting twist on it. I never thought of doing it that way, but now it would make sense to be able to have these made available to client-side applications which can then use them to translate... but what are the translation libraries like on the client-side these days? > > On Wednesday, 4 April 2012 at 3:00 PM, Johnneylee Rollins wrote: > > > This sounds like it could be more of a feature request than a complaint. > > > > Compiling yaml files for translation (Or whatever store) down to maybe json for use might lend towards the more pro client-side views crowd. I haven''t even thought out the implications of such a thing, but it might be really cool to do that. > > > > ~Johnneylee > > > > On Wed, Apr 4, 2012 at 3:57 PM, Ryan Bigg <radarlistener@gmail.com (mailto:radarlistener@gmail.com)> wrote: > > > How are these files assets? They''re not served to the end user, but are rather used by the backend to display information in different languages to the end-user, thereby making them configuration. > > > > > > On Wednesday, 4 April 2012 at 2:54 PM, Alexey wrote: > > > > > > > Why in a standard rails application locales are in config directory > > > > and not in assets? > > > > > > > > -- > > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > > > > > > > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core%2Bunsubscribe@googlegroups.com). > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
Maybe this was a stupid question and i do not understand what assets exactly are. For me assets were things which are not Ruby code or user data, but on which the developer spends a lot of time. On Wednesday, April 4, 2012 9:57:10 PM UTC+2, Ryan Bigg wrote:> > How are these files assets? They''re not served to the end user, but are > rather used by the backend to display information in different languages to > the end-user, thereby making them configuration. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/KxrC7em_agcJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Wednesday, April 4, 2012 at 1:30 PM, Alexey wrote:> Maybe this was a stupid question and i do not understand what assets exactly are. For me assets were things which are not Ruby code or user data, but on which the developer spends a lot of time. >Assets are things that are embedded in a web page and get downloaded by the browser. This includes images (JPGs, PNGs), javascript files, CSS files, flash movies, mp3s, etc. Since locales are used only by the server and not downloaded by the browser, they are server configuration, not assets. -- Josh Susser http://blog.hasmanythrough.com> On Wednesday, April 4, 2012 9:57:10 PM UTC+2, Ryan Bigg wrote: > > How are these files assets? They''re not served to the end user, but are rather used by the backend to display information in different languages to the end-user, thereby making them configuration. > > > > > > > > > > > > > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/KxrC7em_agcJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
On Wednesday, April 4, 2012 11:25:26 PM UTC+2, Josh Susser wrote:> > > On Wednesday, April 4, 2012 at 1:30 PM, Alexey wrote: > > Maybe this was a stupid question and i do not understand what assets > exactly are. For me assets were things which are not Ruby code or user > data, but on which the developer spends a lot of time. > > > Assets are things that are embedded in a web page and get downloaded by > the browser. This includes images (JPGs, PNGs), javascript files, CSS > files, flash movies, mp3s, etc. Since locales are used only by the server > and not downloaded by the browser, they are server configuration, not > assets. > > -- > Josh Susser > http://blog.hasmanythrough.com >Josh, thanks for the explanation. However, i may argue that one can keep SCSS or CoffeeScript in assets, and those are not downloaded, only generated CSS and JavaScript are. YAML files of localizations are not downloaded, but the localized strings for the current page are. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/lhsv3Xp19oQJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
You''re right that they''re not downloadable. They''re still used in the process of generating assets that are downloadable. The ones that are downloadable live in public/assets anyway. On Wednesday, 4 April 2012 at 4:34 PM, Alexey wrote:> > > On Wednesday, April 4, 2012 11:25:26 PM UTC+2, Josh Susser wrote: > > > > > > On Wednesday, April 4, 2012 at 1:30 PM, Alexey wrote: > > > > > Maybe this was a stupid question and i do not understand what assets exactly are. For me assets were things which are not Ruby code or user data, but on which the developer spends a lot of time. > > > > > > > > > > > > Assets are things that are embedded in a web page and get downloaded by the browser. This includes images (JPGs, PNGs), javascript files, CSS files, flash movies, mp3s, etc. Since locales are used only by the server and not downloaded by the browser, they are server configuration, not assets. > > > > -- > > Josh Susser > > http://blog.hasmanythrough.com > > > > > > > Josh, thanks for the explanation. However, i may argue that one can keep SCSS or CoffeeScript in assets, and those are not downloaded, only generated CSS and JavaScript are. YAML files of localizations are not downloaded, but the localized strings for the current page are. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/lhsv3Xp19oQJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I give up about calling them assets, but maybe locales can be at least in app/ directory? On Wednesday, April 4, 2012 11:40:51 PM UTC+2, Ryan Bigg wrote:> > You''re right that they''re not downloadable. They''re still used in the > process of generating assets that are downloadable. The ones that are > downloadable live in public/assets anyway. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/FJeSmbkwA0MJ. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
You can put it inside the app directory too. Both are loaded. -- Rafael Mendonça França http://twitter.com/rafaelfranca https://github.com/rafaelfranca Sent with Sparrow (http://www.sparrowmailapp.com) On Thursday, 5 April, 2012 at 13:05, Alexey wrote:> I give up about calling them assets, but maybe locales can be at least in app/ directory? > > On Wednesday, April 4, 2012 11:40:51 PM UTC+2, Ryan Bigg wrote: > > You''re right that they''re not downloadable. They''re still used in the process of generating assets that are downloadable. The ones that are downloadable live in public/assets anyway. > > > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/FJeSmbkwA0MJ. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
You can put them anywhere you want. If you want to put them in assets, just add config.i18n.load_path += Dir[Rails.root.join(''assets'', ''locales'', ''*.{rb,yml}'').to_s] to your config/application.rb file. On Thu, Apr 5, 2012 at 11:35 AM, Rafael Mendonça França < rafaelmfranca@gmail.com> wrote:> You can put it inside the app directory too. Both are loaded. > > -- > *Rafael Mendonça França* > http://twitter.com/rafaelfranca > https://github.com/rafaelfranca > Sent with Sparrow <http://www.sparrowmailapp.com> > > On Thursday, 5 April, 2012 at 13:05, Alexey wrote: > > I give up about calling them assets, but maybe locales can be at least in > app/ directory? > > On Wednesday, April 4, 2012 11:40:51 PM UTC+2, Ryan Bigg wrote: > > You''re right that they''re not downloadable. They''re still used in the > process of generating assets that are downloadable. The ones that are > downloadable live in public/assets anyway. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-core/-/FJeSmbkwA0MJ. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com. > To unsubscribe from this group, send email to > rubyonrails-core+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
I would advise against doing this though. As a developer, I expect to find locales in config/locales. If things aren''t in their correct places, I tend to mildly freak out. On Thursday, 5 April 2012 at 1:40 PM, Andrés Mejía wrote:> You can put them anywhere you want. If you want to put them in assets, just add > > config.i18n.load_path += Dir[Rails.root.join(''assets'', ''locales'', ''*.{rb,yml}'').to_s] > > to your config/application.rb file. > > > On Thu, Apr 5, 2012 at 11:35 AM, Rafael Mendonça França <rafaelmfranca@gmail.com (mailto:rafaelmfranca@gmail.com)> wrote: > > You can put it inside the app directory too. Both are loaded. > > > > -- > > Rafael Mendonça França > > http://twitter.com/rafaelfranca > > https://github.com/rafaelfranca > > Sent with Sparrow (http://www.sparrowmailapp.com) > > > > > > On Thursday, 5 April, 2012 at 13:05, Alexey wrote: > > > > > I give up about calling them assets, but maybe locales can be at least in app/ directory? > > > > > > On Wednesday, April 4, 2012 11:40:51 PM UTC+2, Ryan Bigg wrote: > > > > You''re right that they''re not downloadable. They''re still used in the process of generating assets that are downloadable. The ones that are downloadable live in public/assets anyway. > > > > > > > > > > > > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > > To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/FJeSmbkwA0MJ. > > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core%2Bunsubscribe@googlegroups.com). > > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. > To post to this group, send email to rubyonrails-core@googlegroups.com (mailto:rubyonrails-core@googlegroups.com). > To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com (mailto:rubyonrails-core+unsubscribe@googlegroups.com). > For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-core+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.