3

I have been searching on line for a tool that externalized strings in JavaScript but I have been unable to do so. I was hoping there would be something similar to the one built into eclipse (Source -> Externalize Strings...). If someone knows of a tool or plugin for eclipse that could accomplish that, let me know.

We have a software project that is already mature but now needs to support translations, and hence we need the string externalized.

hbhakhra
  • 4,206
  • 2
  • 22
  • 36
  • data belongs in HTML, styles belong in CSS, interactions belong in JS. if you're doing translations, it sounds like you should be reading HTML content/attributes/hidden data to get the correct text. – zzzzBov Jun 05 '12 at 20:57
  • With dynamically generated pages, a lot of the strings do come from JS – hbhakhra Jun 05 '12 at 21:03
  • 1
    do you mean they come from AJAX, or are the strings hard-coded in JS? – zzzzBov Jun 05 '12 at 21:20

1 Answers1

2

I suggest you use a JSON-based language look-up table if you want to populate these values via JavaScript. Eclipse cannot help you with this.

See: Localization in a web app using JavaScript and JSON

Community
  • 1
  • 1
Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176