fallback method not working in i18n-js with rails 2.3 - javascript

I am integrating I18n-js in a Rails application. The integration is working fine along with the translations.But the problem I am facing is that when the required translation is not present in a particular language , say for example I selected Afrikaans as my language then in that case the fallback method should execute showing me the translation present in the default language.But its not happening and I get the error
[missing "af.credential_requests.add" translation]
This surely means that the fallbacks method is not working.
Though I have
I18n.fallbacks = true;
in my I18n-js. Please help.
I have my default locale set to "en"

Make sure that you set I18n.defaultLocale correctly

Related

vue-i18n dynamic locale with promise doesn't update

I am testing vue-i18n in order to implement it for my future projects. I have a separate system to handle the translations, so I got remote json files. vue-i18n have a system to fetch the locale using a promise, explainations here.
I cannot use the fetch method because my files are outside so I got cross-origin troubles. Instead I do it with vue-resource, but I don't know why, when I set a new set of locale, it doesn't update automatically. bescause the default lang is en, when I load my en locale file, it does nothing. I have to change two times the config.lang to force update.
Several things:
A jsfiddle to test > http://jsfiddle.net/t4kdoqj7/3/ uncomment line 19 to reproduce the fix
Maybe it's just due to a bad using of vue-resource
I couldn't create a vue-i18n tag...
Thank you for your help !
Ok, I just found a hack :
Set Vue.config.lang = '' before loading anything
Here the fiddle (l9) > http://jsfiddle.net/t4kdoqj7/4/

How to enable debugging mode in SAPUI5 library 1.40.7

I was using 1.26.10. So I was executing
jQuery.sap.debug(true)
But When I do the same for library 1.40.7. It is not loading any dbg files
Hit CtrlAltShiftS to open UI5 Diagnostics. There you can expand the panel "Technical Information" and switch on the Option "Debug Sources".
See the official docu for this:
https://help.sap.com/saphelp_uiaddon20/helpdata/en/c9/b0f8cca852443f9b8d3bf8ba5626ab/content.htm
just add in the URL sap-ui-debug=true as query string ?....&...
CtrlAltShiftS and use Technical Information → Debug Sources is basically correct but there is one restriction which might prevents this.
The UI5 application needs to be initialized with productive: false
Check in your index.html if the productive parameter of sap-ui-config is set to true and change it temporarily to false:
<script>
window["sap-ui-config"] = { "productive": false };
</script>
As others pointed out, adding the query parameter sap-ui-debug=true in the URL would enable debug mode.
Adding ui5 namespace of your UI5 application in the query in place of the boolean true would only load files for that namespace to debug making page load faster. example: for namespace foo.bar, the query param should be sap-ui-debug=foo/bar

vim YouCompleteMe not working on MacVim

I am a huge fan of vim and I've been using it for the last two years. I'm quite new to web programming. Currently I'm working on Node.js and I wanted some additional plugins which can help me learn this new technology. I installed tern_for_js and YouCompleteMe using Vundle. I also compiled YCM, but I don't see any auto-completion or javascript support. Here is my .vimrc:
syntax on
set number
set laststatus=2
set nocompatible
set expandtab
set shiftwidth=2
set smartindent
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'bling/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'ternjs/tern_for_vim'
Plugin 'Valloric/YouCompleteMe'
call vundle#end()
:map <F2> :echo 'Current time is ' . strftime('%c')<CR>
set guifont=ProggyCleanTT:h18
colorscheme torte
NERDTree
Can anybody tell me what I'm doing wrong. Or did I miss something? Is there some extra configuration that have to be made?
The following lines are crucial for vundle to work correctly
filetype off " required
put it before
set rtp+=~/.vim/bundle/Vundle.vim
Turn it back on after vundle end
call vundle#end()
filetype plugin indent on
Also you don't need :map , map is fine.

flowplayer html validation

Ok, Im trying to rebuild a clients website thats long over due for cleanup on the backend and under the hood. This client uses flowplayer for most of the videos seen on any of there sites, and while attempting to validate my code via w3c validator I notice that the validator is throwing 2 errors both pertaining to flowplayer in this case.
http://validator.w3.org/check?uri=http%3A%2F%2Fv2.newyorkbarshow.com%2Fhome&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3
I am using the latest flowplayer out, and following there example (which I don't know if that validates either). So I am wondering if it doesn't validate out of the box, if anyone happens to know a means of correcting it so it will validate.
You need to add data attribute with value "/static/imgs/static/VidAd4BarShow.swf" in your object tag.
note : I see this happens before flow player executes anything within your source...

How to force update of design changes to clients using xPages?

I am bulding a webpage using xPages and I am making constant changes to script and design, this include both server and client javascript , stylesheet and image changes.
Each time I change a javascript or stylesheet I want to see my changes in the webbrowser and I also want my users to get the latest changes when they access the webpage.
I know I can use Shift-Reload, or CTRL-reload and clear my webbrowser cache. and I also know that I can change the objects expiration date, but I want a smoother and better controlled way to do this.
Looking for any kind of best practice for doing this.
Thanks
Thomas
In the xsp.properties file for the application or on the server for server wide use you can set xsp.application.forcefullrefresh=true. The xsp.properties file documentation says:
# Application refresh
# When this property is set to true, then a full application refresh is requested when
# the design of a class changes (means that all the data are discarded in scopes).
# xsp.application.forcefullrefresh=false
The new XSP Portable Command Guide says "This property was introduced in Notes/Domino 8.5.3. It is set to false by default and is particularly useful during the development phase of an XPages application."
I have not fully tested this behavior but it sounds promising. You could/should of course only set it to true WHILE you make the changes. once stable, set it back.
/Newbs
Adding to Ferry's answer and your comment;
Instead of "?dummy=randomvalue", you can use "?version=2.1". So it will be cached but when you change design, you can just increase the version.
There's a problem with this approach as some proxy servers won't cache anything with query params. Better to rename the file directly, adding date or version number to it. It will always work.
To disable caching temporarily use Fiddler2. It's easy to enable and disable in one place across any web client. As well as added benefits for the http request tracking features.
To fully disable any caching add url + '"?dummy=" + #Unique();' to every url to javascript or image files...
The way I am reading this question is that you want every change you make to appear immediately on the client's browser or client. Are you really sure you want to do this? It sounds like you are not doing any testing so any typos, bugs, crashes, etc will be passed on to your users. Sounds like a bad plan to me. I hope I am wrong and that you are using a template and pushing only your fully tested changes up to an production version instead of making the changes in the production version.
I would just put out a schedule of when changes are going to be pushed up to production and let the users reload their browser or client at that time. Either that or do it during off hours and when they next log on, they get the newest changes.
Adding to Ferry's answer and your comment;
Instead of "?dummy=randomvalue", you can use "?version=2.1". So it will be cached but when you change design, you can just increase the version.
maybe you could look at how domino can control caching of url's.
http://www.ibm.com/developerworks/lotus/library/ls-resp_head_rules/
NEwbs answer is a good one but it is useful to note that in Firefox there is a very useful plug in called "web developer" from Chris Pederick that allows you to disable the cache.
http://chrispederick.com/work/web-developer/
The other really useful one is Firebug which is just amazing - It makes any HTML work much easier
https://addons.mozilla.org/en-US/firefox/addon/firebug/
I did found another solution by putting my css and js in a theme it is easy to just rename the files.
as described here
http://goo.gl/vFTii
Why do not we use the window.location.reload()...
Which does the same like ctrl+F5
It reloads the page, which is similar to context.reloadpage

Categories