i am developing a joomla 1.5 module and don't know how to make a multiple row translation file
in my file en-gb.com_abc.ini
i have:
TITLE=Title
AUTH LINK=Authorization Link
CONTRACT=this is a very long translation
and i need it on more than one row
is it possible?
when i use echo JText::_('CONTRACT');
joomla only outputs
this is a very long translation
but i would like it to ouput
this is a very long translation
and i need it on more than one row
is it possible?
how to do it ?
put "" around the text or put '\n' at the end of each line.
in joomla 1.5 "" doesn't work, the only solution i found was writing a script which replaces all "\r\n" with
"\\n"
Related
I am trying to make an internal link to a heading called "word & word".
Since I am using Jekyll, the content is in Markdown files and the heading I want to link to looks like this:
### word & word
I know that I can not use & in URLs.
Therefore this would not be an option:
#word-&-word
I also tried:
#word-%26-word
and
#word-&-word
#word-%26amp;-word
#word-%20amp%3B-word
However, both versions are not working.
What would be the appropriat way to fix this?
Kramdown is striping non alphanumeric from header id's and replacing spaces by -.
You can just check this behavior with :
- mandatory
{:toc}
### word & word
Resulting link in generated table of content is #word--word
See kramdown documentation
I have a rails app with a .yml file that holds translations which are used in the app by calling t(.my_text)
When I use text with a forward slash in it, for example "Be good / bad" The page does not seem to load. However when I remove the spaces ("Be good/bad") the page loads correctly and the text is shown.
Why could this be?
thanks guys
I'm sure you know more about ruby than I do but it sounds like the " / " is syntactically important to strings. have you tried escaping the slash?: \\/
I have lines of text and I have to find whether these lines contain some link . how can I do it?Firstly I thought of finding www in the text but some links might not have www . Secondly I thought of finding http in text but again all links do not contain http. what to do?
Here is a regexp adapted from http://mathiasbynens.be/demo/url-regex entry by #diegoperini (Ruby syntax; you might need to change some details like Unicode \uXXXX to whatever your system uses):
(?:(?:https?|ftp):\/\/)?(?:\S+(?::\S*)?#)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]+-?)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?
My client wants a string to show up as two sentences in the front. I am having trouble figuring out how I can do this.
for example in my config/locales/he-IL.yml file I have this
home:
instructions: "I am the world, please like ruby"
in my view I want it to show up as
I am the world please
like ruby
its actually in hebrew, it should look like this
הכנס את קוד זיהוי המחקר שלך וקוד המשתתף שלך לשדות הבאים. נא ליצור קשר
עמנו אם יש לך שאלות נוספות.
please note that its read from right to left. Right now I have it lump as one piece of string so its not entirely viewed correctly in the front.
I have tried double quoting, using a new line, google for regular expressions and checking out the rails internationalization docs. would anyone have an answer for this?
You can use html tags inside. Just add _html.
home:
instructions_html: |
I am the world, <br/>
please like ruby
I am getting text from a feed that has alot of characters like:
Insignia™ 2.0 Stereo Computer Speaker System (2-Piece) - Black
4th-Generation Apple® iPod® touch
Is there an easy way to get rid of these, or do I have to anticipate which characters I want to delete and use the delete method to remove them? Also, when I try to remove
&
with
str.delete("&")
It leaves behind "amp;" Is there a better way to delete this type of character? Do I need to re-encode the text?
String#delete is certainly not what you want, as it works on characters, not the string as a whole.
Try
str.gsub /&/, ""
You may also want to try replacing the & with a literal ampersand, such as:
str.gsub /&/, "&"
If this is closer to what you really want, you may get the best results unescaping the HTML string. If so try this:
CGI::unescapeHTML(str)
Details of the unescapeHTML method are here.
If you are getting data from a 'feed', aka RSS XML, then you should be using an XML parser like Nokogiri to process the XML. This will automatically unescape HTML entities and allow you to get the proper string representation directly.
For removing try to use gsub method, something like this:
text = "foo&bar"
text.gsub /\b&\b/, "" #=> foobar