Note that there are some explanatory texts on larger screens.

plurals
  1. POPlay Framework 2.0 - issue in rendering view
    primarykey
    data
    text
    <p>I followed this link <a href="https://github.com/julienrf/play-jsmessages/commit/3f67083e296edc039af6ed7fc0fe698a282d01b5" rel="nofollow">https://github.com/julienrf/play-jsmessages/commit/3f67083e296edc039af6ed7fc0fe698a282d01b5</a> to implement i18N in javascript.</p> <pre><code>Application.java =================== package controllers; import java.util.HashMap; import java.util.Map; import play.i18n.Messages; import play.i18n.Lang; import play.*; import play.mvc.*; import jsmessages.JsMessages; import views.html.*; import models.Session; public class Application extends Controller { private static Session session; final static JsMessages messages = new JsMessages(play.Play.application()); /** * Loads the application * @return */ public static Result index() { return load(); } public static Result jsMessages() { System.out.println("in jsMessages"); return ok(messages.generate("window.Messages")).as("application/javascript"); } /** * Initial load function, clears all stored session data * @return Redirect to homepage.html */ public static Result load() { System.out.println("in load1"); session = new Session(); changeLang("fr"); jsMessages(); return ok(mainpage.render(messages)); } public static Result reset() { session = new Session(); return ok(); } public static Session getSession() { if(session == null) { session = new Session(); } return session; } } HTML which is rendered properly if i don't include i18n code for javascripts mainpage.scala.html ========================== @(messages: jsmessages.JsMessages) &lt;html&gt; &lt;head&gt; @messages.html("window.Messages") &lt;/head&gt; //some code goes here &lt;/html&gt; javascript loaded on rendering homepage.scala.html Main.js ====== // some code goes here alert(Messages('first')); //some code goes here If I am not including i18n code in Application.java , mainpage.scala.html and main.js , my application is working fine but after including i18n code , page is not getting loaded. </code></pre> <p>As per my understanding , problem is with rendering ,as two results are being returned from load() and jsMessages().Kindly suggest me how to render both javascript and html or any other way so that this issue can be resolved.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload