internationalization

How can I identify unused i18n keys?

让人想犯罪 __ 提交于 2019-12-20 12:31:18
问题 I'm working on an existing Rails app and am using a localization file, en.yml , to hold most of the app's text. At the moment, we aren't localizing into any other languages, so there's just the one file, but the fact that we're putting translate('some.key') into our views means that adding another language will be as simple as adding another file - say, sp.yml The problem is, en.yml has grown to the point that I doubt all the keys are being used. Apart from git grepping for translate calls

Packaging an Angular library with i18n support

ぐ巨炮叔叔 提交于 2019-12-20 12:09:35
问题 Angular's i18n is great, and tools like ng-packagr makes component library packaging extremely easy, but can they be combined? What if i want to package and distribute a component library having translatable components? Is it possible? How do I package such a library? Will translation files be shipped together with the package, or should they be defined in the main app? It'd be great if someone could point me at some doc. Thanks 回答1: When you generate a translation file for the main app with

Packaging an Angular library with i18n support

女生的网名这么多〃 提交于 2019-12-20 12:08:14
问题 Angular's i18n is great, and tools like ng-packagr makes component library packaging extremely easy, but can they be combined? What if i want to package and distribute a component library having translatable components? Is it possible? How do I package such a library? Will translation files be shipped together with the package, or should they be defined in the main app? It'd be great if someone could point me at some doc. Thanks 回答1: When you generate a translation file for the main app with

International Pluralization Lib for Objective-C?

与世无争的帅哥 提交于 2019-12-20 12:02:11
问题 I am internationalizing my app and am looking for a solution to how to deal with plural forms. I ran across Mozilla's PluralForm project, which essentially abstracts away the issue of plurals for internationalization. Here's how it works: There are a number of "plural rules" that languages can follow. Each language fits into one and only one of the many plural rules (Mozilla's documentation has 15 potential plural rules). For example, in languages with rule 0 (such as Chinese), there are no

How can I send emails in Rails 3 using the recipient's locale?

一世执手 提交于 2019-12-20 11:14:34
问题 How can I send mails in a mailer using the recipient's locale. I have the preferred locale for each user in the database. Notice this is different from the current locale (I18n.locale), as long as the current user doesn't have to be the recipient. So the difficult thing is to use the mailer in a different locale without changing I18n.locale: def new_follower(user, follower) @follower = follower @user = user mail :to=>@user.email end Using I18n.locale = @user.profile.locale before mail :to=>..

How to use i18n with a Grails/Groovy enum in a g:select?

杀马特。学长 韩版系。学妹 提交于 2019-12-20 10:44:56
问题 i am trying to get i18n localisation working on an Grails/Groovy enum, public enum Notification { GENERIC(0), CONFIRM_RESERVATION(100), CONFIRM_ORDER(200), CONFIRM_PAYMENT(300), final int id; private Notification(int id) { this.id = id } String toString() { id.toString() } String getKey() { name() } } Any hints on how i could achieve that? I tried to put the full classname etc in a localisation but this does noet seem to work <g:select from="${Notification.values()}" name="notification"

Internationalization in JSF 2.0

半腔热情 提交于 2019-12-20 09:45:36
问题 I'm wondering how internationalization works in jsf? I have read tutorial on coreservlets.com about it, but in my case it works slightly differently. In that tutorial said that i have to use FacesContext.getCurrentInstance().getViewRoot().setLocale(newLocale); in actionListener(listener for changing locale) and also backing bean has to have property getCurrentLocale() to use it in <f:view> tag. I have 2 property files with messages(default and with specified locale), they are registered in

IPhone localization: Is it possible to translate nib files easily without having to copy the nib for each language?

天大地大妈咪最大 提交于 2019-12-20 09:42:07
问题 I'm trying to find a manageable way to translate every visible string in an iPhone application. The official apple documentation says to use .strings files for programmatic strings, while using the built in "add localized file" option in xcode to localize nib files. The problem i see with this is that if the UI needs to change after localization happens, then we would need to update the nibs for each language individually which is less than optimal. Is there a simpler way to perhaps tie

Generate Yii translation message files

烈酒焚心 提交于 2019-12-20 09:04:19
问题 I am interested to know is there a script or otherway available to collect and generate Yii translation messages in a controller/project Eg. If I have the following codes in a controller Yii::t('blog', 'Your name'); Yii::t('category', 'Category name'); It should generate English translation message files as blog.php and category.php with above strings in messages directory. Please let me know if somebody knows a way. Thanks 回答1: There's no need to reinvent the wheel. You can use yiic for that

What is a good definition for language code and locale codes?

北城以北 提交于 2019-12-20 08:48:52
问题 When to use en_GB and en-GB ? What is the difference ? Is there an ISO name for this ISO 639-1 (language) and ISO 3166 (country) combination ? 回答1: There are several systems for locale identifiers. Many of them are similar at the first glance, but not when you go deeper: Some examples (Serbian-Serbia with Latin Script, Japanese-Japan with radical sorting): UTS-35, ICU, Mac OS X, Flash: sr-Latn-RS, ja-JP@collation=radical Newer UTS-35, BCP 47 extension U: sr-Latn-RS, ja-JP-u-co-unihan Win 2000