error when trying to change language ODOO - javascript

I tried to change the language from English to Portuguese and now the pages do not render. I tried to use "regenerate asset bundle" ", but it didn't work. got the following problem:
I tried to use "regenerate asset bundle"

Related

DLE CMS news raiting function didnt works

I stared do template on DLE CMS. I do that first time but it looks pretty easy. Now i have a trouble. I turned on standart rating system from DLE CMS into file fullstory.tpl (standard single news page). Design looks well, but if i try to click some stars to rate news, i get error "Uncaught ReferenceError: doRate is not defined" into my console. I understand that i dont have this function doRate on this page. But how to make it work fine? I found this function in other teplate into dle_js.js file. What this file mean and how i must to add it into my template. Thanks!

How can I: Replace all instances of an old 'base' href on archived website with a new one for quick changeover?

This problem has come up before for me. I had to manually (or using search/replace in an HTML editor) replace all instances of EXAMPLE.COM with MYTESTSERVER.COM/EXAMPLE for sake of links/images not being broken (This includes any values for HREF or SRC properties--especially these types, actually).
The site was made in 2012... it does include template files (WordPress theme I developed painstakingly over the course of 5-6 months). The template files aren't really what I'm concerned with... it's the countless references to the old domain that was used within the "post" files...
This was an "Online Literary Journal", so there's enough supporting graphics spread throughout the individual posts' code to make me want to find a script to stick in the header.php or footer.php which will change this all over for me on each browser load, without me having to alter the code much (at least for the time being while this is still an "archived" client site)...
THANKS!
NOTE: I am NOT actually using any kind of <BASE> coding... as in building links through the structure of the site's code based on a single instance of a base href. This site was one of my first WordPress projects, and furthermore one of my first "dynamic-like" sites... so I also did not utilize WordPress' php function of bloginfo()... WISH I HAD NOW LOOKING BACK!
**also now i realize that using PHP code within posts isn't the easiest thing to do... nor was it then, so the links were coded as static.
Download the site to your local machine
Use Sublime Text:
Press cmd + shift + F / ctrl + shift + F (Win)
Select the ... symbol & Choose add folder
Choose your folder and do your 'global' search and replace.
Note: Might be a good time to entertain using partials and setting up light static site generator to make this work easier going forward

How to get LanguageModel JS File?

I have been using PocketSphinx.js for speech recognition on my website. I have Downloaded language model file (.dmp). But their code uses JS file for Language model. I dont know where to get JS file. Help me out. Thanks.
As per documentation, you can convert dmp file to js and load it afterwards, see the section https://github.com/syl22-00/pocketsphinx.js/#i-embedding-the-files-into-one-large-javascript-file. Something like
$ cmake -DEMSCRIPTEN=1 -DCMAKE_TOOLCHAIN_FILE=path_to_emscripten/cmake/Modules/Platform/Emscripten.cmake -LM_BASE=/lm/dmp/folder/name -LM_FILES=model.dmp ..
Also check an alternative section https://github.com/syl22-00/pocketsphinx.js#ii-package-model-files-outside-the-main-javascript where you can do:
# python .../emscripten/tools/file_packager.py .../pocketsphinx.js/build/pocketsphinx.js --embed model.dmp --js-output=model.dmp.js
Overall, you need smaller models, big models from CMUSPHINX downloads are too large

Using requireLocalization and getLocalization in Dojo

I am trying to create a custom Dojo widget this is how my file structure looks:
customwidget
|
+--nls
| |
| +--en
| |
| +--CustomWidget.js (My localization code)
+--CustomWidget.js (My actual custom widget code)
Now in my code I am writing:
dojo.requireLocalization("customwidget", "CustomWidget", "en");
And to get this localization I write:
dojo.i18n.getLocalization('timeago', "Timeago", "en")
There are quite a few lines of code in my widget and it works with the localization in customwidget > nls > en. But the problem is in my Google Chrome's console following error shows up:
GET http://******/******/******/customwidget/nls/CustomWidget.js 404 (Not Found)
Why does Dojo need the localization code file inside "customwidget > nls" also? Despite the error in console my code runs actually without any problem.
I was going through the Globalization Guidelines, and it says that instead of writing dojo.requireLocalization("my.app", "bar", "zh-cn"); we should use dojo.requireLocalization("my.app", "bar");. Same is the case with dojo.i18n.getLocalization. Why?
For your first question, I'm not entirely certain why it still makes the request (IMO it shouldn't) but dojo is trying to get the default language bundle. It's good practice to have a default bundle at the root of the nls folder, so that something is displayed when a user with an unsupported language browses the page.
For the second question - you should be allowing dojo to choose the correct language bundle, surely if you specify it yourself you'll end up replicating a lot of code deciding which language to use and passing that around.

Rails 3: Separate javascripts for each action?

I have an app where I keep track of different "Games". In the "show"-view, I would like to show the game information plus a select, which I can use to quick-jump to a game.
The quick-jump feature would obviously be some javascript but here's my problem: After some reading, I still don't get how I can have a separate javascript file for each action of a controller. I could add the code to the application.js but I think that would blow-up that file unnecessarily. Any link to a good basic guide for the interaction between Rails 3 and Javascript would also help very much. Thanks!
The answer to the following question spells this out a bit more specifically and with a helper method to make it a bit more elegant. Same idea though:
Rails 3.1 asset pipeline: how to load controller-specific scripts?
Just introduce separate javascript files per controller+action basis (e.g. CONTROLLERNAME_ACTIONNAME.js, replacing CONTROLLERNAME and ACTIONNAME with your actual names ;) ) and include them in your views with javascript_include_tag(CONTROLLERNAME_ACTIONNAME.js).

Categories

Resources