colon (:) gives load error in locale YAML file - ruby-on-rails

I have a string in en: locale which is
display_device: to play : get player
The colon sign is giving me error which is
can not load translations from C:/Documents and Settings/rajg/discoveryaws/branches/internationalization/config/locales/en.yml, expected it to return a hash, but does not
How can I make this work?

You can escape colons (and other 'important' characters) in your string if you surround it with quotes like this:
display_device: "to play : get player"

Related

What does a semicolon before the query string mean in a URL?

I have read about URL syntax on wikipedia and IBM.
I understand that any URL should be of the same form of a generic URI, which is:
URI = scheme ":" ["//" authority] path ["?" query] ["#" fragment]
Now I have this apparently valid URL:
https://console.cloud.google.com/storage/browser/mybucket;tab=objects?prefix=&forceOnObjectsSortingFiltering=false
which has a ; semicolon before the ? character which marks the beginning of the query string, supposedly indicating that it's somehow part of the path. I have googled "URL path syntax" and have found nothing related to my question. What does a ; semicolon symbol mean at that position? What does tab=objects do?

invalid URL escape "%40

I have an http url defined in my x.yml file. In run time it gives me error like below:
http://user:password%40localhost:7001/wls-exporter/metrics: invalid URL escape "%40
This is how it is configured in yml file:
http://user:password#localhost:7001/wls-exporter/metrics
I tried double code for "#" and also double quotes for entire url, but it still does not work.
Looking for some guidance, help please.

Unexpected '#' in program with User Defined Settings in Xcode

Following user defined setting is declared on Xcode ,
TEST_STRING = \#\"Test String\"
Declared following on preprocessor macro section ,
TEST_STRING = $(TEST_STRING)
However when I try to use this , getting a build failure with
"Unexpected '#' in program"
Program compiles without the whitespace in the string,
TEST_STRING = \#\"TestString\"
Is there any other way I can have a string on user defined settings which supports white spaces ?
The solution is to escape the whitespace character:
\#\"Test\ String\"
For example, NSLog(TEST_STRING); will give you Test String in the console

Ruby regexp: why does this code not replace what is found but simply insert

I have a ruby regexp searching for urls and I'm trying to replace them with a certain type of urls.
So this regexp detects any url but excludes the type I replace with.
However, when I try this code :
s.sub(/(?!\S*\/el\/\d*)(?=(?i)\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<‌​>]+|(([^\s()<>]+|(([^\s()<>]+)))*))+(?:(([^\s()<>]+|(([^\s()<>]+)))*))))/, 'http://localhost:8080/el/133710')
if s is s = "blablabla www.google.com bla http://localhost blabla"
It should replace www.google.com with my string http://localhost:8080/el/133710
but I get this instead :
"blablabla http://localhost:8080/el/133710www.google.com bla http://localhost blabla"
That is because your intended capture www.google.com matches inside a lookahead (?=), so it is not actually captured. www.google.com only works as a lookahead context. What is captured is only an empty string at the position of match. sub is replacing the captured string (which is an empty string) with http://localhost:8080/el/133710.

Firefox addon localization

I have problem with localization my addon. I followed this tutorial on Using Localized Strings in Preferences but I can't compile my addon because I use polish characters ć and others.
I've made locale folder and put there pl-PL.properties file with this content:
my_tag_title = Co robić?
and I got error:
Following locale file is not a valid UTF-8 file: C:\path\pl-PL.properties
'utf8' codec can't decode byte 0xe6 in position 22: invalid continuation byte"
Is there way to put special characters directly inside package.json?
How to solve this problem?
Make sure that the locale file is saved in UTF-8 format.

Resources