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.

3
  • 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. Commented Jun 5, 2012 at 20:57
  • With dynamically generated pages, a lot of the strings do come from JS Commented Jun 5, 2012 at 21:03
  • 1
    do you mean they come from AJAX, or are the strings hard-coded in JS? Commented Jun 5, 2012 at 21:20

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

2 Comments

This is for the look-up table. It doesn't seem to help get the strings out of the javscript code. I could be wrong, if so, let me know :)
The JSON file can stand-alone without being part of the actual JS code, and can also be fetched via AJAX.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.