• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts2: Generating list of localisation keys?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to be able to generate a list of localisation keys in my project. Basically I want to be able to add the key to the page and then output to file the keys. Is there any way I could do this? It would mean visiting each page in my project, but I just figured it would be simpler than copy and pasting from each page. I am using the struts 'text' tag in general:

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Grep?
 
André-John Mas
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not really a solution, since I would still need to need to copy and paste. I am looking for all keys, no just certain ones.

I tried ActionSupport.getText(), but it does not seem to be used in all cases.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Copy and paste what? It's trivial to pull out the "name" attribute.

If it's well-formed JSP parse it as XML, then--same difference, and you'd have to write code instead of just using existing tools.

What do you mean you "tried ActionSupport.getText()"?
 
André-John Mas
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you put it that way, I suppose I could use grep.

What I meant with regards to ActionSupport.getText() is that I over-rided hoping that it would be called with the key.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's quite a few getText() signatures; you'd probably have to implement all of them (particularly if you use it from within actions as well as through the <s:text> tag). The <s:text> tag will use the first TextProvider on the value stack.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic