locale

Primefaces override doesn't work after non ajax refresh

巧了我就是萌 提交于 2019-12-11 00:38:51
问题 I'm faced with an annoying primefaces-bug. I have 2 commandLinks for changing languages: <p:commandLink action="#{language.setLanguage('de')}" ajax="false"> <h:graphicImage value="/resources/images/flags/germany.png" style="vertical-align: middle;width:40px;height:34px" /> </p:commandLink> if I change the locale now, the page is reloaded but it seems like the primefaces overrides are gone. At least the texts are bigger... Is this a familliar issue? regards 回答1: I would have just commented,

Set locale encoding in python

倾然丶 夕夏残阳落幕 提交于 2019-12-10 23:56:29
问题 I'm calling a java program from my python code in the following way: subprocess.check_output(["java", "-classpath", "/Users/feralvam/Programas/semanticvectors-3.4/semanticvectors-3.4.jar:/Users/feralvam/Programas/lucene-3.5.0/lucene-core-3.5.0.jar:/Users/feralvam/Programas/lucene-3.5.0/contrib/demo/lucene-demo-3.5.0.jar:", "pitt.search.semanticvectors.CompareTerms", "-queryvectorfile","/Users/feralvam/termvectors.bin",term1,term2]) "term1" and "term2" are strings read from a text file that is

Does the formatting of a date depend on both the user's locale and calendar system?

為{幸葍}努か 提交于 2019-12-10 23:36:19
问题 I feel this question is very general for all programmers on all languages. This is somewhat blurry. First, there are locales, which encapsulate cultural information and other stuff. I believe these locale objects also encapsulate information about date and time formatting, i.e. how to display a date, in Unicode Standard. Like so, for example: "yyyy-MM-dd'T'HH:mm:ssZ". Every country may have it's own date+time formatting rules, so we are all happy about locales, and users of our apps get date

Changing application locale makes changes to all users (Vaadin)

六眼飞鱼酱① 提交于 2019-12-10 23:06:19
问题 In my application I set up the locale when the user get into the system to localize the components. Recently I was giving a demo and noticed that the language was switching from English to Dutch without apparent reason. It turned out that the demo server (hosted in a German server) was being accessed at the same time by another person that set it to Dutch and was affecting my English demo and viceversa. I gave it a try on my machine with different browsers, using Chrome normal and incognito

Custom locale in Android

主宰稳场 提交于 2019-12-10 22:55:06
问题 the Android phones in Slovakia have a custom locale - en_SK and cs_SK. Language is either Czech or English, location is Slovakia. Now I would like to have strings that target these locales. The default approach is to create a folder "values-CountryCode", for Czech Republic it's values-cs. But I get a build error if I add a folder name values-en_SK or values-cs_SK: "invalid resource directory name" What to do? 回答1: I am answering my own question :-). It's values-en-rSK , -r is Region. 回答2: For

Node.js, Socket.io: How to get client browser-language?

余生长醉 提交于 2019-12-10 22:39:48
问题 I am trying to get the language the user uses in order to serve the right sound files for a playing video, using socket.io and node.js. I am a total beginner with node.js and socket.io. I got the language on client side with "navigator.language" and wanted to send it when connecting/handshaking to socket.io. var language = navigator.language; var socket = io.connect('http://localhost:1337', { query: language }); And on server-side: io.set('authorization', function(handshakeData, cb) { console

Laravel 5.4 proper way to store Locale setLocale()

一个人想着一个人 提交于 2019-12-10 21:19:59
问题 I need to know. What is the proper way to store Locale for user. If for each users' request I change the language by App::setLocale($newLocale); Would not it change language for my whole project and for other requests as well? I mean when one user changes language it will be used as default for other users. Thanks in advance 回答1: If you set App::setLocale() in for example in your AppServiceProvider.php , it would change for all the users. You could create a middleware for this. Something like

FacesContext#getViewRoot() returns null while setting <f:view locale> for first time

白昼怎懂夜的黑 提交于 2019-12-10 19:33:57
问题 I am trying to change my JSF application locale in one page and that has to change all my pages locale. I have followed this link, and it works well Localization in JSF, how to remember selected locale per session instead of per request/view If I run the application I can change the locale in my index.xhtml and that locale is set per session, so if then I go to page index_1.xhtml I will see the locale changed. My problem is that when I run the application and I write the URL: http://localhost

How to set LANG variable in Windows?

自闭症网瘾萝莉.ら 提交于 2019-12-10 19:15:52
问题 I'm making an application that supports multi language. And I am using gettext and locale to solve this issue. How to set LANG variable in Windows? In Linux and Unix-like systems it's just as simple as $ LANG=en_US python appname.py And it will automatically set the locale to that particular language. But in Windows, the C:\>SET LANG=en_US python appname.py or C:\>SET LANG=en_US C:\>python appname.py doesn't work. 回答1: Windows locale support doesn't rely on LANG variable (or, indeed, any

_configthreadlocale and localeconv

穿精又带淫゛_ 提交于 2019-12-10 19:09:59
问题 As we all know, global data, like the locale settings affecting the numeric decimal point printf() and strtod() are using, is evil. Fortunately, MSVC++ 9 allows to use per-thread locales by a _configthreadlocale(_ENABLE_PER_THREAD_LOCALE) call. Unfortunately, it seems that the localeconv() function does not notice this and still returns the global locale settings, e.g. localeconv()->decimal_point seems to always return the global locale setting before the _configthreadlocale() call. Is this a