-
-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
missing translations deploying to Heroku #496
Comments
Try I have this file to invalidate the cache for translations: # config/locales/app_locale_cache_key/en.yml
en:
# Since i18n-js use file content as cache key
# To avoid changing other useful content
# Putting this here as a cache expiring method by updating this content
# And content within this file should never be used
cache_key: "v2018_05_17_1437" DELETE the |
@PikachuEXE
I'm still not getting any love. :( You mention to DELETE the Thanks |
Where does the asset precompile occur? |
I took a shot, bashed into the Heroku env and ran Leads me to believe this is happening elsewhere.... Based on Heroku documentation, found at https://devcenter.heroku.com/articles/rails-asset-pipeline#the-rails-3-asset-pipeline, the pipeline is precompiling during slug compilation so I'm guessing it somewhere else. I'm going to reach out to Heroku about this and see what they say about where the precompile is happening. Based on their response, I may try to do the precompile locally before deploying Will let you know what comes of it |
Hi @PikachuEXE I reached out to Heroku and got some feedback. They asked us to confirm that the translations were there when we ran the assets:precompile locally using the production env variable. We are running our dev env on docker so the command we ran was:
The result was the same in that none of the translations in config/locales were being included in /public/assets/application.js. I can see the I18n object and some translations (from other gems) but none of our custom translations thoughts? |
How did you fix your development environment? Worst case: create a sample app to reproduce it... |
Thanks for continuing to provide feedback Typically, we are not precompiling the assets in our development environment. We had a lot of issues with the dev env but finally got it working (outlined in the initial post above) I tried to include the Rails.configuration.assets.paths
Rails.configuration.assets.precompile
I don't see any path included to the |
I think I was able to track down what is going on. The gem currently defaults to output the translations.js and i18n.js files to I created a
|
I guess you are using export/middleware plus asset pipeline? In my project main JS I just add |
ah. maybe I missed something in the docs. We also have the require statement (also included the Will try to remove the middleware as well to see how it behaves |
It seems that none of our translation files are being included when we deploy our application to Heroku. We are running Rails 3.2.22 on Ruby 2.2.7
We were having issues getting it to work in our development environments but after a lot of struggles, we were able to get the translations working. The problem we were having in the dev env was that the translations for a new file was not available in
I18n.translations
js object even though they could be see in the generated/public/javascripts/translations.js
file. The previous translations from other files inconfig/locales
was available in theI18n.translations
object.After a lot of investigation, we discovered there was a file at
/assets/i18n/filtered.js
which also contained the translations but it was missing the new translations. This seems to be a generated file and we were able to force the regeneration by removing/public/javacripts/i18n.js
file (also generated).We then deployed to Heroku and hit issues again with missing translations. However this time when I look at the
I18n.translations
, non of our translations fromconfig/locales
folder are available, old or new. The following is the output from chrome consoleThe expected output would be:
We've tried all the work arounds listed at https://github.com/fnando/i18n-js#known-issues including issues looking through issues #367 and #213 but still can't get any translations.
If we browse
/javascripts/translations.js
in the Heroku environment, we can see all the expected translations but/assets/application.js
(precompiled) is missing the expected translationsWe've tried the following:
and we have tried to update the assets version in
application.rb
:Any ideas how to troubleshoot this?
thanks
Ben
The text was updated successfully, but these errors were encountered: