internationalization

JSF 2.0 set locale throughout session from browser and programmatically [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-27 12:21:54
问题 This question already has answers here : Localization in JSF, how to remember selected locale per session instead of per request/view (5 answers) Closed 4 years ago . How do I detect the locale for an application based on the initial browser request and use it throughout the browsing session untill the user specifically changes the locale and how do you force this new locale through the remaining session? 回答1: Create a session scoped managed bean like follows: @ManagedBean @SessionScoped

how to pull out php code that contain certain words in ruby

蓝咒 提交于 2019-12-27 03:44:27
问题 Say if i have lots of php file (.php) and I'm only want to pull out block of code that contain certain words e.g. $this->te Any idea how I do it? using ruby would be better? if ($attachments && count($attachments) > 0) { echo "\n\n{$this->te('Attachments')}:\n"; ... 回答1: You can just use grep for it: grep '$this->te' -R *.php -n If you want to do similar thing with Ruby, you can use something like: Dir.glob('*.php').each do |x| File.read(x).split("\n").each_with_index do |line, n| puts "Found

how to pull out php code that contain certain words in ruby

旧城冷巷雨未停 提交于 2019-12-27 03:44:12
问题 Say if i have lots of php file (.php) and I'm only want to pull out block of code that contain certain words e.g. $this->te Any idea how I do it? using ruby would be better? if ($attachments && count($attachments) > 0) { echo "\n\n{$this->te('Attachments')}:\n"; ... 回答1: You can just use grep for it: grep '$this->te' -R *.php -n If you want to do similar thing with Ruby, you can use something like: Dir.glob('*.php').each do |x| File.read(x).split("\n").each_with_index do |line, n| puts "Found

Language selector in Play 2.4 & Scala 2.11.6

此生再无相见时 提交于 2019-12-25 16:36:33
问题 I'm trying to implement this simple page with a language selector and a localized message: |...en...|▼| A message in english Ideally when the user changes the language the page should reload with an updated message and a different selected language |....fr....|▼| Un message en français but I can't get this to work: the page stays the same and the only thing that changes is the PLAY_LANG cookie. controller package controllers import javax.inject.Inject import play.api.mvc._ import play.api

I18N charset Encoding Spring-JSP

北战南征 提交于 2019-12-25 16:02:12
问题 I'm trying to show é as a title of my form:input field, and I can't get it working. Example 1 : <form:input type="text" path="something" title="é"/> Output : Example 2 : <input type="text" title="<spring:message code="mySpecialChar" />"/> Output : Example 3 : <form:input type="text" path="something" title="<spring:message code="mySpecialChar" />"/> Output : Error , I'm not allowed to do that, to solve this, I've tried Example 4. Example 4 : <spring:message code=mySpecialChar" var=

I18N charset Encoding Spring-JSP

人走茶凉 提交于 2019-12-25 16:02:08
问题 I'm trying to show é as a title of my form:input field, and I can't get it working. Example 1 : <form:input type="text" path="something" title="é"/> Output : Example 2 : <input type="text" title="<spring:message code="mySpecialChar" />"/> Output : Example 3 : <form:input type="text" path="something" title="<spring:message code="mySpecialChar" />"/> Output : Error , I'm not allowed to do that, to solve this, I've tried Example 4. Example 4 : <spring:message code=mySpecialChar" var=

How to internationalize REST Spring-MVC application?

佐手、 提交于 2019-12-25 12:44:08
问题 I am new with spring and I still don't know well about hierarchy and terminology of spring . I am implementing a RESTful app with spring. After searching and reading about how to internationalize spring, I tried to do it in my app. But it seems to me it is not configured properly. Because I get exception. I would like to show you the screenshot of my project structure. And I would like to ask you why my applicationContext.xml show a problem exist. spring-servlet.xml <!-- SPRING

ASP.NET MVC Retrieve localized resources programmatically

我们两清 提交于 2019-12-25 12:43:12
问题 I have a HTTP Handler that reads all resources files in the ASP.NET MVC assembly and converts them to a Javascript object. The code works well apart from 1 rather big detail as I need to be able to predefine the culture. I cannot use the useful web config's auto UI cultures, instead I want to use database configuration. As soon as this code runs, it still takes the local culture of my computer. Is there any way to set the culture? I was thinking of using the ResourceManager but I'm failing to

Struts-Dojo Internationalization (how to Override Browser's Language)

拟墨画扇 提交于 2019-12-25 12:27:09
问题 I asked previously on how to implement Internationalization in struts-dojo (Struts Dojo Internationalization of values). The answer solved my problem but I have another problem. I want to override the browser's language to my user's language. For exmaple, If my browser's language is Japanese but my user's language is English , the page should be displayed in English . I tried overriding the browser's language by setting request_locale=en_US as parameter but the page language did not change.

CakePHP save failing with validation errors set but empty

空扰寡人 提交于 2019-12-25 11:51:08
问题 A model that I am using with both TranslateBehavior and TreeBehavior is failing to save. I suspect it is something to do with one of these behaviors. Here's the data going in: array( 'Category' => array( 'id' => '3252', 'parent_id' => null, 'sort_order' => '0', 'name' => array( 'eng' => 'english name', 'fra' => 'french name', 'deu' => 'german name', 'ita' => 'italian name', 'spa' => 'spanish name' ), ) ) And $this->Category->validationErrors is: array( 'parent_id' => array(), 'sort_order' =>