Files
2012-02-21 01:15:00 -05:00

1 line
2.9 KiB
JSON

[{"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319350625.9885061, "message": "I'd like to use the Padrino Translation helpers defined in http://www.padrinorb.com/api/Padrino/Helpers/TranslationHelpers.html. The guide at http://www.padrinorb.com/guides/localization#how-to-localize-your-app suggests that I need the following somewhere:", "group_id": 10410, "id": 2411743}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319350640.285825, "message": "# config/boot.rb\nPadrino.before_load do\n I18n.locale = :de\nend", "group_id": 10410, "id": 2411747}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319350653.9390371, "message": "Presumably this would go in config.rb, but will everything else happen automagically? E.g. looking in /locale/de.yml ? To test this out, I created https://github.com/mikemee/test-i18n-middleman. It adds the above initialization to the config.rb file, but that fails with an undefined method \"before_load\". When I comment it out, the translation line in index.html: <p><%= I18n.t(\"foo\") %></p> gives the following in the page \"translation missing: en.foo\". Any advice on how to link these dots? Thx! Btw, I'll be happy to create a new guide page / add to an existing one, with the info provided.", "group_id": 10410, "id": 2411748}, {"user_id": 7586, "stars": [], "topic_id": 46938, "date_created": 1319469147.522562, "message": "The forthcoming middleman-i18n extension will basically just be a bridge between this functionality and MM. You probably don't need the before_load block, just set the locale directly in your config.rb and MAYBE it will fine the YAML.", "group_id": 10410, "id": 2421076}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319508030.797544, "message": "I added just the \"I18n.locale = :de\" to my config.rb file, and it did change something. Now the error is \"translation missing: de.foo\". So if I can work out the right place to put the de.yml file (currently its in ./locale) then it might work...", "group_id": 10410, "id": 2426114}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319509943.3485391, "message": "Worked it out. Add this to the config.rb and then it behaves appropriately (for the specified language anyway)", "group_id": 10410, "id": 2426291}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319509945.2921801, "message": "I18n.locale = :en\nI18n.load_path += Dir[ File.join(Dir.getwd, 'locale', '*.{rb,yml}') ]\n", "group_id": 10410, "id": 2426292}, {"user_id": 41657, "stars": [], "topic_id": 46938, "date_created": 1319510206.494993, "message": "https://github.com/mikemee/test-i18n-middleman is updated with this working version. ", "group_id": 10410, "id": 2426314}, {"user_id": 7586, "stars": [], "topic_id": 46938, "date_created": 1319519824.4165759, "message": "Great, thanks.", "group_id": 10410, "id": 2427219}]