I desperately try to put in place i18n for my project, in order mainly
to translate date/time formats, but the information I get from all the
different sources is either incomplete or contradictory :
Some say translation files should be placed in config/locales, others
in app/locales
Some say they should be a yaml file, others in rb file
...
My current configuration is the following :
1) I installed the i18n gem version 0.1.0
2) I created the translation file myproject/locales/fr-FR/fr-FR.yml,
containing :
"fr-FR:
date:
formats:
default: "%d/%m/%Y"
...<all the other formats>"
3) I created the initializer file myproject/config/initializers/
locale.rb, containing :
I18n.load_path += Dir.glob("#{RAILS_ROOT}/app/locales/**/*.yml")
I18n.default_locale = "fr-FR"
However, my dates are still in english and
I18n.localize(Date.today)
results in => I18n::MissingTranslationData: translation missing: fr-
FR, date, formats
from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/
active_support/...
What''s wrong ?
Thank you for oyur help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
my files:
#file config/locale/en.yml
en:
date:
formats:
ddate: "%d.%m.%Y"
time:
formats:
ddate: "%Y-%m-%d"
dtime: "%H:%M"
# and usage (somewhere in helper)
def showdate(date)
l(Time.at(date), :format => :ddate)
end
tom
Sacredceltic wrote:> I desperately try to put in place i18n for my project, in order mainly
> to translate date/time formats, but the information I get from all the
> different sources is either incomplete or contradictory :
>
> Some say translation files should be placed in config/locales, others
> in app/locales
> Some say they should be a yaml file, others in rb file
> ...
>
> My current configuration is the following :
>
> 1) I installed the i18n gem version 0.1.0
> 2) I created the translation file myproject/locales/fr-FR/fr-FR.yml,
> containing :
>
> "fr-FR:
> date:
> formats:
> default: "%d/%m/%Y"
> ...<all the other formats>"
>
> 3) I created the initializer file myproject/config/initializers/
> locale.rb, containing :
>
> I18n.load_path += Dir.glob("#{RAILS_ROOT}/app/locales/**/*.yml")
> I18n.default_locale = "fr-FR"
>
> However, my dates are still in english and
> I18n.localize(Date.today)
> results in => I18n::MissingTranslationData: translation missing: fr-
> FR, date, formats
> from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/
> active_support/...
>
> What''s wrong ?
>
> Thank you for oyur help
>
>
>
--
==============================================================================Tomas
Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz
==============================================================================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I get a "config/locales/fr-FR.rb:1: syntax error, unexpected '':'', expecting $end" Should the "en.yml'' file end with a "end" ? On Mar 14, 2:34 pm, Tom Z Meinlschmidt <to...-ooGa/4BNRfSw0JuIXryQZA@public.gmane.org> wrote:> my files: > > #file config/locale/en.yml > en: > date: > formats: > ddate: "%d.%m.%Y" > > time: > formats: > ddate: "%Y-%m-%d" > dtime: "%H:%M" > > # and usage (somewhere in helper) > > def showdate(date) > l(Time.at(date), :format => :ddate) > end > > tom > > > > Sacredceltic wrote: > > I desperately try to put in place i18n for my project, in order mainly > > to translate date/time formats, but the information I get from all the > > different sources is either incomplete or contradictory : > > > Some say translation files should be placed in config/locales, others > > in app/locales > > Some say they should be a yaml file, others in rb file > > ... > > > My current configuration is the following : > > > 1) I installed the i18n gem version 0.1.0 > > 2) I created the translation file myproject/locales/fr-FR/fr-FR.yml, > > containing : > > > "fr-FR: > > date: > > formats: > > default: "%d/%m/%Y" > > ...<all the other formats>" > > > 3) I created the initializer file myproject/config/initializers/ > > locale.rb, containing : > > > I18n.load_path += Dir.glob("#{RAILS_ROOT}/app/locales/**/*.yml") > > I18n.default_locale = "fr-FR" > > > However, my dates are still in english and > > I18n.localize(Date.today) > > results in => I18n::MissingTranslationData: translation missing: fr- > > FR, date, formats > > from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/ > > active_support/... > > > What''s wrong ? > > > Thank you for oyur help > > -- > =========================================================================== ===> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > =========================================================================== ===--~--~---------~--~----~------------~-------~--~----~You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
replace tab chars (\t) with spaces ... Sacredceltic wrote:> I get a "config/locales/fr-FR.rb:1: syntax error, unexpected '':'', > expecting $end" > > Should the "en.yml'' file end with a "end" ? > > > On Mar 14, 2:34 pm, Tom Z Meinlschmidt <to...-ooGa/4BNRfSw0JuIXryQZA@public.gmane.org> wrote: >> my files: >> >> #file config/locale/en.yml >> en: >> date: >> formats: >> ddate: "%d.%m.%Y" >> >> time: >> formats: >> ddate: "%Y-%m-%d" >> dtime: "%H:%M" >> >> # and usage (somewhere in helper) >> >> def showdate(date) >> l(Time.at(date), :format => :ddate) >> end >> >> tom >> >> >> >> Sacredceltic wrote: >>> I desperately try to put in place i18n for my project, in order mainly >>> to translate date/time formats, but the information I get from all the >>> different sources is either incomplete or contradictory : >>> Some say translation files should be placed in config/locales, others >>> in app/locales >>> Some say they should be a yaml file, others in rb file >>> ... >>> My current configuration is the following : >>> 1) I installed the i18n gem version 0.1.0 >>> 2) I created the translation file myproject/locales/fr-FR/fr-FR.yml, >>> containing : >>> "fr-FR: >>> date: >>> formats: >>> default: "%d/%m/%Y" >>> ...<all the other formats>" >>> 3) I created the initializer file myproject/config/initializers/ >>> locale.rb, containing : >>> I18n.load_path += Dir.glob("#{RAILS_ROOT}/app/locales/**/*.yml") >>> I18n.default_locale = "fr-FR" >>> However, my dates are still in english and >>> I18n.localize(Date.today) >>> results in => I18n::MissingTranslationData: translation missing: fr- >>> FR, date, formats >>> from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/ >>> active_support/... >>> What''s wrong ? >>> Thank you for oyur help >> -- >> =========================================================================== ===>> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache >> >> www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz >> =========================================================================== ===>-- ==============================================================================Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz ============================================================================== --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes, thank you, I just realized it was such an issue and I re-sourced the file. On Mar 14, 3:39 pm, Tom Z Meinlschmidt <to...-ooGa/4BNRfSw0JuIXryQZA@public.gmane.org> wrote:> replace tab chars (\t) with spaces ... > > > > Sacredceltic wrote: > > I get a "config/locales/fr-FR.rb:1: syntax error, unexpected '':'', > > expecting $end" > > > Should the "en.yml'' file end with a "end" ? > > > On Mar 14, 2:34 pm, Tom Z Meinlschmidt <to...-ooGa/4BNRfSw0JuIXryQZA@public.gmane.org> wrote: > >> my files: > > >> #file config/locale/en.yml > >> en: > >> date: > >> formats: > >> ddate: "%d.%m.%Y" > > >> time: > >> formats: > >> ddate: "%Y-%m-%d" > >> dtime: "%H:%M" > > >> # and usage (somewhere in helper) > > >> def showdate(date) > >> l(Time.at(date), :format => :ddate) > >> end > > >> tom > > >> Sacredceltic wrote: > >>> I desperately try to put in place i18n for my project, in order mainly > >>> to translate date/time formats, but the information I get from all the > >>> different sources is either incomplete or contradictory : > >>> Some say translation files should be placed in config/locales, others > >>> in app/locales > >>> Some say they should be a yaml file, others in rb file > >>> ... > >>> My current configuration is the following : > >>> 1) I installed the i18n gem version 0.1.0 > >>> 2) I created the translation file myproject/locales/fr-FR/fr-FR.yml, > >>> containing : > >>> "fr-FR: > >>> date: > >>> formats: > >>> default: "%d/%m/%Y" > >>> ...<all the other formats>" > >>> 3) I created the initializer file myproject/config/initializers/ > >>> locale.rb, containing : > >>> I18n.load_path += Dir.glob("#{RAILS_ROOT}/app/locales/**/*.yml") > >>> I18n.default_locale = "fr-FR" > >>> However, my dates are still in english and > >>> I18n.localize(Date.today) > >>> results in => I18n::MissingTranslationData: translation missing: fr- > >>> FR, date, formats > >>> from /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/ > >>> active_support/... > >>> What''s wrong ? > >>> Thank you for oyur help > >> -- > >> =========================================================================== ===> >> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > >>www.meinlschmidt.comwww.maxwellrender.czwww.lightgems.cz > >> =========================================================================== ===> > -- > =========================================================================== ===> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache > > www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz > =========================================================================== ===--~--~---------~--~----~------------~-------~--~----~You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---