Only fetch client side translations for the current locale
This commit is contained in:
parent
e9abea3dd7
commit
ed82d0a756
8 changed files with 13 additions and 25 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
log
|
log
|
||||||
config/piwik.yml
|
config/piwik.yml
|
||||||
|
app/assets/javascripts/i18n
|
||||||
public/assets
|
public/assets
|
||||||
public/attachments
|
public/attachments
|
||||||
public/export
|
public/export
|
||||||
|
|
|
@ -24,6 +24,7 @@ before_script:
|
||||||
- psql -U postgres -c "CREATE FUNCTION xid_to_int4(xid) RETURNS int4 AS '/tmp/libpgosm', 'xid_to_int4' LANGUAGE C STRICT" openstreetmap
|
- psql -U postgres -c "CREATE FUNCTION xid_to_int4(xid) RETURNS int4 AS '/tmp/libpgosm', 'xid_to_int4' LANGUAGE C STRICT" openstreetmap
|
||||||
- cp config/travis.database.yml config/database.yml
|
- cp config/travis.database.yml config/database.yml
|
||||||
- bundle exec rake db:migrate
|
- bundle exec rake db:migrate
|
||||||
|
- bundle exec rake i18n:js:export
|
||||||
script:
|
script:
|
||||||
- bundle exec rubocop -f fuubar
|
- bundle exec rubocop -f fuubar
|
||||||
- bundle exec rake jshint
|
- bundle exec rake jshint
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
//= require leaflet.map
|
//= require leaflet.map
|
||||||
//= require leaflet.zoom
|
//= require leaflet.zoom
|
||||||
//= require leaflet.locationfilter
|
//= require leaflet.locationfilter
|
||||||
//= require i18n/translations
|
//= require i18n
|
||||||
//= require oauth
|
//= require oauth
|
||||||
//= require piwik
|
//= require piwik
|
||||||
//= require richtext
|
//= require richtext
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0"/>
|
||||||
<!--[if lt IE 9]><%= javascript_include_tag "html5shiv" %><![endif]-->
|
<!--[if lt IE 9]><%= javascript_include_tag "html5shiv" %><![endif]-->
|
||||||
<%= javascript_include_tag "application" %>
|
<%= javascript_include_tag "application" %>
|
||||||
|
<%= javascript_include_tag "i18n/" + I18n.locale.to_s %>
|
||||||
<%= stylesheet_link_tag "screen-#{dir}", :media => "screen" %>
|
<%= stylesheet_link_tag "screen-#{dir}", :media => "screen" %>
|
||||||
<%= stylesheet_link_tag "print-#{dir}", :media => "print" %>
|
<%= stylesheet_link_tag "print-#{dir}", :media => "print" %>
|
||||||
<%= stylesheet_link_tag "leaflet-all", :media => "screen, print" %>
|
<%= stylesheet_link_tag "leaflet-all", :media => "screen, print" %>
|
||||||
|
|
|
@ -52,6 +52,9 @@ Rails.application.configure do
|
||||||
# Suppress logger output for asset requests.
|
# Suppress logger output for asset requests.
|
||||||
config.assets.quiet = true
|
config.assets.quiet = true
|
||||||
|
|
||||||
|
# Export translations automatically
|
||||||
|
config.middleware.use I18n::JS::Middleware
|
||||||
|
|
||||||
# Raises error for missing translations
|
# Raises error for missing translations
|
||||||
# config.action_view.raise_on_missing_translations = true
|
# config.action_view.raise_on_missing_translations = true
|
||||||
|
|
||||||
|
|
|
@ -1,27 +1,8 @@
|
||||||
# Split context in several files.
|
export_i18n_js: false
|
||||||
# By default only one file with all translations is exported and
|
|
||||||
# no configuration is required. Your settings for asset pipeline
|
|
||||||
# are automatically recognized.
|
|
||||||
#
|
|
||||||
# If you want to split translations into several files or specify
|
|
||||||
# locale contexts that will be exported, just use this file to do
|
|
||||||
# so.
|
|
||||||
#
|
|
||||||
# If you're going to use the Rails 3.1 asset pipeline, change
|
|
||||||
# the following configuration to something like this:
|
|
||||||
#
|
|
||||||
# translations:
|
|
||||||
# - file: "app/assets/javascripts/i18n/translations.js"
|
|
||||||
#
|
|
||||||
# If you're running an old version, you can use something
|
|
||||||
# like this:
|
|
||||||
#
|
|
||||||
# translations:
|
|
||||||
# - file: "public/javascripts/translations.js"
|
|
||||||
# only: "*"
|
|
||||||
#
|
|
||||||
translations:
|
translations:
|
||||||
- file: "app/assets/javascripts/i18n/translations.js"
|
- file: "app/assets/javascripts/i18n/%{locale}.js"
|
||||||
|
pretty_print: true
|
||||||
only:
|
only:
|
||||||
- "*.date"
|
- "*.date"
|
||||||
- "*.time"
|
- "*.time"
|
||||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.config.assets.paths << Rails.root.join("config")
|
||||||
# application.js, application.css, and all non-JS/CSS in the app/assets
|
# application.js, application.css, and all non-JS/CSS in the app/assets
|
||||||
# folder are already added.
|
# folder are already added.
|
||||||
Rails.application.config.assets.precompile += %w[index.js browse.js welcome.js fixthemap.js]
|
Rails.application.config.assets.precompile += %w[index.js browse.js welcome.js fixthemap.js]
|
||||||
Rails.application.config.assets.precompile += %w[user.js login.js diary_entry.js messages.js edit/*.js]
|
Rails.application.config.assets.precompile += %w[user.js login.js diary_entry.js messages.js edit/*.js i18n/*.js]
|
||||||
Rails.application.config.assets.precompile += %w[screen-ltr.css print-ltr.css]
|
Rails.application.config.assets.precompile += %w[screen-ltr.css print-ltr.css]
|
||||||
Rails.application.config.assets.precompile += %w[screen-rtl.css print-rtl.css]
|
Rails.application.config.assets.precompile += %w[screen-rtl.css print-rtl.css]
|
||||||
Rails.application.config.assets.precompile += %w[leaflet-all.css leaflet.ie.css]
|
Rails.application.config.assets.precompile += %w[leaflet-all.css leaflet.ie.css]
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
files:
|
files:
|
||||||
- "**/*.js"
|
- "**/*.js"
|
||||||
exclude_paths:
|
exclude_paths:
|
||||||
|
- "app/assets/javascripts/i18n"
|
||||||
- "vendor/assets/javascripts"
|
- "vendor/assets/javascripts"
|
||||||
options:
|
options:
|
||||||
eqeqeq: true
|
eqeqeq: true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue