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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:32:16+00:00 2026-05-23T12:32:16+00:00

We define all our internationalized constant strings in a single properties file LocalizableResource_xx.properties (one

  • 0

We define all our internationalized constant strings in a single properties file LocalizableResource_xx.properties (one per language) located in google.gwt.i18n.client.

This way it is possible to access the constants in Java code via the constants interface

Window.alert(myConstants.helloWorld());

as well as to use them inside the UiBinder .ui.xml

<ui:attribute key="some.key" name="text" description="useful info" />

This approach doesn’t work well if the string contains a single quote ('). This is because the GWT compiler throws a java.text.ParseException: Unterminated single quote: when it processes the .ui.xml files. If we escape the quote, meaning double it (''), the compiler passes but the strings accessed via the constant interface contain both single quotes (like in You can''t do that).

Replacing the single quotes with the utf-8 encoding \u0027 doesn’t help (same exception as above).

Is it somehow possible to use the same properties file in UiBinder templates as well as in Java code without running into annoying single quote problems?

  • 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-23T12:32:17+00:00Added an answer on May 23, 2026 at 12:32 pm

    Since there doesn’t seem to be another solution I’ll post our workaround to the mentioned issue:

    We created a wrapper class implementing the constants interface that simply passes the i18n constants to a String modify(String) before they’re passed to the caller.

    public class ConstantsWrapper implements MyConstants {
    
        private static MyConstants sConstants = GWT.create(MyConstants.class);
    
        public static String transform(String text) {
            return text.replaceAll("''", "'");
        }
    
        @Override
        public String someText() {
            return transform(sConstants.someText());
        }
    
        ...
    }
    

    I am still looking forward to a real solution.

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

Sidebar

Related Questions

How would you write a regular expression to define all strings of 0's and
I define a 'block' of text as all lines between start of file, newline
I want to define a constant that should be available in all of the
One can remove all calls to printf() using #define printf . What if I
In our application we have a central resource where we define all system-wide menus
We include a header.php file across all the pages on our site. So we
I need user to define all the environment variables needed for my program in
Hi All is there any way to locally define a variable in a function
it's all in index.php /* Define site root */ defined('DOCUMENT_ROOT') ? null : define('DOCUMENT_ROOT',realpath(dirname(__FILE__)));
First of all, let's define a few tables: Users table will store information about

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.