Liferay-ui:icon localization - portlet

I'm currently working on a portlet for the Liferay portal. I'm using the liferay-ui:iconconstructions in my JSP code which support already the localization in many different languages. However I now found one entry which doesn't seem to be localized:
<liferay-ui:icon image="add_article" message="add-article" label="true" url="${addUrl}" />
All the others work, but the "add_article" doesn't. Can somebody help me? I know there should be somewhere "Language.properties" files for the different languages and there should be an entry action.ADD_ARTICLE=<the localized text>. Can someone give me a hint how I could solve this?
\EDIT:
I just found the according Language.properties files in the portal-impl.jar. The entry action.ADD_ARTICLE is there and correctly localized and still, it doesn't appear localized on the UI??
Thanks

Strings can be localized in ext/ext-impl/src/content/Language-ext_your locale.properties.

I had the same issue here, this workaround worked for me:
<% String message = LanguageUtil.get(pageContext, "action.ADD_ARTICLE"); %>
<liferay-ui:icon image="add_article" message="<%= message %>" label="true" url="${addUrl}" />
Remember to import:
<% #page import="com.liferay.portal.kernel.language.LanguageUtil" %>
Hope it helps!

You can also use a hook to personalize the localized strings.

Related

MagnificPopup won´t work with Typo3

