translation

SVG Transformations in JavaScript

不羁岁月 提交于 2019-12-29 06:20:32
问题 SVG Transformations can be done through JavaScript by settings their corresponding attributes setAttribute("transform", "translate(x,y)") but should also be possible through pure JavaScript. elem.transform.baseVal.getItem(0).setTranslate(x, y); elem.transform.baseVal.getItem(0).setRotate(x, y); These two should work for translation and rotation, but how about skewing, scaling and matrix? elem.transform.baseVal.getItem(0).setMatrix() exists, but as far as I can tell, it doesn't excepts any

django blocktrans and i18n in templates

烈酒焚心 提交于 2019-12-29 06:13:25
问题 I have an i18n problem in django: This works fine : {% trans cat.name %} cat.name will be translated But this doesn't work: {% blocktrans with cat.name|slugify as cat_slug %}{{ cat_slug }}{% endblocktrans %} cat.name is not translated If I change the filter : {% blocktrans with cat.name|capfirst as cat_slug %}{{ cat_slug }}{% endblocktrans %} I can see that the filter is working, but there is no translation... 回答1: I'm only just getting started with Django internationalization, but I think

how to pull out php code that contain certain words in ruby

蓝咒 提交于 2019-12-27 03:44:27
问题 Say if i have lots of php file (.php) and I'm only want to pull out block of code that contain certain words e.g. $this->te Any idea how I do it? using ruby would be better? if ($attachments && count($attachments) > 0) { echo "\n\n{$this->te('Attachments')}:\n"; ... 回答1: You can just use grep for it: grep '$this->te' -R *.php -n If you want to do similar thing with Ruby, you can use something like: Dir.glob('*.php').each do |x| File.read(x).split("\n").each_with_index do |line, n| puts "Found

how to pull out php code that contain certain words in ruby

旧城冷巷雨未停 提交于 2019-12-27 03:44:12
问题 Say if i have lots of php file (.php) and I'm only want to pull out block of code that contain certain words e.g. $this->te Any idea how I do it? using ruby would be better? if ($attachments && count($attachments) > 0) { echo "\n\n{$this->te('Attachments')}:\n"; ... 回答1: You can just use grep for it: grep '$this->te' -R *.php -n If you want to do similar thing with Ruby, you can use something like: Dir.glob('*.php').each do |x| File.read(x).split("\n").each_with_index do |line, n| puts "Found

Does it fill from the top or bottom

江枫思渺然 提交于 2019-12-25 14:48:29
问题 I am trying to translate this MatLab code into R. % ensure existing positions are carried forward unless there is an exit signal positions= fillMissingData(positions); Here is the information I have about the fillMissingData function: function [filledPrices]=fillMissingData(prices) % [filledPrices]=fillMissingData(prices) fill data in a 2-dim array with NaN's with the % previous value. filledPrices=prices; for t=2:size(filledPrices, 1) missData=~isfinite(filledPrices(t, :)); filledPrices(t,

silex and twig localization

孤街醉人 提交于 2019-12-25 13:16:11
问题 I'm trying to implement translation in my web application with silex framework. So, i've come up with this <?php require_once __DIR__.'/../vendor/autoload.php'; $app = new Silex\Application(); $app['debug'] = true; $app->register(new Silex\Provider\UrlGeneratorServiceProvider()); $app->register(new Silex\Provider\TwigServiceProvider(), array( 'twig.path' => __DIR__.'/../views', )); $app->register(new Silex\Provider\TranslationServiceProvider(array( 'locale_fallbacks' => array('hr'), ))); $app

Application fails to read strings from localized folders

主宰稳场 提交于 2019-12-25 09:27:23
问题 I got a strange case going on. My app has 4 language supports: English, Turkish, Russian & Ukrainian. I got the following resource folders: I got Turkish translation on values, so default will be Turkish if it fails to find the translation of any string. Below you can see there are no keys needing translation: Okay so, as far as I know, when I change the phone language, it should use corresponding strings. When I make phone language Turkish: Great. Now, English: Works too. Now Russian: Ugh.

Android strings.xml length

孤者浪人 提交于 2019-12-25 02:26:52
问题 Is there a way to get the number of strings in my strings.xml or to check if all strings are available in the selected language? 回答1: I don't think there is something in the public api. You can try with reflection since from strings.xml the R.string class is generated.. try this: Field[] f = R.string.class.getDeclaredFields(); 回答2: I don't think your approach is the best. If you are going to provide multiple languages, then probably the best way to store these in android is as alternative

Magento Not Translating Wishlist Product Name and Description

半世苍凉 提交于 2019-12-25 01:29:45
问题 I have a developmental Magento Store I'm setting up with two languages. Everything works perfect except the SideBar Wishlist and the "My Account" Wishlist displays the Spanish option no matter what. Everything switches i.e. the "My Wishlist" title header, even the email to friend box that automatically writes in "Please, enter your comments..." changes correctly. But the product name and discription remians in Spanish. I've tried this suggestion here: Wishlist don´t capture store views

why doesn't the Zend_Locale honor abbreviated formats like zh_HK or zh_CN

笑着哭i 提交于 2019-12-25 01:14:58
问题 I have the following piece of code and am trying to do something simple with the Zend framework and Zend_Locale() $supported_langs = array( 'en' => 'English', 'zh_CN' => '中文(简体)', 'zh_HK' => '中國(傳統)', 'es' => 'Español', 'ja' => '日本', 'pt' => 'Português', 'de' => 'Deutsch', 'ar' => 'العربية', 'fr' => 'Française', 'ru' => 'Pусский', 'ko' => '한국의', 'hi' => 'हिन्दी', 'vi' => 'Việt' ); echo '<pre>'; foreach ($supported_langs as $lang => $desc) { print Zend_Locale::getTranslation($lang, 'language',