Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8107723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:52:17+00:00 2026-06-06T00:52:17+00:00

EDIT : I completely re-wrote the question since it seems like I was not

  • 0

EDIT: I completely re-wrote the question since it seems like I was not clear enough in my first two versions. Thanks for the suggestions so far.

I would like to internationalize the source code for a tutorial project (please notice, not the runtime application). Here is an example (in Java):

/** A comment */
public String doSomething() {
  System.out.println("Something was done successfully");
}

in English , and then have the French version be something like:

/** Un commentaire */
public String faitQuelqueChose() {
  System.out.println("Quelque chose a été fait avec succès.");
}

and so on. And then have something like a properties file somewhere to edit these translations with usual tools, such as:

com.foo.class.comment1=A comment
com.foo.class.method1=doSomething
com.foo.class.string1=Something was done successfully

and for other languages:

com.foo.class.comment1=Un commentaire
com.foo.class.method1=faitQuelqueChose
com.foo.class.string1=Quelque chose a été fait avec succès.

I am trying to find the easiest, most efficient and unobtrusive way to do this with the least amount of manual grunt work (other than obviously translating the actual text). Preferably working under Eclipse. For example, the original code would be written in English, then externalized (to properties, preferably leaving the original source untouched), translated (humanly) and then re-generated (as a separate source file / project).

Some trails I have found (other than what AlexS suggested):

  • AntLR, a language parser / generator. There seems to be a supporting Eclipse plugin
  • Using Eclipse’s AST (Abstract Syntax Tree) and I guess building some kind of plugin.

I am just surprised there isn’t a tool out there that does this already.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:52:19+00:00Added an answer on June 6, 2026 at 12:52 am

    I’d use unique strings as methodnames (or anything you want to be replaced by localized versions.

    public String m37hod_1() {
      System.out.println(m355a6e_1);
    }
    

    then I’d define a propertyfile for each language like this:

    m37hod_1=doSomething
    m355a6e_1="Something was done successfully"
    

    And then I’d write a small program parsing the sourcefiles and replacing the strings. So everything just outside eclipse.

    Or I’d use the ant task Replace and propertyfiles as well, instead of a standalone translation program.
    Something like that:

    <replace 
        file="${src}/*.*"
        value="defaultvalue"
        propertyFile="${language}.properties">
      <replacefilter 
        token="m37hod_1" 
        property="m37hod_1"/>
      <replacefilter 
        token="m355a6e_1" 
        property="m355a6e_1"/>
    </replace>
    

    Using one of these methods you won’t have to explain anything about localization in your tutorials (except you want to), but can concentrate on your real topic.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not exactly sure what question to ask here since I don't know the
I need to edit or completely replace outline data (bezier curves) of OpenType fonts.
EDIT: There's now a doc page on this so this question is irrelevant, also
first question here. I am trying to learn python by stepping through project euler,
My question pertains to multi-threading in Java. I'm translating an app I wrote in
Thanks for reading this. I imagine this is really a javascript question, and my
Undoubtedly this question has been asked before, except I completely lack the knowledge to
Let me preface my question by saying that I am completely unqualified to be
Completely restated my question: Problem: Losing reference to an iFrame with Mozilla firefox 3.6
Greetings everyone. This is my first question here at stackoverflow so please bear with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.