internationalization

Add another custom interpolator in Angularjs

不打扰是莪最后的温柔 提交于 2019-12-12 01:06:53
问题 I still want {{1+2}} to be evaluated as normal. But in addition to the normal interpolator, I want to create a custom one that I can program to do whatever I want. e.g. <p>[[welcome_message]]</p> should be a shortcut for <p>{{'welcome_message' | translate}}</p> , or <p translate="welcome_message"></p> . That way, i18n apps would be much more convenient to write. Is anything like that possible? I'm currently going through the angular.js source code, but the interpolation system looks pretty

How should I localise pluggable components

懵懂的女人 提交于 2019-12-12 01:05:36
问题 We have an application which will dynamically load some components from separate dlls. These components have a fixed name but we want localised names to be displayed to the user and so the names need to be localised. The fact that the name needs to be localised is not a concern of the component itself, so we don't really want to pollute the model of the component with a property like DisplayName or LocalisedName, and have the resources for the component live in the dll for the component. But

How to make a project internationalized in Struts 2?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 00:45:34
问题 I want to make my project internationalized. I am giving support for the Spanish and Italian languages, but some of the characters from both of the languages (acute accent and grave accent characters) are not appearing properly on the UI. Does anybody have the solution for this problem? 回答1: Yes. You have an encoding problem. Your server gives the pages in a different encoding, as your browser thinks, and this is because international characters appear faulty. You need to fix the settings of

Using I18n messages while validating forms with JSR-303

一笑奈何 提交于 2019-12-11 23:25:50
问题 My app is fully-configured spring-boot app with thymeleaf templates engine. I18n configured as well so I can use it within my templates. Here is the config I use: spring.messages.basename=i18n/messages While manual validating fields I18n also work fine: BindingResult result; result.rejectValue("field", "some.i18n.code"); But once I want to implement some custom ConstraintValidator objects and use message field - no I18n involved, I receive plain codes as a response instead of a message. I.e.

Unable to use I18n.t call in an initializer file

强颜欢笑 提交于 2019-12-11 23:19:17
问题 I would like to use I18n.t call in an initializer file. Unfortunately, it doesn't work. Rails returns the usual "translation missing:" message. It seems that the I18n files haven't been loaded yet when the call is made. Are there any workarounds ? Thanks 回答1: I had the problem when I was using Rails 2.3.2. Since then, I've migrated to 2.3.5 and I18n.t calls work fine in my initializers. 来源: https://stackoverflow.com/questions/3514536/unable-to-use-i18n-t-call-in-an-initializer-file

How to convert hardcoded enum to different language?

匆匆过客 提交于 2019-12-11 20:19:31
问题 I have an enum that is autogenerated of a webservice I use, thus I cannot modify this enum class as further update would override it. I would like to provide translation for the enum: //I cannot modify this class public enum Time { PAST("Past"), PRESENT("Present"), FUTURE("Future"); private final String value; } //my code Time time = getTimeFromWebservice(); String translation; switch(time.value()) { case: "Past": translation = "Vergangenheit"; break; case: "Present": translation = "Gegenwart

Is it possible to get an ISO 4217 currency code from Angular or JavaScript?

无人久伴 提交于 2019-12-11 18:47:54
问题 is there any way to get the ISO 4217 currency code for a locale? I'm using Angular. They have a utility function getLocaleCurrencyName() to retrieve the name like euro , US dollar etc. but not the currency code like EUR , USD etc. Any idea? 回答1: Try getLocalCurrencySymbol(): https://pr18487-aedf0aa.ngbuilds.io/api/common/getLocaleCurrencySymbol Note that '$' is not a currency code, it is a currency symbol. USD, CAD, AUD are a few currency codes for currencies that have the symbol '$'. 来源:

Laravel 5.7 verify email localization

与世无争的帅哥 提交于 2019-12-11 18:38:27
问题 Laravel provides an ability to use different language by using app.config + lang folder. However, I don't see any reference in the docs on how to translate base email. I've enabled email verification, however email is sent using English what confuses my users. How do I translate it? 回答1: So as described in https://laravel.com/docs/5.7/localization#defining-translation-strings, simply add a json file to lang folder, named with the desired language, using the strings that you want translate as

Chinese internationalization issue in jsp

柔情痞子 提交于 2019-12-11 18:22:48
问题 I am working in struts2.0 application with internationalization Apart from Chinese it working fine in other languages. When I put Chinese character in jsp I am not getting same values in Action. Please help me for the same. I have also used the UTF-8 pageEncoding <%@page contentType="text/html" pageEncoding="UTF-8"%> I have a text box in the jsp in which I'm filling some Chinese character. But in the Action class on the server side when I try to retrieve the value of the text box,I'm getting

Parsing Exception in Internationalization - message not being found

白昼怎懂夜的黑 提交于 2019-12-11 17:56:13
问题 Im trying to internationalize my application before I get started in developing so its easier for me to expand it later. However as much as I try to follow tutorials, I always get the same error: the tags in my xhtml fail to be parsed, as if the massage did not even exist (even though Eclipse auto-completes them). The summary of the stacktrace is as follows (Here for the full stacktrace at Pastebin): Type Exception Report Message /index.xhtml @11,50 value="#{msg.['title.index']}" Failed to