I would like to use magnific popup for a site which is still in development, but unfortunately nothing happens after the installation and adding the static content in my template.
No matter what i try no popup comes up.
If someone would like to help me i will provide access to the site.
Thanks a lot!
First thing to do:
look at your source code: does the 'link' show any sign of 'magnific popup' code?
Added classes? id?
Second: do you see any extra javascript and/or stylesheet that is added by the extension?
If you answer negative to 1 of these, the extension does not output anything. Sounds logic, but it is the first step. Is it a solution? Nope, it means your live just got a bit more worse, but hang in there !
If it does show any code from the ext: look at your console, are there any js errors occurred ? (if you don't know what console is, or (even worse) you work with IE) please read about chrome console of at least install Firefox with firebug.
My best beth would be a JS error...
Can it be possible that the ext itself does not work?
Does your php error logs tell you that the extension is behaving badly?
Do you see errors in the typoscript analyser (or whatever it's called to analyse the css_styled_content and other TS spaghetti )
If not, then no, it is not the ext.
Again, i'm betting my wive, three horses and a barrel of beer on JS erros.
Good luck mate !
ps: IF i'm wrong, i'm not sending you my wife by postal service. Loads of trouble last time. Nor the horses, same shizzle ..

Bad permalinks adding "%20%E2%80%8E"

Can anybody help me on this issue? It's very important to my site.
Some (although not all) of my permalinks won't work. Some work perfectly and some are having variants of this "%20%E2%80%8E" added to the end of them, which obviously is giving me the 404 message.
I've tried deactivating plug ins but had no difference and obviously as some work, it is unlikely to be that. I have also checked for hidden characters but cannot seem to find any.
Can anybody think of a viable reason/solution for this error?
Thanks
If you are using c# .net then before open the url just encode it.
ReplacedString = HttpUtility.UrlEncode(YourString);

cordova (ex phonegap) tel: links in <a href> not working in ios5

I've checked everywhere here in stackoverflow, google, phonegap and other websites but I cannot find a solution, but if I did miss the right link, please post me to it, because I'm lost.
1: I'm using Cordova + JQmobi to write my apps.
2: the only link that doesn't work is the TEL: in a tag links.
3: they work in Safari for ios (any version I've found from ios4 to ios5.1)
4: ONLY in ios5 the link to TEL: won't work in native apps
Here the codes I've tried:
Link to the tel
Link to the tel
Link to the tel
Link to the tel
For the format of the telephone number I've used:
tel:+39000000 (+39 is for italy)
tel:123456 (I've tried any kind of real telephone numbers but I have no #, * or spaces)
tel://+39123456
When I check on the xCode simulator for a SMS: link i get this error:
AppDelegate::shouldStartLoadWithRequest: Received Unhandled URL sms:+39123456
And that's correct because the simulator doesn't have the SMS app, but then when I try the TEL: link:
Failed to load webpage with error: The URL can’t be shown
That for what I know is something that happens if you write a non legal url that you want to open with a browser.
I've read that jqmobi (as much as other framework such as jqtouch) could prevent the default behavior of a link but that if you explicitly invoke it.
What is really changed in the ios5? Because all my links work on the ios4.3
Anyone out there please help me and many other I saw couldn't find a real solution for this new update of Apple.
Thanks for all
My solution is: there is no solution. But a plugin:
https://github.com/mchristie/PhoneGap-ios-PhoneDialer/
If you use cordova be sure to check the 4 lines you have to change (cordova instead of phonegap)
Actually there is a solution to this, or at least there was for me, here it is:
In the HTML:
<input type="button" href="tel:+1-800-555-1234“ class="phone-number" value="1-800-555-1234"/>
In the Javascript:
$(‘.phone-number’).bind(click, function(e) {
e.preventDefault()
var phoneLink = $(e.currentTarget).attr('href');
window.open(phoneLink, '_system', 'location=yes’);
}
Addendum... Someone suggested an edit where i change ‘.phone-number’ to '.phone' and remove the 'location=yes’. I don't know what affect that would have on this code because I am no longer working on this project and the code is in a repo that I own, but I can tell you for certain changing .phone-number to just .phone would definitely not work because that is not what i called the class in the input field. As for the location=yes being removed, again I have no idea what affect that would have since I don't have the code anymore. They did however point out that I used the incorrect left and right quotes. That was probably just a cut-paste mistake on my part but who knows.
Have you tried removing the '+'?
Link to the tel
Link to the tel
Link to the tel
Link to the tel
as from their spec it sounds like they don't fully support all special characters:
http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html

Custom Lift tags don't work

The following types of tags in Lift do not seem to work for me:
<lift:snippet type="MyClass:render" />
<lift:MyClass.render/>
<lift:MyClass/>
Using these tags results in a Class Not Found error. If I attempt to call a class using
<div class=lift:myclass.mymethod />
it can work. Or if I call it using span tags. For instance, the Hello World example in Pollak's Simply Lift works for me, successfully displaying the Howdy method with the following code:
<span class="lift:helloWorld.howdy">
Welcome to your Lift app at <span id="time">Time goes here</span>
</span>
Currently, my problem is coming from attempting to implement Exploring Lift's (aka The Lift Book) OpenID example in Chapter 13.1. I have downloaded OpenID4Java using sbt as well as the lift-openid library. That example can be found at http://exploring.liftweb.net/master/index-13.html. I have implemented the change to the Boot class, and created the OpenID class and the SimpleOpenIDVendor class. But creating an html file containing
<lift:OpenID.form>
<openId:renderForm/>
</lift:OpenID.form>
causes the following error to be displayed in the browser:
Error processing snippet: openid.form
Reason: Class Not Found
XML causing this error:
<lift:openid.form xmlns="http://www.w3.org/1999/xhtml">
<openid:renderform>
</openid:renderform></lift:openid.form>
The class OpenID was placed in a package that starts with the package code, which is being implicitly found by Lift. It is included in the Boot.scala file with the line
LiftRules.addToPackages("code")
So, I am at a loss. Any ideas?
Note that other lift tags such as lift:bind-at and lift:surround and the like work fine.
As dave posted under my original comment, the problem was the HTML5 parser. Lift is case-sensitive, and cannot find a class with varying case. Since the HTML5 parser automatically makes tags lowercase, you can't use custom lift tags anymore. Instead, you have to use something like
<div class="Lift:MyClass.render"></div>
Note that you CANNOT have
<div class="Lift:MyClass.render" />
as HTML5 apparently does not support such tags.
My OpenID4Java problem is therefore resolved by using:
<div class="lift:OpenID.renderForm">
</div>
Why I don't need to use openid.form still is uncertain. It could be possible I'm implementing it slightly off, but I confirmed that it will take me to an openid login page if I put in the openid link, so it is indeed functional.
Sources:
http://groups.google.com/forum/#!topic/liftweb/H-xe1uRLW1c
https://groups.google.com/group/liftweb/browse_thread/thread/3948df1eee6ec271/ (thanks fmpwizard)

JSF Validation not finding custom ResourceBundle class

I have a custom ResourceBundle class org.example.web.UILabels.java which works well in running code but the JSF editor in Eclipse is not finding it, I assume the editor/validator is only looking for properties files by the name. This also means I no longer get type ahead find on the resources which was very nice to have.
Any ideas how this could be rectified?
<f:loadBundle basename="org.example.web.UILabels" var="uiLabels"/>
...
<h:outputText value="#{uiLabels.someTextValue}" />
...
I am getting the error message (in the problems error list)
Resource bundle org.example.web.UILabels cannot be found on classpath
Type=JSF Problem
Eclipse3.4.0 with WebStandardTools Versions
Version:1.4.0.v200802280619-13-7w311917141518
Version:1.5.1.v200802280619-1407w311917141519
Version:3.0.0.v200806092130-7A-8Y8QqN2lf4VSWrI2ek5Pf4k7s
For more about why I am using a ResourceBundle class instead of just a properties file see Question 653682 how-to-override-some-resources-from-a-propertyresourcebundle
Thanks for your time, David Waters
The resource-bundle element is more efficient than the f:loadBundle action since the bundle can be created once for teh entire application. However its a JSF 1.2 feature and if u want to be compatible with JSF 1.1 you must use JSF 1.1. Heres an example if your using JSF 1.2:
Define it in your faces-config.xml like this:
<application>
<resource-bundle>
<base-name>org.example.web.UILabels</basename>
<var>uiLabels</var>
</resource-bundle>
</application>
Sorry for not answering your question, but I dont have first hand experience with Eclipse. I also misunderstood your question first, therefor Ive edited my original answer.
I had the same problem, I finally find this sollution :
Eclipse search only the default properties, your project has to have a properties with no locale, for example, with :
<f:loadBundle basename="i18n.messages" var="msg" />
Eclipse will only search "i18n/messages.properties".