Commit graph

36 commits

Author SHA1 Message Date
Tom Hughes
4ee60c0f8f Make all translation lookup errors throw exceptions in test mode 2019-12-16 21:54:11 +00:00
Tom Hughes
9f57f60b87 Fix new rubocop warnings 2019-04-23 09:33:34 +01:00
Tom Hughes
6c2093b29d Fix new rubocop warnings 2018-09-22 17:12:29 +01:00
Tom Hughes
f8f7054fc2 Move monkey patch modules to the OpenStreetMap namespace
Having them in the OSM namespace risks blocking autoloading
of the lib/osm.rb code by defining the OSM constant.
2017-06-02 16:33:27 +01:00
Tom Hughes
f940a154f3 Replace alias_method_chain with Module#prepend 2017-06-01 22:45:28 +01:00
Tom Hughes
4028f4cdb9 Rework locale selection
Implement our own matching algorithm rather than trying to
patch the http_accept_language one and make sure everything is
using it in a consistent way.

Fixes #1125
2016-01-06 18:43:25 +00:00
Tom Hughes
445e608bae Update to latest upstream i18n-js
The issues we had before seem to be fixed now, so drop our
custom version and go back to the upstream one with some minor
monkey patching tweaks.

This also fixes the sprockets dependencies to correctly rebuild
the javascript when the translations change.
2015-06-16 19:17:37 +01:00
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Adam Conrad
9934eed190 Remove unnecessary local variable
The local variable `app` was unused and therefore not needed
to be declared with initialization
2014-12-08 07:59:49 +00:00
Tom Hughes
cc4bca22b0 Update to rails 4.0.2 2013-12-03 21:09:10 +00:00
Tom Hughes
f1a325684d Wait until after rails has initialise I18n to preload the resources 2013-04-01 14:18:21 +01:00
Tom Hughes
7bb267caec Force translations to be preloaded during startup 2013-04-01 14:18:21 +01:00
Tom Hughes
05b4406c14 Remove monkey patch for I18n which is no longer needed 2012-09-30 14:07:41 +01:00
Tom Hughes
81336c4a87 Monkey patch I18n::JS to ensure translations are in a fixed order
Without this the result of converting the hash to JSON can vary
which causes different hashes for the result JS asset.

This is only an issue with ruby 1.8 as ruby 1.9 hashes behave like
the ActiveSupport::OrderedHash and enumerate in insertion order.
2012-08-31 11:51:58 +01:00
Tom Hughes
a48f2ac856 Update to rails-i18n 0.5.2 and remove monkey patch 2012-03-17 17:04:02 +00:00
Tom Hughes
c5a54b779c Add a temporary hack to suppress some broken rails translations
See https://github.com/svenfuchs/rails-i18n/issues/194 for more
information and progress on an upstream fix.
2012-03-06 09:21:26 +00:00
Tom Hughes
a1321f2c50 Remove translation reload that is no longer needed
Now that we are using the rails-i18n gem the rails locales are added
to the path early on and we don't need to reload to get them.
2012-03-04 15:10:51 +00:00
Tom Hughes
06934ad375 Update rails-i18n to 0.5.1
This update allows us to drop our pluralization support, as rails-i18n
now takes care of that, and for a far wider range of locales.
2012-03-02 09:19:12 +00:00
Tom Hughes
ece52c818f Remove fallback from nb to no
Now that we are using nb for our translations we can drop the fallback
from nb to no and just have one the other way. This also allows us to
drop the monkey patch to support mutually recursive fallbacks.
2011-12-29 15:11:45 +00:00
Tom Hughes
d5561dd27a Use normal fallbacks to handle the no/nb confusion
This requires (for now) a monkey patch to the i18n fallback code, which
has been offered upstream as https://github.com/svenfuchs/i18n/pull/130.
2011-12-18 16:51:14 +00:00
Tom Hughes
5f0868bd49 Monkey patch in an upstream fix for I18n::Backend::Fallbacks
This can be removed when a new i18n gem release happens. It also allows
us to remvoe an old monkey patch that worked around the problem for one
specific translation key.
2011-12-18 15:54:38 +00:00
Tom Hughes
11cc7ebaa7 Use I18n::Backend::Simple.include directly 2011-12-18 15:49:21 +00:00
Tom Hughes
2cac555019 Force an I18n reload to work around ordering problem
Unfortunately the rails-i18n-updater plugin adds the rails translations
to the load path after rails has already loaded the translations, so we
have to force a reload to get the translated versions.
2011-11-14 09:42:57 +00:00
Tom Hughes
e1213a4651 Use Rails.xxx instead of RAILS_XXX 2011-11-14 09:42:40 +00:00
Tom Hughes
beeb77721f Update to Rails 2.3.11
Update the site to use Rails 2.3.11 which also required switching to
the new syntax for interpolated variables in translation strings.
2011-05-31 18:11:31 +01:00
Tom Hughes
10033fded1 Switch to i18n version 0.5.0 but keep old style interpolation
It's impossible to stop rails 2 loading a newer i18n gem if it is
installed, so go with the flow and use the latest one but override
the interpolation pattern for now.
2011-04-06 20:39:20 +01:00
Tom Hughes
6669253f9c Suppress deprecation warning from i18n 2010-09-02 20:00:43 +01:00
Tom Hughes
782ddc9c3e Require i18n version 0.4.1 and fix monkey patch to work with it
Rails 3 pulls in i18n version 0.4.1 as a separate gem which then
breaks our code if it is running on a machine with rails 3 installed
as it tries to monkey patch i18n and fails, so this fix allows us
to run on a machine with rails 3 installed.
2010-09-02 19:01:21 +01:00
Tom Hughes
d516198bbe Update to rails 2.3.8
Update site to use rails 2.3.8 which also allows us to drop the
globalize2 plugin as the core rails i18n code can now do fallback
and pluralization.
2010-05-26 19:54:10 +01:00
Matt Amos
9a9e13af90 Bit more work on the contributor terms page - still very much a work-in-progress. 2010-04-12 23:55:05 +00:00
Matt Amos
b99e870291 Initial version of contributor terms changes. 2010-03-22 22:51:09 +00:00
Tom Hughes
aa90ace7b4 Add placeholder file for nb translations and arrange to merge nb and
no translations at startup.
2010-03-18 22:33:05 +00:00
Tom Hughes
07172166da Monkey patch rails to work around stupid I18n bug where it looks up
time.formats in the locale and then looks for the requested format in
that hash, thereby not doing fallback correctly. To make things worse
it then defaults to just using the requested format name as the format...
2010-03-01 00:55:27 +00:00
Tom Hughes
6af3f93761 Update the :en and :sl pluralizers to default to :other if a more
specific key does not exist. This then allows r16613 to be reverted
as there is no need to distinguish the cases. Fixes #2087.
2009-07-21 20:23:07 +00:00
Tom Hughes
9830cb27e1 Add custom pluralizer for Slovenian. Fixes #2049. 2009-07-13 08:47:59 +00:00
Tom Hughes
a493d3676d Log missing translations. 2009-05-31 17:10:03 +00:00