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

  • SEARCH
  • Home
  • 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 7735033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:23:57+00:00 2026-06-01T07:23:57+00:00

A friend and me are starting a new software project (in Java), and we’re

  • 0

A friend and me are starting a new software project (in Java), and we’re thinking about how to do internationalization for the GUI. While I’d prefer to have english strings with placeholders in the code like this:

gettext("$name invites you to join $room", invitation.whose, invitation.roomname)

, my friend would prefer to only have an identifier, like invitation_message, in the code. My argument is that when the english string changes, the meaning might have changed somewhat, too, so the old translations shouldn’t be valid anymore. However, he thinks the messages should be seperated from the code.

So, which method would you prefer and why? Or do you even have entirely different suggestions?

  • 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-01T07:23:58+00:00Added an answer on June 1, 2026 at 7:23 am

    It depends. There are many things in your question, and I am not sure if I understand it correctly.

    1. Your friend want to separate programming logic from the translatable strings. Well, that’s how Java’s standard I18n resources (via ResourceBundle) works. If you want to use standard tools or commands (for example Externalize Strings in Eclipse), frankly it’s the only way to go.
      However, some people think having keys in source files and a lot of rb.getString(key) poisons the code. Certainly, the code containing English strings is more readable. And you already have them, so you are not risking that you will see keys instead of real messages. With all pros and cons of this situation.
      If you stick to gettext, some tools might report these strings as hardcoded…

    2. I wonder what you mean by “While I’d prefer to have english strings with placeholders in the code like this”… Do your friend prefer not to use placeholders? That wouldn’t be a good idea. Due to target language’s grammar rules, people might actually need to re-order the sentence during translations, so in your example “$room” may come before “$name”.

    Going back to code – translatable strings separation, standard i18n Java programming guideline is to have translatable strings completely separated from programming logic. And you should follow guidelines unless you have good reason not to.

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

Sidebar

Related Questions

I have a friend that is starting up a new project. He wants to
My friend and I are starting a Rails project together and hosting the repo
As a project of this semester my friend and I are thinking to make
A friend is just starting to learn Java, using IntelliJ. He asks how can
I'm thinking of starting a facebook style website with bio pages, friend requests etc,
friend's I have a task to place the horizontal scroll or swipe menu tabs
Only yesterday, I was asking a friend of mine how he would go about
I have an server (available via ssh) on the internet that my friend and
I've been a Facebook developer for a while now, but I'm starting fresh with
A friend was burned when starting to learn Python, and now sees the language

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.