Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7368167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:37:52+00:00 2026-05-29T03:37:52+00:00

I am building a single page ajax app with BackboneJS and a RoR 3.2

  • 0

I am building a single page ajax app with BackboneJS and a RoR 3.2 (upgraded from 3.1) backend. I use a client side I18n javascript translation library that holds its data in a JSON object. I am managing the translations in the backend with yml files and the default i18n gem.
I have one translation asset per language, e.g English:

//FILE: <project_root>/app/assets/javascripts/translations/en.js.erb:
I18n || (I18n = {});
I18n.translations || (I18n.translations= {});
I18n.translations["en"] = <%= I18n.with_locale(:en) { I18n.t(".") }.to_json %>;

My translations are under config/locales/ and its sub-directories. I configured the load path as follows:

config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')]

So far so good, everything works fine, however, new translations added to the yaml files are not automatically available on the client after a page reload in dev mode. The new translations are only available if I restart the server and make a change in the corresponding translation asset (e.g. adding a blank line). This routine is pretty tedious…

  1. How can I explicitly tell the asset pipeline/sprockets to reprocess my translation assets every request? Or even better, is there a (simple) solution to monitor the yaml files and tell sprockets to reprocess the translation assets?
  2. Rails somehow does not auto-update the i18n translation hash when new translations are added to new or existing yaml files. I don’t know why but this should normally work. Any clue?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:37:52+00:00Added an answer on May 29, 2026 at 3:37 am
    1. i have not seen the possibility to reload it on every request. i think that this needs to be addressed in the i18n-js gem. deleting tmp/i18n-js.cache was not helpful. the thing that you can do is call rake i18n:js:export which should reload the js output. combined with guard, you could do a reloading yourself.

    2. rails misses new translation-files, but adding translations to an existing file should work. you can also force it with I18n.backend.reload!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a single HTML page for use in a touch-screen kiosk. I
I have been building a single page app using requireJS and so far loving
Building a client-side swing application what should be notified on a bus (application-wide message
I'm building a simple aggregator-type app that would pull in data from multiple websites
I am building a simple blog which is viewed single-page (do not worry, it
HI, using vs2008 and building a web app. On a asp page called blackjack.aspx,
I'm writing a little single page app (using knockout.js :-)) whereby i have a
I am building a single-page web application and I've been looking for a library
I am currently considering to build a single page web app using restful api
I'm building a single page application (e.g. like gmail) and I was wondering which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.