Re: Dynamic localisation
I think I'll try rolling my own Localizer to do on the fly substitutions although that NestedStringResourceLoader looks pretty useful! My thanks to you both, CN -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4675001.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic localisation
+1 that's really useful! Thanks Sven On 01.07.2016 19:35, Tobias Soloschenko wrote: Hi, I remember a ticket in which this was a requirement. Maybe we should consider to take this implementation to core: https://github.com/klopfdreh/wicket-components-playground/wiki/22.-NestedStringResourceLoader kind regards Tobias Am 01.07.2016 um 17:22 schrieb Sven Meier : Hi, alternatively you could role your own Localizer or IStringResourceLoader that does some fancy replacement. Have fun Sven On 01.07.2016 08:50, ChambreNoire wrote: The thing is, I don't know in advance which words need to be dynamically changed. So for instance : "The user is not currently associated with a service" I could want to replace 'user', 'service' or even 'associated' depending on the context. I could always add context-specific property files with the overridden version : package_contextA.properties > The peasant is not current managed by a landowner I suppose these could be generated at build by parsing the base package.properties and generating context-specific property files where necessary (only if these contain words to be replaced). Seems a bit messy though... CN -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4674992.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic localisation
Hi, I remember a ticket in which this was a requirement. Maybe we should consider to take this implementation to core: https://github.com/klopfdreh/wicket-components-playground/wiki/22.-NestedStringResourceLoader kind regards Tobias > Am 01.07.2016 um 17:22 schrieb Sven Meier : > > Hi, > > alternatively you could role your own Localizer or IStringResourceLoader that > does some fancy replacement. > > Have fun > Sven > > >> On 01.07.2016 08:50, ChambreNoire wrote: >> The thing is, I don't know in advance which words need to be dynamically >> changed. >> >> So for instance : >> >> "The user is not currently associated with a service" >> >> I could want to replace 'user', 'service' or even 'associated' depending on >> the context. >> >> I could always add context-specific property files with the overridden >> version : >> >> package_contextA.properties > The peasant is not current managed by a >> landowner >> >> I suppose these could be generated at build by parsing the base >> package.properties and generating context-specific property files where >> necessary (only if these contain words to be replaced). >> >> Seems a bit messy though... >> >> CN >> >> -- >> View this message in context: >> http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4674992.html >> Sent from the Users forum mailing list archive at Nabble.com. >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic localisation
Hi, alternatively you could role your own Localizer or IStringResourceLoader that does some fancy replacement. Have fun Sven On 01.07.2016 08:50, ChambreNoire wrote: The thing is, I don't know in advance which words need to be dynamically changed. So for instance : "The user is not currently associated with a service" I could want to replace 'user', 'service' or even 'associated' depending on the context. I could always add context-specific property files with the overridden version : package_contextA.properties > The peasant is not current managed by a landowner I suppose these could be generated at build by parsing the base package.properties and generating context-specific property files where necessary (only if these contain words to be replaced). Seems a bit messy though... CN -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4674992.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Implications of setRecreateBookmarkablePagesAfterExpiry()
Done. Thank you for checking it out. https://issues.apache.org/jira/browse/WICKET-6192 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Implications-of-setRecreateBookmarkablePagesAfterExpiry-tp4674899p4674996.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Implications of setRecreateBookmarkablePagesAfterExpiry()
Hi Ravi, On Fri, Jul 1, 2016 at 11:04 AM, Ravi wrote: > Copied from Jira > > /Works! > Thank you./ > > Sorry, but I have to correct myself. > > The way I use it, it still does not work. > In a nutshell that's what we try to archive: > Save a cookie on a client browser under the path of the current page. > The page does have a mandatory named parameter! > If the Session expires. The SessionExpiredPage will read the cookie and > start a redirect. > > What happens now is that by the time the AbstractBookmarkableMapper wants > to > generate the URL of the component, before including the existent > parameters, > it does an getRecreateMountedPagesAfterExpiry() check (see > > https://github.com/apache/wicket/blob/wicket-7.x/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapper.java#L479 > ). > which answers false and the existing parameters are not added to the new > UrlInfo object. > > That in return will lead to a failure when calling setPlaceholders(copy, > url) (see > > https://github.com/apache/wicket/blob/wicket-7.x/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/MountedMapper.java#L206 > ) > and results in a null url return value, that lets wicket default to the > generic URL we had before. > > I hope to get across what I mean, my english is a little rusty :) > Try to express yourself better with a quickstart application ;-) Please attach it to a new ticket in JIRA. Thanks! > > Thanks! > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Implications-of-setRecreateBookmarkablePagesAfterExpiry-tp4674899p4674993.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Implications of setRecreateBookmarkablePagesAfterExpiry()
Copied from Jira /Works! Thank you./ Sorry, but I have to correct myself. The way I use it, it still does not work. In a nutshell that's what we try to archive: Save a cookie on a client browser under the path of the current page. The page does have a mandatory named parameter! If the Session expires. The SessionExpiredPage will read the cookie and start a redirect. What happens now is that by the time the AbstractBookmarkableMapper wants to generate the URL of the component, before including the existent parameters, it does an getRecreateMountedPagesAfterExpiry() check (see https://github.com/apache/wicket/blob/wicket-7.x/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/AbstractBookmarkableMapper.java#L479). which answers false and the existing parameters are not added to the new UrlInfo object. That in return will lead to a failure when calling setPlaceholders(copy, url) (see https://github.com/apache/wicket/blob/wicket-7.x/wicket-core/src/main/java/org/apache/wicket/core/request/mapper/MountedMapper.java#L206) and results in a null url return value, that lets wicket default to the generic URL we had before. I hope to get across what I mean, my english is a little rusty :) Thanks! -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Implications-of-setRecreateBookmarkablePagesAfterExpiry-tp4674899p4674993.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic localisation
The thing is, I don't know in advance which words need to be dynamically changed. So for instance : "The user is not currently associated with a service" I could want to replace 'user', 'service' or even 'associated' depending on the context. I could always add context-specific property files with the overridden version : package_contextA.properties > The peasant is not current managed by a landowner I suppose these could be generated at build by parsing the base package.properties and generating context-specific property files where necessary (only if these contain words to be replaced). Seems a bit messy though... CN -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-localisation-tp4674990p4674992.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org