Displaying 7 results from an estimated 7 matches for "set_locale".
2010 Jul 08
1
[Rails3] Issue in modifying locale and redisplaying page
...e the language of
the site.
I use an Ajax request to an action in which the locale is changed, and
the it''s redirected to the home page
unfortunately, the locale seems to be changed but the home page
doesn''t reflect the new language ..
application_controller.rb
.. before_filter :set_locale
def set_locale
I18n.locale = params[:locale]
end
def default_url_options(options={})
{:locale => I18n.locale}
end
jquery Ajax request in application.js
jQuery(document).ready(function() {
// handle change events from language selector
$("select[id^=''lang...
2006 Jul 03
0
Problem with routes
...roducts
There''s no routing error and the page is correctly displayed. But why
there''s ''admin'' group twice in the url? When i remove one it still
works.
Could it be caused by this method?
class ApplicationController < ActionController::Base
before_filter :set_locale
def set_locale
if !params[:locale].nil? && LOCALES.keys.include?(params[:locale])
Locale.set LOCALES[params[:locale]]
else
redirect_to params.merge( ''locale'' => Locale.base_language.code )
end
end
end
Thanks in advance
--
Posted via http:/...
2006 May 03
1
Globalize app example anywhere?
...se it.
1. Can i translate names of models and columns using this plugin?
2. What file should i edit to translate names of months, days etc?
3. Do i have to change the default route? It''s not mentioned in the
wiki, but it''s changed in the pdf presentation.
4. Do i have to provide set_locale method? (same as in question 3)
5. Do i have to create a single view for all languages (and provide
translation of the static content somewhere) or a separate view for
every translation (and provide translation of the static content there).
6. Is it possible not to display an object if there'...
2005 Feb 08
2
Tagging Flac-files in GNU/Linux and Windows
I posted this in the Hydrogenaudio Forums
(http://www.hydrogenaudio.org/forums/index.php?showtopic=31347) but I'll
post it here as well, hope that's ok...
----------------------------------------------------------------------
Hello,
I am having a lot of problems with tagging FLAC-files. I edited the tags
in XMMS (in Linux) using the FLAC plugin, version 1.1.o. Playback worked
fine with
2006 Nov 26
0
[758] trunk/wxruby2: i18n support: added Locale class, methods for get/set languages & encodings
...ttings and is a
+generalization of the C locale concept. This class''s methods may be used
+to discover information about the user''s default language, such as its
+canonical name, description and character encoding. It may also be used
+to set an alternative locale, via @Wx::Locale.set_locale@. This will
+affect things like the default date format.
</ins><span class="cx">
</span><del>-In Widgets this class manages message catalogs which contain the translations
-of the strings used to the current language.
</del><ins>+In WxWidgets this clas...
2005 Mar 01
0
Tagging Flac-files in GNU/Linux and Windows
...he
> programs
> writing the tags incorrectly, but reading them the wrong way?
this is hard to debug remotely. tags are stored internally in
utf-8 but there are many possible places between a tagger
interface and libFLAC where things can go wrong. one known
problem is that flac/metaflac use set_locale to try and match
the user's locale so that tags coming in on the command line
will be converted correctly, but I don't know if that works
on windows.
> And then another question; when encoding from the command line, is
> there
> any way to set the name of the file to be the TITLE...
2006 Jan 15
15
Gettext and Rails ?
Hello,
I''m trying to use ruby-gettext 1.1.1 (installed with gem) with rails and
here is all I get :
undefined method `init_gettext'' for ApplicationController:Class
Here is my source :
require ''gettext/rails''
class ApplicationController < ActionController::Base
init_gettext "test"
end
As a Nuby, I don''t really know what to do.