Can't translate kartik/datecontrol/DateControl - yii2

I have this Yii application (started from Yii basic template) which I'm trying to translate. The problem is, when I switch from English to Serbian, \kartik\datecontrol\DateControl gets translated wrongly (it gets translated to Serbian, but Cyrillic instead of Latin). Naturally, I found the translation file (vendor/kartik-v/yii2-datecontrol/locales/sr/dateSettings.php) and changed translations, but only display of date changed to Latin. I print_r-ed the location of translation files in DateControl class and it gave me the above file, so I think I got that one correct.
When I click on date picker, nothing changed. Next I went to datepicker component (vendor/kartik-v/yii2-widget-datepicker/messages/sr/kvdate.php) and changed translations there, but again nothing changed. I tried even datetimepicker and timepicker, but again no luck.
Now it's driving me crazy, I have no idea where else to look to translate those strings.

Related

Obsidian formats code in a wierd way when in Read-Mode

I am fairly new to Obsidian and have run into an issue that I can't resolve:
When in Edit-Mode the code I put into my note gets looks normal and how I formatted it to look like, but as soon as I switch into Read-Mode, the formatting is all over the place.
(See picture below: left is edit-mode and right is read-mode)
This only happens in this instance (so far), all my other code blocks get displayed fine. It is react code marked with JFX.
I have tried importing the code again and reformatting it by hand but get the same result.
Also I have searched for code-format plugins.
I have found the answer:
It was the Theme I had selected (Everforest) that messed the code-formatting up.

Check for visual presence of character on page?

I'm in an odd situation where I need to check, via a test, that a currency symbol is being properly displayed on our web page.
We've been running into issues where sometimes the unicode alphanumeric value is showing up on the page instead of the actual currency symbol itself.
Is there a way to check for something like this? Like with some type of visual checking library, or through javascript?
The answer to this issue was to specifically copy and paste the unicode character I was looking to test against into my text editor.
So using the Protractor framework, I would find my css element, and if I have a known price of 17.99 that should be returning, my test function would return:
return expect(myPriceElement.getText()).to.eventually.equal(£17.99);
If on my webpage, £17.99 shows up, then my test will pass

Regular expressions to match several characters Editpad

I have a wordpress export with older posts which are going to be imported into a different installation. But I have an issue where there is a part of the content that needs to be converted into a different type of content in the other installation.
The original code is like this:
000d3c4c]]></content:encoded>
And I need to make it into this
</content:encoded><wp:postmeta>
<wp:meta_key><![CDATA[mkd_post_audio_link_meta]]></wp:meta_key>
<wp:meta_value><![CDATA[000d2aa8.mp3]]></wp:meta_value>
</wp:postmeta>
I'm using EditPad Pro to search through the file, and to prevent me from using several hours doing this change manually, I tant to use the extensive search and replace feature in EditPad, but I have some issues trying to match this. I want an expression to be like this.
First search and replace will work no matter what because i can change
<a href="000
into
</content:encoded>
<wp:postmeta>
<wp:meta_key>
<![CDATA[mkd_post_audio_link_meta]]></wp:meta_key><wp:meta_value>><![CDATA[000d2aa8.mp3]]></wp:meta_value>
</wp:postmeta>
But I struggle with the next part.
How can I change everything after .mp3 to this
]]></wp:meta_value>
</wp:postmeta>
To make it brief. I want to replace all occurences of
">000d3c4c</a>]]></content:encoded>
with
]]></wp:meta_value>
</wp:postmeta>
The 000d3c4c are different for each occurence of the mp3 link.
Match this
<a[^>]*>([^<]+)
and replace by this
</content:encoded>
<wp:postmeta>
<wp:meta_key><![CDATA[mkd_post_audio_link_meta]]></wp:meta_key>
<wp:meta_value><![CDATA[$1.mp3]]></wp:meta_value>
</wp:postmeta>

Use method name for SublimeText 2 autocomplete as well as tab trigger

The default SublimeText 2 snippets, located in the Packages directory and then under, say, Ruby are useful but only if you happen to know the tab trigger. For example the file ~/Library/Application Support/Sublime Text 2/Packages/Ruby/alias_method-..-(am).sublime-snippet contains:
<snippet>
<content><![CDATA[alias_method :${1:new_name}, :${0:old_name}]]></content>
<tabTrigger>am</tabTrigger>
<scope>source.ruby</scope>
<description>alias_method ..</description>
</snippet>
So we can access this trigger by hitting am then tab.
My question is, if this snippet chucks in alias_method :${1:new_name}, :${0:old_name} isn't there a way that I can use this snippet without knowing its am trigger, just by starting to type alias_m... for example?
Umm, no, not that I can find. I just opened up a blank Ruby file, hit a, and autocomplete popped up with all sorts of options, including the snippet you mentioned. However, if I then typed an l (starting to spell out alias...), the option for the am snippet disappeared. So, it looks like autocomplete is not searching the <description> field, only the <tabTrigger> field. There aren't any options in Preferences -> Settings - Default that would seem to address this situation.
So, unfortunately it would seem the solution is one of two things - either edit all your commonly-used snippets to have tabTriggers that make more sense to you, or put together a snippet cheat sheet. It looks like at least one other person was thinking the same thing, as I found this collection without too much searching.
Good luck!

Google Charts: HTML entities in NumberFormat prefix

I'm trying to get the UK GBP symbol (£) to show up correctly in my Google Chart's table but I'm finding that HTML entities seem to be automatically escaped.
var formatter = new google.visualization.NumberFormat({
prefix: '£',
});
The above example literally shows £ in the table rather than showing up as the correct symbol.
Is there any way to get it to show up as it should be?
Previously I tried just using prefix: '£' but it was making the pound symbol show up as a blank square instead. I then searched and found another stackoverflow question suggesting that the person use the straight UTF-8 value -- in this case it becomes prefix: '\u00A3' which is quite unreadable.
I've just discovered that using the pound symbol directly works if I make sure my Javascript file is set to be encoded as UTF-8, but I'm still interested in general as to how you would get HTML entities to show up.
If you want regular HTML entities to show up, you have to set the Table's "allowHtml" option to true.
Edit:
To clarify, "allowHtml" only works on Tables and OrgCharts. The SVG/VML-based charts (Area, Bar, Bubble, Candlestick, Column, Gauge, Geo, Line, Pie, Scatter, Stepped Area, Timeline, and Treemap) don't support HTML entities; you have to use the unicode value for the character.