internationalization

Angular2 i18n for placeholder text

☆樱花仙子☆ 提交于 2019-12-21 03:41:09
问题 Is there a way to translate the placeholder text for an input text field using Angular 2's i18n? <input placeholder="hello world" i18n> I don't see anything in the documentation about this: https://angular.io/docs/ts/latest/cookbook/i18n.html 回答1: There has been an example, but I can't seem to find it anymore. You should be able to use i18n-attributename . For example: <input type="number" placeholder="From" i18n-placeholder="From placeholder"/> That would need an entry like this: <trans-unit

international Count sms characters

大兔子大兔子 提交于 2019-12-21 02:56:20
问题 I found Count characters/sms using jQuery, but it does not support international characters such as Chinese, Japanese, Thai, etc. var $remaining = $('#remaining'), $messages = $remaining.next(); $('#message').keyup(function(){ var chars = this.value.length, messages = Math.ceil(chars / 160), remaining = messages * 160 - (chars % (messages * 160) || messages * 160); $remaining.text(remaining + ' characters remaining'); $messages.text(messages + ' message(s)'); }); Here are some examples of

C#: Change the resource file without re-building?

断了今生、忘了曾经 提交于 2019-12-21 02:20:14
问题 For an Asp.Net MVC 3 application, I will use resources files to store my I18N( How-to ). It's not me which will translate all fields in all language, I juste have to create in one language and create empty language files for the two other language. And in the implementation I will use those three files. So for the development I've not any problem, but after I've created the website, it's the customer which will translate all those fields. I found a great app which allows to translate from one

How to change case of interpolated variables in Rails locale file?

拥有回忆 提交于 2019-12-20 20:27:14
问题 Using Rails 3.1.3 with Ruby 1.9.3p0. I've discovered that by default, Rails does not use sentence case for form buttons. For example, instead of an "Update user" button, it generates an "Update User" button. The button names come from the ActionView locale file. Is there a way to create a default that downcases the model name? This is not covered in the Ruby on Rails Guides i18n section on Interpolation so maybe it is not possible. The following doesn't work: en: helpers: submit: update:

Grails: Native2ascii error when I add a new property to message.properties

拈花ヽ惹草 提交于 2019-12-20 20:06:15
问题 I get a strange error when I add a new property to message.properties file in my grails application during runtime. When I restart the application via the command line, or restart STS, this error disappears. I am on version 2.0.1 and until a week ago, I was able to add new properties to message.properties file during runtime. Here is the stacktrace of the error | Error 2012-06-18 16:54:58,702 [Thread-38] ERROR plugins.AbstractGrailsPluginManager - Plugin [i18n:2.0.1] could not reload changes

Gettext automatic comments generation

浪尽此生 提交于 2019-12-20 19:42:19
问题 I'm doing i18n for a php project using gettext. I'd like to use the automatic comment feature to give hints to translators when translating long phrases replaced by id. What I want to obtain is the following po file #: full-path-to-file/index.phtml:3 #. a very long text which should replaced by _('foobar') msgid "foobar" msgstr "" In this way the translator can see what he should translate when he see the key foobar using POEdit or some analogue tool in the programmer comment box. I've tried

Is there a single rule to cope with single quotes in writing Spring Resource Boundle?

此生再无相见时 提交于 2019-12-20 18:54:27
问题 Spring's ResourceBundleMessageSource uses MessageFormat for replacing placeholders ( {0} ) inside messages. MessageFormat requires that single quotes ( ' ) are escaped using two single quotes ( '' ) (see: MessageFormat Javadoc). However, by default messages that does not contain any arguments will not be parsed by MessageFormat , so single quotes in messages without arguments don't need to be escaped. So your translator have to be aware of two rules in writing and maintaining resource bundle:

Is there a single rule to cope with single quotes in writing Spring Resource Boundle?

戏子无情 提交于 2019-12-20 18:52:31
问题 Spring's ResourceBundleMessageSource uses MessageFormat for replacing placeholders ( {0} ) inside messages. MessageFormat requires that single quotes ( ' ) are escaped using two single quotes ( '' ) (see: MessageFormat Javadoc). However, by default messages that does not contain any arguments will not be parsed by MessageFormat , so single quotes in messages without arguments don't need to be escaped. So your translator have to be aware of two rules in writing and maintaining resource bundle:

i18n and Error messages in Kohana 3

梦想与她 提交于 2019-12-20 14:59:29
问题 I am developping an administration application with Kohana 3 and I'm obviously working with a lot of forms. The application needs to be multilangual and I'm very confused about how to manage my messages files and especially how to access them. Does i18n support different folders and files inside the language folder? E.g: i18n en form fr form Or does it support arrays in the language file? i18n/fr.php <?php defined('SYSPATH') or die('No direct script access.'); return array ( 'common_form' =>

Translated attributes in Rails error messages (Rails 2.3.2, I18N)

一曲冷凌霜 提交于 2019-12-20 14:12:33
问题 I have defined translated attributes and model names in the translation file and Modelname.human_attribute_name(...) returns the correctly translated attribute name, but the attribute names in the error messages are untranslated. What is needed that the attribute names in the error messages are translated? 回答1: From the Guide on the subject, you will need to set up the localization file properly with your model names and attribute names: en: activerecord: models: user: Dude attributes: user: