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 3678586
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:21:33+00:00 2026-05-19T03:21:33+00:00

I am using Struts2 Internationalization to support English & Arabic. I want to know

  • 0

I am using Struts2 Internationalization to support English & Arabic.

I want to know that is it possible to dynamically or automatically change the position of label which comes before any input (text, date, etc.) when the locale changes?

E.g.

LTR -> English -> First Name – “Input Text Box”

RTL -> Arabic -> “Input Text Box” – أول اسم

Any possible solution for this?

BR
SC

  • 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-05-19T03:21:34+00:00Added an answer on May 19, 2026 at 3:21 am

    Either (ab)use java.awt.ComponentOrientation

    String direction = ComponentOrientation.getOrientation(locale).isLeftToRight() ? "ltr" : "rtl";
    

    (its source code is pretty trivial though, there are only 4 languages which are RTL, here’s an extract of relevance)

    public static ComponentOrientation getOrientation(Locale locale) {
        String lang = locale.getLanguage();
        if ("iw".equals(lang) || "ar".equals(lang) || "fa".equals(lang) || "ur".equals(lang)) {
            return RIGHT_TO_LEFT;
        } else {
            return LEFT_TO_RIGHT;
        }
    }
    

    Or put it in a recourcebundle yourself.

    this.direction = ltr
    

    And read it as follows

    String direction = bundle.getString("this.direction");
    

    Either way, you can make use of this to change the direction accordingly.

    <html dir="${direction}">
    

    which would end up as <html dir="ltr"> or <html dir="rtl"> in generated HTML.

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

Sidebar

Related Questions

I'm using struts2 and hibernate and I want to know how to store and
I am using struts2 . I want that after clicking on link on 1st
Using struts2 with jsp with standard struts tag libraries. I'm trying to dynamically hide
In a web application using struts2 ejb hibernate, is it possible to tell the
I am creating dependent drop downs using Struts2 jquery. The problem is that getLobList()
I'm using the struts2 jasperreports plugin and it works well. The problem is that
I am using Struts2 with Spring plugin. I want to set a variable value
I want to create a simple web project app. I am using struts2 and
I am using struts2 for Action and jquery for UI ... I want to
Im using struts2 and also servlets. (Due to a 3rd party ajax thing that

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.