internationalization

Extract I18n translation keys from rails project

北战南征 提交于 2019-12-12 18:30:37
问题 Is there some gem or tool that I can use to parse my code and extract I18n keys to yml file? so if I have in the code: <%= t("homepage.header", default: "Cool website") %> It would add to the yml file homepage: header: "Cool website" GetText can do it, but for my project now we are using default rails setup. It bugs me a lot that I have to manually update yml files, when I need new translation keys. 回答1: I haven't heard of such tool for Ruby on Rails, but I am pretty sure it exists. On the

.po file for default cakephp libs translations

本小妞迷上赌 提交于 2019-12-12 18:26:21
问题 How to add the translations for cakephp libs files to by default.po file for example - months name - day's name - timeAgoInWords i try to add strings to default.po manually but everytime i update it from default.pot (using poedit) the strings are gone. please help me to solve it it will fine to find solution by using separate .po file 回答1: i solve it - create /app/views/dummy.ctp - duplicate by coping the translation from cake\libs\view\helpers\time.ctp to dummy.ctp - and cake i18n will add

Ruby on Rails - embed additional HTML inside of link_to call that includes I18n

拜拜、爱过 提交于 2019-12-12 18:23:38
问题 I am trying to embed additional HTML inside of a link_to call as found in this thread Embed additional HTML inside of link_to call However, I would also like to use I18n. So instead of this: <%= link_to '<i class="icon-search"></i> Show'.html_safe, exercise_path(exercise), :class => 'btn btn-small' %> I would like to use t(:show) or I18n.t(:show) instead of a hardcoded Show in the above example. I am having trouble figuring out the correct syntax, though. Any help would be greatly appreciated

English characters don't show up when entering text with Indic input method in Swing

淺唱寂寞╮ 提交于 2019-12-12 17:16:37
问题 I'm working on an application that accepts text in English and performs transliteration with a custom 3rd party API into an Indic language (one of several that are supported). The application is targeted at Windows XP/7 and Ubuntu. We use a custom input method that loads the required Indic font, and uses it render text. Also, the user can correct the transliterated text by typing in English and pressing space (similar to how Google Transliterate works). The problem is that with certain Indic

Playframework 2.0.1DateFormatter receives system locale

半世苍凉 提交于 2019-12-12 16:36:54
问题 I wrote a custom DateFormatter in Play 2.0 / Java because the default one seems to be i18n-unaware (the implementation details are irrelevant here) public class DateFormatter extends Formatters.SimpleFormatter<Date> My application configuration contains application.langs="pt-br, en" The languages defined in browser options contain those two (accept-language) Logically, Lang.preferred(List) returns pt-br as preferred language like in @Override public Action onRequest(Request request, Method

Yii submitButton i18n

时光毁灭记忆、已成空白 提交于 2019-12-12 16:31:26
问题 I found how to i18n the message of the submit button like : echo CHtml::submitButton(Yii::t('tr','Print'),array('confirm'=>Yii::t('tr','Please confirm printing'),)); Then setting language also translate well the system messages but how to translate the CANCEL / OK buttons of the submit confirm pop up message box ? 回答1: An alternate solution using CJuiDialog: Code for the jqueryui dialog(CJuiDialog is a wrapper with some additional yii specifics): <?php $this->beginWidget('zii.widgets.jui

Manipulate the list of countries provided by Symfony Intl and the form choice type

一曲冷凌霜 提交于 2019-12-12 16:15:59
问题 Politics aside, I need to provide Kosovo as a form choice when selecting a country. What's the most elegant way of doing this with Symfony's built-in form choice type country , while also providing translations for the Kosovo name? Here's what I've done so far and it works but I'm concerned this might be a bit hack-ish. <?php namespace Acme\Bundle\DemoBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component

Django i18n setlang view gives Error 404

孤人 提交于 2019-12-12 16:05:58
问题 I am trying to translate a django app using the built in i18n. I have already marked the text to be translated and created and compiled the language files ( .po/.mo ) according to the tutorial and with out errors. I've also changed the USE_I18N to true in the settings file and added the following line into the urls.py as the tutorial instructed: (r'^i18n/', include('django.conf.urls.i18n')), I also defined a list of allowed languages in the settings.py, as instructed by the tutorial. then i

Flutter: Application's locale is not supported by all of its localization delegates

纵然是瞬间 提交于 2019-12-12 15:58:14
问题 Hello I am trying add BottomNavigationBar in flutter app but when i run project error occures : A MaterialLocalizations delegate that supports the ka_GE locale was not found This is my app delegates: supportedLocales: [ const Locale('en', 'US'), const Locale('ka', 'GE'), const Locale('ru', 'RU'), ], localizationsDelegates: [ const InfosLocalizationsDelegate(), GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate ], locale: Locale('ka') This is Custom LocalizationsDelegate

In GTK, how do I change the localized language text on the UI while it's running?

最后都变了- 提交于 2019-12-12 15:18:41
问题 In Linux, is it possible to change the UI language on the fly which is created using GTK? I have a application which needs to change UI language on the fly. 回答1: You'll have to either destroy all your widgets and rebuild them with the new locale setting, or manually change all the strings to their translated equivalents. It is best to do this with gettext. Many applications choose not to offer a setting for the UI language inside the application. Instead, they just follow the system language