ui-grid i18nService messy code with non-english characters - angularjs

I am using angular ui-grid's i18nService. And it displays some messy code like
"è¡Œæ¯é¡µ" when I set current language to some language with non english character such as Chinese, Korean and something else.
But for the headers and cells which I use angular translate, everything display very well. I guess it maybe some setting problem, but I just have no clue.
Any advice would be appreciated. Thank you!

if you want to set current language to Chinese.
code:
// set pagenation current language
i18nService.setCurrentLang('zh-cn');
you can also visit this page:
http://ui-grid.info/docs/#/tutorial/104_i18n

I got the anwser. It's the encoding problem of the browser. The encoding should be set to Unicode(UTF-8), if it not working, clear cache first and try again.

Related

reactjs i18n change translation on demand

I use i18n (react-i18next) in my react js application. Translation with language chooser etc works absolutly fine.
But now I want to change some texts programmatically on demand.
I tried this:
i18n.t('clinical:sde.export.studyTitle', {lng: "en"})
and
i18n.t('clinical:sde.export.studyTitle', {"en"})
It always returns the german string from current setting and not the "on demand" english text. Is there a solution to solve this?
Thanks in advance.
Your code should work, you need to check that the dynamic language is loaded (this what i18n.changeLanguage does).
I've made a simple test, and it works.
https://codesandbox.io/s/react-i18next-example-forked-ueng1?file=/src/app.js

Can we use gauge/gage in Ionic ? (Cordova)

This is my first post here, so I'm sorry if I'm not in the good section.
My "simple" question is, can we add a gage/gauge (I don't now the exact english spelling), in a Ionic project ?
A thing like that:
https://www.youtube.com/watch?v=w2qrYL0Le24
Or an other exemple:
http://crisbeto.github.io/angular-svg-round-progressbar/
I already tried to insert gauge like that in my project but the gauge never appears, so please, can you help me ?
(The goal is to show to an user a speed for exemple or the batterie life of his smartphone, any importance, juste a jauge who can be incremented or decremented)
Can you explain me please how it works, for example via a Codepen or anything else. I had already tried to search response but I solve anything on that.
I'm french and I am sorry for my language, but thanks in advance for you'r help !
Thanks.
I was able to get this to work:
https://github.com/frapontillo/angular-gage
You must also have the JustGage library and Raphael. Take a look at the example to see it in action. I was able to even make it work in the http://creator.ionic.io app by adding the scripts of angular-gage, JustGage and Raphael (just add a js and paste in the scripts).

How to customize pull to refresh in codename one?

I would like to change the language of the pull to refresh. I've already added a locale file and added two properties which I read in a post:
pull.down <---- Working OK
pull.release <---- Still showing English (should be in Spanish)
I don't know the property which shows "Updating" but I also need it to know.
Please could you help me to know where I can see the properties?
In the initVars method I used:
Hashtable h = res.getL10N("Localization (L10N) 1", "es");
UIManager.getInstance().setBundle(h);
Thank you in advance for your help.
To change the Updating text, do this:
pull.refresh=YourUpdatingText
Note that you have to enter the english and spanish version of the texts.
Change your localization code to the following:
Hashtable h = res.getL10N("1", "es");
UIManager.getInstance().setBundle(h);
Follow #Shai Almog's tutorial in this video for localization.

Language in Angular datepicker directive for bootstrap

I am using the Angular directive for Bootstrap datepicker: http://angular-ui.github.io/bootstrap/#/datepicker
I can not find any documentation saying i can set a default language on it. The date format is easy enough to change, but i can't set the language to norwegian so that the months, or days are displayed in norwegian instead of english. Does anyone know if this is even possible?
Thanks in advance.
-L
Hm, I'm not sure if it helps. But somewhere is pointed out, that you can use the standard localization of angular.
Please refer to this documentation.
Thanks to Edminsson. I looked at that link earlier, but for some reason i didn't find it relevant to me. (Must have been before i had my morning coffee)
Here's the solution: AngularJS/Angular-ui-bootstrap Changing language used by the datePicker

Cakephp with Translate Behavior

I have setted the translate behavior and it work fine, but I need something more.
If I haven't translated the fields, I need that the find() return me fields in default languge (this case eng).
How I could do it?
By default, if cake cannot find the language translations for the given language, it will default to what is set in the application. So this should already be working. Confirm that you have all of the english translations filled out. If this is still not working, you will need to provide some code and examples of what is not working.

Resources