Jinja2 does not recognize translation - localization

I am building a site with Pelican and following this guide on localizing templates.
However, pelican output tells me: "ERROR: Cannot find translations for language 'en' in 'translations/' with domain 'flobin'. Installing NullTranslations." when I run the pelican command (more here.)
This is my directory structure on the left, which I think is the correct structure.
I have installed Babel.
What’s going wrong?

Turns out the conflict was with the following line in my pelicanconf.py:
I18N_GETTEXT_LOCALEDIR = 'translations/'
Removing it completely fixed the issue.

Related

Ruby on Rails - Having issue when generating a page

when I try to run the server after creating a home/index page i get the following error. I wonder if you can help me.
Error: Cannot find module './templates.js'
Require stack:
C:\railsfriends\friends\node_modules\chalk\index.js
You have an error from the chalk javascript library, which can't find its expected template.js file. Try removing chalk from your package.json or wherever it's being loaded, so you can get the basic app working and then add it later, and debug the module then.
A 'nuclear' option (which is pretty safe on a new project, especially if you haven't touched the Javascript components yet) is to delete your node_modules directory from the project and then to run yarn install from a terminal in the project directory - this will read the required JS packages and install them again for you.
Not hugely helpful about the specific issue, I know, but the error message you posted tells you what the problem is, and it doesn't seem to be Rails itself. You may have more luck adding a tag for js and chalk specifically, to attract readers with that specific knowledge.

Add ng-Table ao Meanjs

I'm trying to add a third module for use.
The module is the ng-table.
When I add the module in applicationModuleVendorDependencies returned one dependency injection error.
Am I not doing the right thing?
Someone has already implemented the ngTable using the yeoman generator MEANJS?
Seeing the code would have been the best thing so that I can get to know what you exactly doing wrong or forgot to do, but I think either one or more of the following could be the cause
you forgot to include it in your lib files in the config > env > development.js
the library is not install yet
or just a small typo somewhere
but I strongly suspect it would be the first point, as I have used it before, and worked just fine with meanJS

Psych Error: `parse': (<unknown>): could not find expected

`':' while scanning a simple key at line 16 column 1(Psych::SyntaxError)
I'm working on a Rails application tutorial and have had the above error come up several times. When I was getting this error it seemed to only be a problem if I used one particular terminal window. I have since restarted the computer and now it is a problem regardless of what I do.
I went to the project on github and copied the information in 'secrets.yml' into my file in case that was the issue but doesn't help. In fact I'm not sure if that is even the file causing the problem because when I shift the code in that file and save it I still get the same error; at those times it points to a line that is now blank in the 'secrets.yml'
Update.
now I am getting this when i run this command
rails generate simple_form:install --foundation
-bash: $: command not found.
only change I did was start the code in 'secrets.yml' lower down, and i added a secret key to my .bash_profile, as it was suggested in tutorial and I had not done it before, and thought that might be the problem.
Update 2
shut down terminal and tied again and getting the original problem "psyche Error" Yes, thank you for your feedback, I too, although not sure why, suspect it is to do with the 'secret' file or could it be changes the tutorial told me to make to my .bash_profile. The instructions were not very clear, wondering if that is where I messed up. If that is so then I would not know how to fix that.
The Psych gem is the wrapper around libyaml and used within Ruby's YAML class, so it's not surprising you think it could be the 'secrets.yml'; a YAML config file. I'd stay the course and find what isn't being formatted correctly.

rails console yaml parse error - applying solutions

BACKGROUND Complete newbie to coding working thro’ RailsTutorial on a windows 7 PC– I’ve stalled on chap 4.2 with an YAML error running “rails console” from a command prompt with Ruby on Rails.
I need tips on how to interpret and use some specific answers (below) that I found posted on stackoverflow/google groups/github.
I’ve tried to meet forum criteria for questions. If any of my confusions are too basic here please let me know which & where else I might try.
The error -
~\Sites\sample_app rails console
C:/a_installers/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:154:in 'parse
: (<unknown>): couldn't parse YAML at line 44 column 11 (Psych::SyntaxError)
from C:/a_installers/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/psych.rb:
54:in 'parse_stream'
(40 more lines like this)
Not sure what useful context I can supply.. possibly that I used Railsinstaller and later Pik (instead of RVM) on Windows 7, that I installed ralis/ruby programs under c:\a_installers\railsInstaller and that I’ve updated PATH to include ruby bin folders.
QUESTION The advice I'm having difficulty interpreting/using is..
rails error, couldn't parse YAML suggests
a. Run the YAML code through yamlint.com
Which YAML file? All those in the error listing? I think I’m running rails console from my installed rails program area (above), there I found 60 odd files with “ *.yml “ – do I have to run all these through YAMLlint.com?
b. Manually Fix the YAML code
One example given was " fixing invalid yaml " involving splitting yaml code for a local date into lines.This was not applicable – I couldn’t find any such code in any of the 60 odd “ *.yml “ files under railsinstaller on my system
c. “load the old YAML parser (syck) with code xxx in config/boot.rb”
Two problems…
(1) I couldn’t find boot.rb in my the rails/ruby program area
(2) I’m torn between two contrary views expressed
“Psych is the new one, the one you should be using you have some invalid yaml somewhere.”
And
“wrong… ruby should use a parser that is both maintained and supports existing usage, even if that usage is further from the spec. If only there were such a thing. Until there is, they should use syck..”
In summary, not sure which files to amend, how to do that, how to check that. if it’s advisable instead to do a workaround (reverting to syck) and if so in which directory and with which files.
another source rails-yaml-config-best-practice advised
“configure parameter inside environment.rb.” use a github code called “settings logic”
Not sure how to do this..do I need to learn YAML? Tutorial hasn’t even started Ruby yet – is this
Not sure where to do this – couldn’t find environment.rb in my rails/ruby program area – it seems to be part of my application (sample_app)
In ..Settings_logic …the notes seem to bring me full circle to 1. above.
“..Note: Certain Ruby/Bundler versions include a version of the Psych YAML parser which incorrectly handles merges (the << in the example above.) If your default settings seem to be overwriting your environment-specific settings, including the following lines in your config/boot.rb file may solve the problem:
require 'yaml'
YAML::ENGINE.yamler= 'syck'
To apply this solution I still need to resolve question 1 c (2)
3 General advice - My inability to start rails console seems an absolute barrier for me to use ROR- a couple of general questions - Do practitioners use rails console for actual development or just learning? Can I learn RoR without rails console?
Many thanks for your patience, time and attention.

Rubys on Rails project Using Aptana

I am having a major issue with creating a Rails Project on Aptana (using mac os x). Basically, when i try starting a Rails project and name a file, it comes back with an error saying:
"!!! Path to log file not valid: /Users/fab/Documents/Aptana Studio Workspace/test.rb/log/mongrel.log mongrel::start reported an error. Use mongrel_rails mongrel::start -h to get help."
and then a pop up comes up saying: "Rename the directory to no longer have a space"
After all this, i tried renaming the directory without spaces, but then when i went back to create a new project again it came back with this pop up that says "resource'/fab/public'does not exist." Under this there is a list of two options: "periodic workshop save" and "replace project index file."
What does this mean, and how can i fix the problem?
Any advise would be much appreciated!
Omarj
Mongrel used to have a bug with writing log files, and for whatever reason it's trying to create a path relative to a file (rather than a folder) in your case. i think they also had issues with spaces in the path.
Do NOT rename your workspace path, or Studio/RadRails won't see the files anymore (as you saw above) - because you moved them.
I suggest renaming the folder back. This question is pretty stale, so mongrel is no longer widely used. you could try one of the other server types, like webrick.
Hey, I don't have an answer to your question. However, would advise you that if you are starting to get your hands dirty with Ruby and Rails, then consider TextMate as your IDE instead of RadRails.

Resources