internationalization

iOS Get localized version of a string for a specific language

冷暖自知 提交于 2019-12-04 18:10:44
问题 I'm building an application for iOS that will be available in both English and French languages. I've read some tutorials around internationalization and I have an understanding of how it works and what I need to do. The problem I'm having is there is a specific case where I want to load French strings for an English user. I understand it's possible to set the language for the entire application, but that it requires the application to be restarted before it will take affect. I'd like to

Django internationalization: prefix_default_language & language redirect

℡╲_俬逩灬. 提交于 2019-12-04 18:10:35
I'm adding internationalization to my Django project. The idea of how it should work is the following: When a user enters "/" i.e. the "homepage" we try to get his/her language preferences from our session. If it's not our default language (EN), we redirect the user to the local version, like /ES/, /RU/, /CN/, etc If we have no such session data, we check Accept-Language and redirect the user to the local version if we support such If we don't support user's Accept-Language OR if it's EN - we don't redirect user! we just show the "default language" I.e. all "not default languages" should have

I18n in Spring boot + Thymeleaf

瘦欲@ 提交于 2019-12-04 17:40:26
问题 I'm trying to make a multilanguage application using Spring boot and Thymeleaf. I made few properties files to save the different messages but I'm only able to display it in my browser language (I tried extensions to change browser locale but they seem to not be working), anyway I wanted to put a button in my website to do this duty (changing the language), but I don't know how or where to find how to manage this. Gonna show you my config: Structure of the project I18n configuration class

Rails i18n and routes in javascript

拥有回忆 提交于 2019-12-04 17:33:49
问题 Sometimes it would be really handy to have the Rails localization files available in JavaScript. Same is true for for the routes helpers. I found these two plugins which are exactly doing this: Exposing i18n to JavaScript: http://github.com/fnando/i18n-js Rails Routes in JavaScript: http://tore.darell.no/pages/javascript_routes My questions: Are there any other plugins / gems doing similar things like the two above? What's the right approach in Rails? Meta tag? Additional data- attributes?

AddExtensionObject - Performance

大兔子大兔子 提交于 2019-12-04 17:33:05
.NET XSLT engine allows passing objects to the XSLT processing engine through the AddExtensionObject method. Can someone comment on the performance of using this to retrieve localized strings to be used in the XSLT? Extension objects can be used to improve performance if a part of an XSLT transformation is deemed inefficient. While the use of methods of an extension method would not decrease performance (excluding buggy and inefficient code), they will not improve performance significantly, if proper XSLT techniques are being used for accessing localized strings . In case extension objects are

Internationalizing whole text with markup in Rails 3

淺唱寂寞╮ 提交于 2019-12-04 17:22:57
What's the best practice for internationalizing, say, a Terms of Service document in Rails 3? I can think of two options: Creating a partial for each locale and choosing which one to load according to the current user's locale. <li><%= I18n.t :tos_paragraph_1 %></li><li><%= I18n.t :tos_paragraph_2 %></li> None of these seems like a good solution. Any ideas? Creating a partial for each language is definitly undry. The Rails way is the second option you suggest with a .yml for each language. The doc provides great examples to let you organize the yml according to each page. Thus you have

Configuring string externalization in Eclipse to use ${key} as field name

别来无恙 提交于 2019-12-04 17:08:31
Suppose I have a simple code like this: public class ExternalizeStringDemo { public static void main(String[] args) { System.out.println("Hello world"); } } Now, I want to externalize the greeting, perhaps to facilitate internationalization/localization/etc. Using Eclipse, I can use the String Externalization wizard (Source/Externalize Strings), and configure it like this: I can proceed with the wizard and it will propose these changes: Create file Personal Toys/src/Messages.java Create file Personal Toys/src/messages.properties Edit ExternalizeStringDemo.java "Hello World" becomes Messages

After the screen rotation, the language of my application will be changed

心已入冬 提交于 2019-12-04 17:00:21
问题 I have created a bilingual (having two languages) android application. I have inserted my resource strings in two files: For Persian language (default) values/strings_locale.xml‬ For English language values-en/strings_locale.xml‬ I my first launching Activity I have inserted the following code: Configuration c = new Configuration(this.getResources().getConfiguration()); c.locale = new Locale("fa_IR"); this.getResources().updateConfiguration(c, this.getResources().getDisplayMetrics()); So

Facebook Open Graph locale for Australia

南楼画角 提交于 2019-12-04 16:45:27
问题 I am trying to add the og:locale tag for an Australian website and Facebook's linter tells me that I have an error. Based on the documentation (and assuming what the correct content should be), I have added this to my page head: <meta property="og:locale" content="en_AU" /> Facebook's linter ( http://developers.facebook.com/tools/debug ) tells me: Object Invalid Value Object at URL 'http://foo' of type 'website' is invalid because the given value 'en_au' for property 'og:locale:locale' could

Changing language by clicking a button

血红的双手。 提交于 2019-12-04 16:41:31
I have a JSF/RichFaces setup, and I found this tutorial . I followed it step by step, but I can't manage to get it. Also: language.jsp is mentioned in the tutorial, can anybody tell me what exaclty it is? Or if you think this is not an appropiate tutorial and have a better one, please, let me know. All the steps in the tutorial are not really needed. What I did (And it works) is: 1. In loging.xhtm , for instance: <f:view locale="#{languageDetails.locale}" > <head> ..... <f:loadBundle basename="messages.Messages" var="msg1"/> ..... <f:view> <h:form> <h:panelGrid columns="2"> <h:outputText value